On Friday, January 17, 2003, at 08:31 AM, Mirko Viviani wrote:
(1)David Ayers <[EMAIL PROTECTED]> ha scritto: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!I know...In the very unlikely event that no messages get sent toThe problem is really this... how to be sure that a message will be 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.
these classes ?
+initialize will always be sent to a class before it is used. If you are really paranoid, you could take one class's +initialize method that you know is being used first, and add a bunch of
[ThisClass class]
[AnotherClass class]
[Etc class]
and all those classes will be initialized also.
(2) Objective-C code should never be used in a +load method. A lot of basic Objective-C/Foundation code is not setup when the +load messages are sent (like NSString). Trying to send messages in +load can potentially cause a nightmare of recursive initialization.
(3) My personal preference is to not put any 'executable' code (Objective-C or otherwise) in +load OR +initialize methods. If at all possible, classes should be setup in a lazy manner, which avoids a lot of startup costs. Although I realize this is not possible in many cases.
_______________________________________________
Bug-gnustep mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-gnustep
