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

Sebastian Reitenbach developer@opengroupware.org
Mon, 10 Dec 2007 00:02:21 +0100


developer@opengroupware.org wrote: 
> 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.
Yeah, you told me about the SessionSingletons some time ago, I think it was 
regarding the ability to save searches on documents in projects. 
Nevertheless, at least whatever my problem was, afar I could fix the problem 
afterwards. But I did not really understood, under what circumstances it 
would be useful to use or not use a SessionSingleton.

I think such an explanation would be useful to include in the developer 
docs.

kind regards
Sebastian