struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Perry" <d.pe...@netcase.co.uk>
Subject RE: [OT] DTOs are evil
Date Fri, 05 Aug 2005 13:38:52 GMT
eh? you can do that without the getter/setter in java as MyProperty is
public.

Daniel.


> -----Original Message-----
> From: Larry Meadors [mailto:larry.meadors@gmail.com]
> Sent: 05 August 2005 14:18
> To: Struts Users Mailing List
> Subject: Re: [OT] DTOs are evil
>
>
> You don't see it?!? Have you looked?
>
> As a self-professed Java bigot, I will readily admit that C# has a
> *way* better sytax for defining and using properties that I wish Java
> would implement (or even better - improve upon).
>
> public string MyProperty {
> 	get { return myProperty; }
> 	set { myProperty = value; }
> }
>
> Now, instead of:
>
> someValue = foo.getMyProperty();
> foo.setMyProperty(someValue);
>
> ...I can do this instead:
>
> someValue = foo.MyProperty;
> foo.MyProperty = someValue;
>
> IMO, the second form is MUCH clearer, and provides all of the benefits
> of a get/set pair.
>
> Larry
>
>
> On 8/5/05, Leon Rosenberg <struts_user@anotheria.net> wrote:
> >
> > Sorry, I don't see it.
> >
> > Example:
> > private String mail;
> > public String getMail(){
> > return mail;
> > }
> >
> > public void setMail(String aMail){
> > mail = aMail;
> > }
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


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


Mime
View raw message