scheme High Level Class and representations
scheme High Level Class and representations
- Subject: scheme High Level Class and representations
- From: René v Amerongen <email@hidden>
- Date: Mon, 15 Dec 2008 13:02:13 +0100
Hi,
What are your idea's to solve this the right way.
I have a class ( high level ) that receives data. The type of data is
unknown and is only recognisable by an included header inside the data.
This header could be 16 bytes or 32 bytes long. Depending on this
header I will call a worker.
Because of the extensibility of the HLClass because of new data
type's, I would like to make that HLClass known about
DataTypeWorker_xx Classes.
In other words, this High Level Class works in conjunction with
several representation objects (subclasses of DataTypeWorker), which
recognisable and manage the actual data.
I hope the purpose is clear.
Now I am filling manually during the HLClass initialisation a
DatatypeRepresentation array and walk through it for all the
DataTypeWorker_xx objects.
It works, but I feel I have to much code around and not so dynamic as
I think it should be with Obj-C.
How does Apple or you doing this ( f.e NSImage and NSString )?
How can I add just a DataTypeWorker_xx.mh ( representations ) to the
project, with at less code as possible ( read no extra code ) in the
HLClass, that will be recognised by the Highlevel Class?
Should I, during the initialisation ( initialize ) of the
representation classes, add the 'classes' to a global dictionary, and
read this global with the HLClass?
This because I am afraid that it is uncertain which class will be the
first called, HLClass initialize or initialize of the representation
DataTypeWorker_xx Classes!
I want create the objects only at the moment that I really need them.
Is this the way?
Thanks in advance
RvA
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden