[OGo-Developer] Re: [OGo-Users] Re: click-to-dial & Asterisk

Helge Hess developer@opengroupware.org
Sun, 9 Dec 2007 23:44:20 +0100


On 09.12.2007, at 23:37, Sebastian Reitenbach wrote:
>> Note that -init can return *different* objects. Thats sometimes used
>> for caches which return a cached object and dealloc the newly created
>> instance. Its also used in class clusters. etc.
> damn, and now I'm confused again, do you have any class or sth, in  
> ogo,
> where this happens?

You can probably ignore that "feature".


Anyways, Class cluster do that all the time, eg NSString:
   http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/CocoaObjects/chapter_3_section_9.html

Eg if you say
   [[NString alloc] init...]

you do not get an object of the NSString class, but some subclass of  
NSString depending on the -init method and the string passed to that  
method. (the NSString cluster hides the subclass details from you).

But OGo also does that, eg in 'page singletons' (root pages like  
LSWPersons). Those pages are only allocated once per session and  
contain code to ensure that in -init.

Helge
-- 
Helge Hess
http://www.helgehess.eu/