Re: Business objects with no properties and data binding
Alex Ivanoff <[email protected]>
| Newsgroups | gmane.comp.windows.devel.dotnet.web |
|---|---|
| Message-ID | <[email protected]> |
OO is about encapsulation, polymorphism and inheritance, not properties. On 3/2/07, Pardee, Roy <[email protected]> wrote: > > I thought that was a feature of OO--that you could hide the > implementation of a property from the end-user? > > -----Original Message----- > From: Discussion of building .NET applications targeted for the Web > [mailto:[email protected]] On Behalf Of Ivanoff, Alex > Sent: Friday, March 02, 2007 6:56 AM > To: [email protected] > Subject: Re: [DOTNET-WEB] Business objects with no properties and data > binding > > My original sample was simplified. My real object accessors are more > involved (change object state). Plus, I do not like properties since > they look like fields but behave like methods (Jeffrey Richter explained > it great in his book "CLR via C#"). > > > -----Original Message----- > From: Discussion of building .NET applications targeted for the Web > [mailto:[email protected]] On Behalf Of Paul van Brenk > Sent: Friday, March 02, 2007 03:21 > To: [email protected] > Subject: Re: [DOTNET-WEB] Business objects with no properties and data > binding > > Why are the objects designed this way... just asking, maybe there is > something I'm missing. > > I would do this: > > public class State > { > private String _abbr; > private String _name; > > public String Abbr > { > get{ return this._abbr; } > } > > public String Name > { > get{ return this._name; } > } > } > > -----Original Message----- > From: Discussion of building .NET applications targeted for the Web > [mailto:[email protected]] On Behalf Of Alex Ivanoff > Sent: Thursday, March 01, 2007 22:20 > To: [email protected] > Subject: [DOTNET-WEB] Business objects with no properties and data > binding > > Is it possible to data bind a web control (DropDownList) to a list of > business objects which do not have properties but accessor methods > instead: > > public class State > { > private String _abbr; > private String _name; > > public String GetAbbr() > { > return this._abbr; > } > > public String GetName() > { > return this._name; > } > } > > Thank you, > Alex > > =================================== > This list is hosted by DevelopMentor(r) http://www.develop.com > > View archives and manage your subscription(s) at > http://discuss.develop.com > > =================================== > This list is hosted by DevelopMentor. http://www.develop.com > > View archives and manage your subscription(s) at > http://discuss.develop.com > > =================================== > This list is hosted by DevelopMentor http://www.develop.com > > View archives and manage your subscription(s) at > http://discuss.develop.com > > =================================== > This list is hosted by DevelopMentor(r) http://www.develop.com > > View archives and manage your subscription(s) at > http://discuss.develop.com > =================================== This list is hosted by DevelopMentor® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com