473,387 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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

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
Nov 22 '05 #1
2 1314
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" <an*******@discussions.microsoft.com> wrote in message
news:77**********************************@microsof t.com...
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.
Does anyone have any advice, recommendations, tips... whatever. Maybe just tell me what you use.
Thanks,
Craig

Nov 22 '05 #2
Craig
Bill will still be able to offer advice if you will email him at
wyran@nospam_knowdotnet.com.
Les

"Craig" <an*******@discussions.microsoft.com> wrote in message
news:1B**********************************@microsof t.com...
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.

----- Les Smith wrote: -----

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" <an*******@discussions.microsoft.com> wrote in message
news:77**********************************@microsof t.com...
> 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. >> Does anyone have any advice, recommendations, tips... whatever.
Maybe just
tell me what you use. >> Thanks,

> Craig


Nov 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Jason | last post by:
Let's say I have an html form with 20 or 30 fields in it. The form submits the fields via POST to a php page which updates a table in a database with the $_POST vars. Which makes more sense? ...
0
by: ReignMan | last post by:
I'm running JDK 1.4.0_01, Xalan2.5.1 and Tomcat 4.1.27. XSL transformations work, yet when running in debug mode (Eclipse IDE), I get the following: 990S2html.xsl:3:80: Element type...
2
by: Craig | last post by:
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...
6
by: SHC | last post by:
Hi all, I created an application from the Console Application (.NET) of VC++ .NET 2003, and I did "Build" the application of the attached .cpp file, volcanoes.xml and geology.dtd on my VC++ .NET...
54
by: Victor Mehta | last post by:
would it matter if I decided to make a primary key a string of numbers vs actual numbers ? would it make any difference to DB2 in terms of efficiency ? why would you choose numeric over a string...
5
by: G. Stewart | last post by:
The word "Business" in the term implies some sort of commercial aspects or connotations. But from what I can see, that is not necesserially the case at all? So what is the reasoning behind the...
17
by: RSH | last post by:
I am really trying to grasp the concept of OOP as it applies to C#. I am looking at trying to set up a simple Employee Class but I am having trouble conceptualizing what this class should look...
4
by: Stefano | last post by:
Hi all, I'm designing classes for my application. I'd like to create a business entity that could be expanded with other properties when needed. For example, this could be my entity: ...
2
by: grawsha2000 | last post by:
Greetings, I am developing this N-tier business app. The problem I'm facing is when I try to pass business objects (employees, dept..etc) from business tier to data tier,i.e., the add method in...
2
by: sangam56 | last post by:
hi all.i have downloaded and studied the asp.net employee starter kit. I liked the way the business layer is created. it is too much time consuming to hand code all the business layer classes for so...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.