Custom Attribute Questions.....
Custom Attribute Questions.....
- Subject: Custom Attribute Questions.....
- From: Kieran Kelleher <email@hidden>
- Date: Wed, 15 Jun 2005 11:24:10 -0400
I need a little Customer EO Attribute advice so I don't end up missing
the beach this weekend like Chuck Hill did on page 43 of PWO :-)
I have a custom class, EncryptedEOAttribute, that wraps a String ivar
named _decodedValue
The class has value() and setValue() that return and set the raw clear
string.
It has a conversion method public String toEncodedString() that encodes
the string into the database.
It has a factory method that decodes an encoded string from the
database to create an instance (wrapping the clear string):
public static EncryptedEOAttribute createInstanceFromEncodedString(
String encodedString )
It has a display method toString() that masks the clear string by
replacing most of the characters with an asterisk.
In my app, I plan to simply use setValue to update the instance's
_decodedValue ivar.
For a class like this, do I have to worry about the object mutability
snapshot saving problem since changes only occur when setValue is
called and the String ivar _decodedValue is changed?
If so, how would I approach it ..... do I need to design my
EncryptedEOAttribute class to be immutable (basically remove setValue
method) and create a new instance every time a new _decodedValue is to
be stored? Does EOF just compare the object reference to the snapshot
reference or does it use the conversion method return value for
snapshot comparison before deciding to save.
Regards,
-Kieran
________________________________________________________________
Blog: http://webobjects.webhop.org/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden