eh? you can do that without the getter/setter in java as MyProperty is public.
Daniel. > -----Original Message----- > From: Larry Meadors [mailto:[EMAIL PROTECTED] > 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 <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]