Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / General / January 2007

Tip: Looking for answers? Try searching our database.

Class Design question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Will - 31 Jan 2007 18:08 GMT
We use Public properties in our business classes to represent field
values from databases.  So in Vb, I might have something like:

  Public Property Emp_Id() As System.Decimal
       Get
           Return _Emp_Id
       End Get
       Set(ByVal value As System.Decimal)
           _Emp_Id = value
       End Set
   End Property

So now it's easy enough for some code to create an instance of the
class and get or set the value.  But I'd like to be able to get the
friendly name of a field, like a data dictionary.  The business object
should be able to provide this friendly name to a form for example to
use as a label or maybe a grid column heading.

In my example above, I can reference Emp_Id like this:

Employee.Emp_Id

What I'd like to be able to do is create a way for me to store the
friendly name in the business class and access it in a similar way
like this perhaps:

Employee.Emp_Id.FriendlyName

Any ideas?
Kevin Spencer - 31 Jan 2007 21:06 GMT
An aggregate type (one that has more than one field or property) is either
going to be a structure or a class. So, you need to create a structure or a
class, rather than using a System.Decimal. For example, you could use a
structure that has a System.Decimal member and a string member.

Signature

HTH,

Kevin Spencer
Microsoft MVP
Software Composer
http://unclechutney.blogspot.com

The shortest distance between 2 points is a curve.

> We use Public properties in our business classes to represent field
> values from databases.  So in Vb, I might have something like:
[quoted text clipped - 25 lines]
>
> Any ideas?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.