Abstract Methods

From RAD Studio
Jump to: navigation, search

Go Up to Protecting Methods

Sometimes a method is declared as abstract in a Delphi component. In the component library, abstract methods usually occur in classes whose names begin with "custom," such as TCustomGrid. Such classes are themselves abstract, in the sense that they are intended only for deriving descendent classes.

While you can create an instance object of a class that contains an abstract member, it is not recommended. Calling the abstract member leads to an EAbstractError exception.

The abstract directive is used to indicate parts of classes that should be surfaced and defined in descendent components; it forces component writers to redeclare the abstract member in descendent classes before actual instances of the class can be created.

See Also