bug-gnustep
[Top][All Lists]
Advanced

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

Re: [Fwd: RFC GDL2: move +load implementations to +initialize]


From: David Ayers
Subject: Re: [Fwd: RFC GDL2: move +load implementations to +initialize]
Date: Fri, 17 Jan 2003 15:06:57 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3a) Gecko/20021212

Hi Mirko,

Mirko Viviani wrote:

David Ayers <d.ayers@inode.at> ha scritto:

I don't have an app complex enough to test regressions (and the guile-gdl2 regression testing tool I'm working out now was ironically the executable bitten) but I believe it to be sane to assume that before an EODatabaseChannelNeededNotfication is posted, that EODatabseChannel should have recieved an +initialize and before an EOCooperatingObjectStoreNeeded is posted, than EODatabaseContext should have been initialized.

Why the EODatabaseChannel should have received the +initialize before the
notification of the EOObjectStoreCoordinator ?
You should invoke it manually, it has no sense.

No, no, both +load and +initialize are guaranteed to be sent by the runtime, not by any explicit code! The difference is that +load is sent as the soon as the class is "loaded" and this can be before other classes (in my case GSPlaceholderString) are loaded, and the runtime doesn't won't know about those classes. And +initialze will be sent as the first message to a class before *any* other message is sent (i.e. [EODatabaseContext class] will make the runtime send +initialize to EODatabaseContext before it gest sent class.)

If not, then we might in insure all expected initializes have been sent in some startup function that we somehow guarantee to be called early in GDL2 initialization.

I don't know of a different function than +load to do the job.
Remember that I can only use EOControl without EOAccess (ok, maybe not now),
why do I have to force the developer to call +initialize method of these
classes ?

No code should *ever* call +initialize explicitly, just like no code is supposed to call +load explicitly. And thier implementains should *never* call super. There is nothing a developer should need to do.

In the very unlikely event that no messages get sent to EODatabaseContext before the the EOCooperatingObjectStoreNeeded Notification gets posted, we should just make sure to call some EODatabaseContext method (like [EODatabaseContext class]) real early to force the runtime to send +initialize to EODatabaseContext.

Cheers,
Dave

PS: see http://developer.apple.com/techpubs/macosx/Cocoa/Reference/Foundation/ObjC_classic/Classes/NSObject.html#//apple_ref/occ/clm/NSObject/initialize







reply via email to

[Prev in Thread] Current Thread [Next in Thread]