Re: Shared objects and other data
Re: Shared objects and other data
- Subject: Re: Shared objects and other data
- From: Raphael Sebbe <email@hidden>
- Date: Tue, 2 Apr 2002 17:05:02 +0200
From what I understand, you want to share an instance (the actual data).
The best route as seen from a Cocoa standpoint seems to be DO, as said
by OC. Another solution is using shared memory (no OOP). Just in case
you have a Windows background (don't flame me, I don't have such a
background myself, just came across that when doing some porting ;-) ),
there is no equivalent to DLL shared data section (shared across
processes) on Mac OS X.
Raphael
On Tuesday, April 2, 2002, at 04:41 PM, email@hidden wrote:
In a message dated 4/2/02 7:32:55 AM, email@hidden writes:
to have a shared class you need a shared code: either a framework, or a
loadable bundle;
This is what I require.
(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).
Sorry if I was not more specific, but I meant that I don't want to
make
the data into instance variables, because then references would be
created
each time that the class is instantiated, which is not much of a
problem, but
I don't like the inefficiency of it.
On the other hand, I don't want to contradict OOP by placing the
data
into static global scope, though that would be better than making
references
to it in each instantiation of the class.
I could also just calculate the data each time within a method that
needed it in order to keep the data from being outside of a class declar
ation, but this is also wasteful and unwanted.
My question is, what is the best way to share such data (any data)
that
is like this.
Are you really sure you appreciate the difference between a class and
an
instance? If so, I don't understand.
If I am muddled in my thinking, please correct me. Thank you.
_______________________________________________
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.
_______________________________________________
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.