[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: nameForObject()?



On Mon, 29 Jan 2001, Andreas Monitzer wrote:
> On Monday, January 29, 2001, at 08:30 PM, Falko Braeutigam wrote:
> 
> > Why do you need this extra reference via the object name? You may simply say: 
> >  
> > 	public SecondObject getSecondObject() { 
> > 		return obj; 
> > 	} 
> >  
> > and setting the obj member to be non-transient of course. 
> 
> Because in my product, there are thousands of these objects (maybe you
> remember that I'm programming a newsreader). I don't want to load them all at
> once (my own pre-database implementation did this and it took 3 mins to
> run&quit the application - with only about 100 objects).

Andreas! Don't do this to me, please!

Ozone is based on proxies. Having such a (proxy) member does of course _not_
mean that the target object is activated when the refering object is activated.
The target behind your obj member is activated just when you actually call a
method on it.

In other words: the objectForName() method would give you exactly that proxy
which you already have in the obj member - less efficient, of course. So,
there is no need to fiddle around with names.


Falko

> 
> > BTW: from inside a database object you should never acces the database via a 
> > static variable but via the database() method which all database object classes 
> > inherit by OzoneCompatible. 
> 
> ok, thanks.
> 
> andy
> 
> -- 
> We fucked up. We fucked up big time.
> -- Steve Jobs
-- 
______________________________________________________________________
Falko Braeutigam                              mailto:falko@smb-tec.com
SMB GmbH                                        http://www.smb-tec.com