One more newbie question
Keith Hodges
keith_hodges at yahoo.co.uk
Tue Oct 10 09:14:28 UTC 2006
>
> Yes, User's company attribute refer to object defined in the local
> application. In fact Company instance does not need to be persisted as
> it is unchangeable value.
>
> What I am afraid of is that when persisting one object I may also
> persist much more than I want.
>
> Eventually User's instance should reference company through their hash
> value but this will add complexity.
> I am not sure how I should handle that situation.
If your UserA references the company via a key/reference, then
persisting the User will persist the Key, rather than the entire company
datastructure.
There is are two mechanisms in magma which may help.
1. pre/post serialization, whereby you can indicate to magma that
objects of a particular class are informed before they are serialised,
or particular operations may be defined to be run before certain types
of object are serialised. look for implementors/senders of
#beforeSerializingAny: className do: oneArgValuator
and #maPreSerialize (note Chris has indicated that he wants to deprecate
the use of this selector in favour of the above.
2. #maAsStorageObject
whereby an object can provide an alternative form for persisting such as
a proxy reference that can be reconnected on realisation.
Keith
___________________________________________________________
Now you can scan emails quickly with a reading pane. Get the new Yahoo! Mail. http://uk.docs.yahoo.com/nowyoucan.html
More information about the Magma
mailing list