Back: Association-testing Up: Base classes Forward: Autoload class-instance creation   Top: GNU Smalltalk Library Reference Contents: Table of Contents Index: Class index About: About this document

1.6 Autoload

Defined in namespace Smalltalk
Superclass: none
Category: Examples-Useful tools
I am not a part of the normal Smalltalk kernel class system. I provide the ability to do late ("on-demand") loading of class definitions. Through me, you can define any class to be loaded when any message is sent to the class itself (such as to create an instance) or to its metaclass (such as #methodsFor: to extend it with class-side methods).

1.6.1 Autoload class: instance creation  (class)
1.6.2 Autoload: accessing  (instance)


1.6.1 Autoload class: instance creation

class: nameSymbol from: fileNameString
Make Smalltalk automatically load the class named nameSymbol from fileNameString when needed

class: nameSymbol in: aNamespace from: fileNameString
Make Smalltalk automatically load the class named nameSymbol and residing in aNamespace from fileNameString when needed

class: nameSymbol in: aNamespace loader: anObject
Make Smalltalk automatically load the class named nameSymbol and residing in aNamespace. When the class is needed, anObject will be sent #autoload. By default, instances of FilePath and Package can be used.

class: nameSymbol loader: anObject
Make Smalltalk automatically load the class named nameSymbol. When the class is needed, anObject will be sent #autoload. By default, instances of FilePath and Package can be used.


1.6.2 Autoload: accessing

class
We need it to access the metaclass instance, because that's what will load the file.

doesNotUnderstand: aMessage
Load the class and resend the message to it



Back: Autoload class-instance creation Up: Autoload Forward: Bag   Top: GNU Smalltalk Library Reference Contents: Table of Contents Index: Class index About: About this document


This document was generated on February, 22 2012 using texi2html