Which .Net type to use for a simple business entity ?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Does anyone have any advice on which type to use for a business entity in the following situation..

If I want to populate a form with Employee details (windows or web) , I will get a business entity from the Employees class and use that business entity to fill all the textboxes etc.

Using VB6, I would use a recordset as the business entity like so..

My Employees class would have a method like this..
Public Function GetEmployee (EmployeeID) as ADODB.Recordse
GetEmployee = ...
End Su

And I would populate my controls like this..
Set rst = objEmployees.GetEmployee(23
txtFirstName = rst("FirstName").

But now in .NET..
there are so many choices that it seems like a waste to just start using datasets where there might be better things to choose from. The types that I have thought about using are : dataset, datarow, datareader, structure, arraylist, and my own custom object. It doesn't have to do anything fancy --- just transfer data from the business tier to the presentation tier

It seems like structures are the way to go (no garbage collection required and strongly typed), but I haven't seen this recommended so I'm a bit unsure about using them

Does anyone have any advice, recommendations, tips... whatever. Maybe just tell me what you use

Thanks,
Craig
 
Craig
William Ryan has numerous articles on using ADO.NET. You might want to take
a looke at them at

http://www.knowdotnet.com/dataaccess.html

HTH
Les Smith
http://www.KnowDotNet.com

Craig said:
Does anyone have any advice on which type to use for a business entity in the following situation...

If I want to populate a form with Employee details (windows or web) , I
will get a business entity from the Employees class and use that business
entity to fill all the textboxes etc.
Using VB6, I would use a recordset as the business entity like so...

My Employees class would have a method like this...
Public Function GetEmployee (EmployeeID) as ADODB.Recordset
GetEmployee = ....
End Sub

And I would populate my controls like this...
Set rst = objEmployees.GetEmployee(23)
txtFirstName = rst("FirstName").

But now in .NET...
there are so many choices that it seems like a waste to just start using
datasets where there might be better things to choose from. The types that I
have thought about using are : dataset, datarow, datareader, structure,
arraylist, and my own custom object. It doesn't have to do anything
fancy --- just transfer data from the business tier to the presentation
tier.
It seems like structures are the way to go (no garbage collection required
and strongly typed), but I haven't seen this recommended so I'm a bit unsure
about using them.
 
Craig
Bill will still be able to offer advice if you will email him at
wyran@nospam_knowdotnet.com.
Les

Craig said:
Thanks, Les.

But I am really looking for information about using types (to use as
business entities) other than those types that ADO.Net offers. Especially
..Net structures, because they seem well suited for passing data between
tiers.
 
Back
Top