Re: Business objects with no properties and data binding

"Pardee, Roy" <[email protected]>
Newsgroups gmane.comp.windows.devel.dotnet.web
Message-ID <[email protected]>
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®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.