Documentation Archive Developer
Search
PATH  Documentation > WebObjects 4.5 > WebObjects Developer's Guide


Table of Contents Previous Section

Initialization and Deallocation Methods

Like all objects, WOApplication, WOSession, and WOComponent implement initialization methods (or constructors in Java). Because most subclasses require some unique initialization code, these are the methods that you override most frequently. In WebScript, the initialization method is named init. In Java, the initialization method is the constructor for the class.

Complementing init is the dealloc method. This method lets objects deallocate their instance variables and perform other clean-up tasks. The dealloc method is used primarily for Objective-C objects. Standard dealloc methods in Objective-C send each instance variable a release message to make sure that the instance variables are freed. WebScript and Java, because they have automatic garbage collection, usually make a deallocation method unnecessary. If you find it necessary, you can implement dealloc in WebScript and finalize in Java.

Table of Contents Next Section