Re: Shared objects and other data
Re: Shared objects and other data
- Subject: Re: Shared objects and other data
- From: Ondra Cada <email@hidden>
- Date: Tue, 2 Apr 2002 13:42:46 +0200
On Tuesday, April 2, 2002, at 06:14 , email@hidden wrote:
What is the best way to implement an instance of a class so that it is
available to all applications that request the shared object?
Well... I am not sure whether I follow properly. Since
- to have a shared class you need a shared code: either a framework, or a
loadable bundle;
- to share an instance though the only way is DO;
...
Would it be
best to make this a static global object
...whilst global object won't help at all: this globality is task-wide,
and different applications of course run in different tasks.
how should data that is used in several methods be dealt with; should such
data be declared as static global in the source file for the class, or is
That is possible if needed, but should be very rare,...
there a more OOP style for doing this?
...the recommended way is a shared (in task scope) object like
NSFileManager, NSUserDefaults, NSOpenPanel, etc.
(I don't want to store the data in the
class because then it would be recreated along with each new
instantiation
of the class and I don't want to have to recalculate the data each time in
order to keep it from being outside of the class).
Are you really sure you appreciate the difference between a class and an
instance? If so, I don't understand.
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
2K Development: email@hidden
http://www.2kdevelopment.cz
private email@hidden
http://www.ocs.cz/oc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.