On Thursday, Sep 11, 2003, at 17:25 US/Pacific, Nathan Dintenfass wrote:
So, you're saying a Person should have something like:

personalDetails = person.getPersonalData();

and then I'd reference, in my HTML/persister/etc:

personalDetails.firstName
personalDetails.lastName

It depends on exactly what you're trying to do. Generally, creating a memento of your object for the persister to store to disk is fine (note: you'd return a copy not a reference).


If so, I'm not sure I understand the benefit. I still need to know what
keys will be in my personalDetails struct, and now I lost the handy
auto-documentation of the components meta data.

Again, it depends on what you're trying to do with the metadata - it's easy enough to call getMetadata(person).


It also prevents something like:

person.getFullName()

where that method does a concatenation of the firstName and lastName (and
possibly middleName, if it's not blank) private attributes of my Person
instance.

Ah, now this is actually a valid use of getX() because it (a) might represent a public API to a person and (b) it is something that is constructed using logic rather than being a slavish rendering of a data member.


Again, this is all about "what is the public API of your class?"...

Or, am I missing the boat here?

I think you're just trying to be too black and white about it...


Sean A Corfield -- http://www.corfield.org/blog/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' in the message of the email.


CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]

Reply via email to