You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by David Graham <dg...@hotmail.com> on 2003/05/22 23:58:26 UTC

Re: value object question

OOP tries to package data with the operations on that data.  So, putting 
that method in your value object seems to be the right place.  I actually 
have that same method in one of my objects :-).

David


>I know this is almost a dumb question, but humor me.  If I have a
>value which is a combination or calculated value of two other
>properties in my value object, would I add a single getter method in
>my value object (with no corresponding setter method)?  An example
>would be
>
>public String getFullName() {
>     return firstName + " " + lastName;
>}
>
>..or would I put it somewhere else outside of my value object.
>
>Dan
>
>--
>- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>Daniel Allen, <da...@mojavelinux.com>
>http://www.mojavelinux.com/
>- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>Results! Why, man, I have gotten a ton of results!
>I know several thousand things that won't work!
>  --Thomas Edison
>- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>

_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*.  
http://join.msn.com/?page=features/featuredemail


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: value object question

Posted by Dan Allen <da...@mojavelinux.com>.
David Graham (dgraham1980@hotmail.com) wrote:

> OOP tries to package data with the operations on that data.  So, putting 
> that method in your value object seems to be the right place.  I actually 
> have that same method in one of my objects :-).

Thanks for clearing that up, my brain was just half dead for a moment there.
Excellent!

Dan

-- 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Daniel Allen, <da...@mojavelinux.com>
http://www.mojavelinux.com/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
"While they're pumping, you're soaking them" 
 -- Speed Loader TV Advert
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org