RAD Studio |  |

Abstract 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 descendant 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 descendant components; it forces component writers to redeclare the abstract member in descendant classes before actual instances of the class can be created.

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!