Abstract type: Difference between revisions
Content added Content deleted
Line 2,944: | Line 2,944: | ||
</lang> |
</lang> |
||
=={{header|Smalltalk}}== |
=={{header|Smalltalk}}== |
||
A class is declared abtract by responding to the query <tt>isAbstract</tt> with true, and defining the required protocol for subclasses to raise an error notification. Optionally, instance creation can be blocked (but seldom done, as you will hit a subclassResponsibility anyway soon). Typically, the IDE provides |
A class is declared abtract by responding to the query <tt>isAbstract</tt> with true, and defining the required protocol for subclasses to raise an error notification. Optionally, instance creation can be blocked (but seldom done, as you will hit a subclassResponsibility anyway soon). Typically, the IDE provides menu functions to generate these definitions automatically (eg. "Insert Abstract Class" in the refactoring submenu of the class browser): |
||
<lang smalltalk>someClass class >> isAbstract |
<lang smalltalk>someClass class >> isAbstract |
||
^ true |
^ true |