473,767 Members | 2,138 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Data/Business Object Tier Best Practices

I am developing a Windows Forms application in VB.NET that will use .NET
remoting to access the data tier classes.

A very simple way I have come up with is by creating typed (.xsd) datasets.
For example dsParts.xsd and including that in the data tier. I then will
create a class that looks like this
Public Class CPart
Inherits dsParts
Public Sub New(ByVal iPartID as Integer)
Dim cm As New OleDb.OleDbComm and
cm.CommandType = CommandType.Tex t
cm.CommandText = "Select * from tblParts where PartID=" &
iPartID
modData.FillDat aTable(cm, Me.tblParts, ConnectionStrin gs.QASpec)
'Fill data table is a common method where i pass in a command
and connection string
'it then fills the passed table object (ByRef) with the results
of the command
'I could fill more than 1 data table here if this xml data
schema had more than one table
'I can now add more methods to CPart and overide methods of the
underlying dataset if required
'CPart is a datasource which can be used in place of a standard
dataset object which is great for data binding

'One thing I haven't got to yet is Overriding or adding
additional methods to the other table classes in the underlying baseclass
'not sure how I will accomplish that part.
End Sub
End Class

To me this is a simple way of creating your dataclasses because you can
create your XML schema easily by dragging tables from the server explorer
directly on to the schema. Then when you Inherit the XML data schema (typed
dataset) you get all of the table fields as properties in your class by
default.

Doing it any other way just seems like A LOT OF WORK. Other ways would be
to create data classes and manually type in every field as a property. You
do not get your databinding capability (though I hear there is a way to make
these bindable at runtime). One thing you definatly won't get is design
time databinding (the other method mentioned above, we can bind the typed
datasets to our 3rd party grid controls easily at design time. )

Then with your dataclasses you have to implement them in a collection. For
example CParts and CPart, would be two different classes. Inheriting from a
typed dataset just seems like a lot of this work is done for you and the
project can be completed months earlier.

What do you guys think? Is this an accepted practice? or am I way off
here? Are there other alternatives? Pro's/Con's? I am looking for advice
on this as I have to decide soon on the design of the data tier.

Thanks for your input.

D.

Nov 21 '05
18 2867
<< clapping >>

I agree. Although I wouldn't go as far as saying that ORM is a waste of
time, I have found it MUCH MUCH more productive to go with datasets when
developing Winforms applications because, like you said, you can easily
implement very complex databinding. One thing we do to help speed up
development is to code generate the typed datasets directly from our SELECT
queries in our middle-tier. You can call the xsd.exe utility directly to
generate them. All you have to do is execute your queries into an untyped
dataset with MissingSchemaAc tion set to AddWithKey temporarily while you're
generating and pass the dataset's schema to the xsd.exe utility to create
the typed dataset code:

'-- Fill a dataset from your data adapter like normal
Dim ds as New Dataset("MyData ")
Dim da As New SqlClient.SqlDa taAdapter(myCom mand)
da.MissingSchem aAction = MissingSchemaAc tion.AddWithKey
da.Fill(ds)

'-- Write out the schema (discard the data)
ds.WriteXmlSche ma("MyData.xsd" )

'-- Generate the typed dataset
Dim p as System.Diagnost ics.Process
p.Start("C:\Pro gram Files\Microsoft Visual Studio .NET
2003\SDK\v1.1\B in\xsd.exe", "MyData.xsd /dataset /language:VB")

Have Fun! You're on the right track!
-Beth
"CMM" <CM*@discussion s.microsoft.com > wrote in message
news:A4******** *************** ***********@mic rosoft.com...
Having been developing entity objects for years to represent data and
carrying that same ORM ideology to .NET for some time until I gave typed
datasets a chance, I can honestly say that ORM is a BIG WASTE OF TIME.
Typed
datasets are huge time savers and provide all the benefits of custom
objects.
Developers just have to lose some of their old practices which were never
good ideas to begin with. You have to learn to seperate business rules and
validation from the data object itself. One of the first thing old school
developers try to do is hijack the Typed Dataset, inherit some class from
it,
and try to add all sorts of code to it. This makes your life harder... as
the
dataset is recreated and your code changes lost whenever you use the very
productive and useful designer to change the dataset. Datasets are for
data.
Validation objects act on the dataset. Data Access objects act on the
dataset. It's all very clean and manageable and productive.

Also, the benefits of using typed datasets ripples to other things. if you
hesitated using binding in .NET because of your experiences in VB6 and you
don't want to appear "lazy"... you're losing out on another huge time
saver.
Data binding in .NET is very good (one you master some of its weird
intricacies... namely the BindingContext/BindingManager stuff)! It should
not
be dismissed.

There are times when its appropriate to use ORM, but for the most part it
is
redundant and requires a huge development effort in exchange for
relatively
minor advantages. If you have a huge development team that can handle it,
then maybe it's the way to go. But, the benefits of typed datasets are
huge.

Just my 2c.

"Jorge Matos" wrote:
Whether to use Typed Datasets or Custom Entity objects is a controversial
topic. My rule of thumb is to use Typed DataSets when the situation
calls
for it and consider using Custom entity objects when appropriate. Most
of
the time I opt for Typed DataSets because it can be more productive to
use
them and a lot of developers are used to programming in a relational
model.
Custom entity classes and collections are usefull when you have a lot of
business rules that you want to enforce on your data.

The only issue I have with your code is that I would consider factoring
out
the SQL statement from the typed dataset class you have and moving that
into
a seperate class.

Some resources:
http://msdn.microsoft.com/asp.net/de...CustEntCls.asp
http://www.codeproject.com/dotnet/In...romDataSet.asp

"D Witherspoon" wrote:
> I am developing a Windows Forms application in VB.NET that will use
> .NET
> remoting to access the data tier classes.
>
> A very simple way I have come up with is by creating typed (.xsd)
> datasets.
> For example dsParts.xsd and including that in the data tier. I then
> will
> create a class that looks like this
>
>
> Public Class CPart
> Inherits dsParts
> Public Sub New(ByVal iPartID as Integer)
> Dim cm As New OleDb.OleDbComm and
> cm.CommandType = CommandType.Tex t
> cm.CommandText = "Select * from tblParts where PartID=" &
> iPartID
> modData.FillDat aTable(cm, Me.tblParts,
> ConnectionStrin gs.QASpec)
> 'Fill data table is a common method where i pass in a
> command
> and connection string
> 'it then fills the passed table object (ByRef) with the
> results
> of the command
> 'I could fill more than 1 data table here if this xml data
> schema had more than one table
> 'I can now add more methods to CPart and overide methods of
> the
> underlying dataset if required
> 'CPart is a datasource which can be used in place of a
> standard
> dataset object which is great for data binding
>
> 'One thing I haven't got to yet is Overriding or adding
> additional methods to the other table classes in the underlying
> baseclass
> 'not sure how I will accomplish that part.
> End Sub
> End Class
>
> To me this is a simple way of creating your dataclasses because you can
> create your XML schema easily by dragging tables from the server
> explorer
> directly on to the schema. Then when you Inherit the XML data schema
> (typed
> dataset) you get all of the table fields as properties in your class by
> default.
>
> Doing it any other way just seems like A LOT OF WORK. Other ways would
> be
> to create data classes and manually type in every field as a property.
> You
> do not get your databinding capability (though I hear there is a way to
> make
> these bindable at runtime). One thing you definatly won't get is
> design
> time databinding (the other method mentioned above, we can bind the
> typed
> datasets to our 3rd party grid controls easily at design time. )
>
> Then with your dataclasses you have to implement them in a collection.
> For
> example CParts and CPart, would be two different classes. Inheriting
> from a
> typed dataset just seems like a lot of this work is done for you and
> the
> project can be completed months earlier.
>
> What do you guys think? Is this an accepted practice? or am I way off
> here? Are there other alternatives? Pro's/Con's? I am looking for
> advice
> on this as I have to decide soon on the design of the data tier.
>
> Thanks for your input.
>
> D.
>
>
>
>

Nov 21 '05 #11
Hi,

I have previously written fairly large projects using datasets/dataviews
with good results.
However, ever since having got hold of VB.Net Beta 2, I have been looking at
generics - List(Of type), and been messing around with the class designer.

I am now starting a new project, where the backend is presently an
antiquated DB2 database running on an AS/400 which may or may not move to SQL
Server, and the UI will be both Windows Forms and Explorer.

Playing around with the class designer, I have created my model, which is
essentially classes and collections of classes. The designer allows me to
visualise very clearly the interrelationsh ips between the various classes. In
the past, I have always started with the database and built the application
from there on up. Since the prospect of actually getting the data in and out
of the AS/400 is so daunting, I decided to build the middle tier (business
rules) first and then worry about the data access layer.

However, I have now hit a mental brick wall. I can't see how and where I
will be able to update/insert the back-end data from these classes. I
downloaded the TimeTracker v 2.0 Starter Kit from asp.net, but since I'm not
very goods with C#, haven't been able to really figure out the logic between
the n tiers.

I'm in a bit of a quandry - I would really like to continue using the class
designer to build the application, but would also like to continue to use
datasets etc because of their ease of use.

Is there somewhere I can go which will point me in the direction of a hybrid
model - or must I decide now which way I want to go?

Many thanks
Jeremy Holt
Nov 21 '05 #12
Jeremy,

This can be very interesting to discuss this in these newsgroups.

http://forums.microsoft.com/MSDN/default.aspx

For those problems you have now is in my opinion beta testing for.

Cor

Nov 21 '05 #13
On Thu, 23 Jun 2005 16:55:01 -0700, "JeremyHolt "
<Je********@dis cussions.micros oft.com> wrote:
Hi,

I have previously written fairly large projects using datasets/dataviews
with good results.
However, ever since having got hold of VB.Net Beta 2, I have been looking at
generics - List(Of type), and been messing around with the class designer.

I am now starting a new project, where the backend is presently an
antiquated DB2 database running on an AS/400 which may or may not move to SQL
Server, and the UI will be both Windows Forms and Explorer.

Playing around with the class designer, I have created my model, which is
essentially classes and collections of classes. The designer allows me to
visualise very clearly the interrelationsh ips between the various classes. In
the past, I have always started with the database and built the application
from there on up. Since the prospect of actually getting the data in and out
of the AS/400 is so daunting, I decided to build the middle tier (business
rules) first and then worry about the data access layer.

However, I have now hit a mental brick wall. I can't see how and where I
will be able to update/insert the back-end data from these classes. I
downloaded the TimeTracker v 2.0 Starter Kit from asp.net, but since I'm not
very goods with C#, haven't been able to really figure out the logic between
the n tiers.

I'm in a bit of a quandry - I would really like to continue using the class
designer to build the application, but would also like to continue to use
datasets etc because of their ease of use.

Is there somewhere I can go which will point me in the direction of a hybrid
model - or must I decide now which way I want to go?
Jeremy,

You are basically using a model which is known as business objects,
i.e. you are putting a layer in place between the Database Layer and
the Presentation Layer that understands your business rules. An
alternative approach of course is to place these business rules in the
database as stored procedures and triggers.

There are good reasons for both of these approaches.

Your problem is as you say is to tie the business objects to the
database, there are two common approaches to this, the first is to
have as a private member a typed record in each class and a typed
recordset in the collection and use that to interact with the
database. The second is to give your objects the ability to access
the database directly. Again both approaches are valid. There are a
number of articles on the internet that discuss the merits of these
approaches.

Doug Taylor
Many thanks
Jeremy Holt


Nov 21 '05 #14
"=?Utf-8?B?SmVyZW15SG9 sdA==?=" <Je********@dis cussions.micros oft.com>
wrote in news:58******** *************** ***********@mic rosoft.com:
I am now starting a new project, where the backend is presently an
antiquated DB2 database running on an AS/400 which may or may not move
to SQL Server, and the UI will be both Windows Forms and Explorer.


This is just part 1, part 2 and 3 will be more of what you are lookig for, but it might still proves
useful:
http://www.codeproject.com/useritems...inessLogic.asp
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programmin g is an art form that fights back"

Get your ASP.NET in gear with IntraWeb!
http://www.atozed.com/IntraWeb/
Nov 21 '05 #15


"Doug Taylor" wrote:
On Thu, 23 Jun 2005 16:55:01 -0700, "JeremyHolt "
<Je********@dis cussions.micros oft.com> wrote:
Hi,

I have previously written fairly large projects using datasets/dataviews
with good results.
However, ever since having got hold of VB.Net Beta 2, I have been looking at
generics - List(Of type), and been messing around with the class designer.

I am now starting a new project, where the backend is presently an
antiquated DB2 database running on an AS/400 which may or may not move to SQL
Server, and the UI will be both Windows Forms and Explorer.

Playing around with the class designer, I have created my model, which is
essentially classes and collections of classes. The designer allows me to
visualise very clearly the interrelationsh ips between the various classes. In
the past, I have always started with the database and built the application
from there on up. Since the prospect of actually getting the data in and out
of the AS/400 is so daunting, I decided to build the middle tier (business
rules) first and then worry about the data access layer.

However, I have now hit a mental brick wall. I can't see how and where I
will be able to update/insert the back-end data from these classes. I
downloaded the TimeTracker v 2.0 Starter Kit from asp.net, but since I'm not
very goods with C#, haven't been able to really figure out the logic between
the n tiers.

I'm in a bit of a quandry - I would really like to continue using the class
designer to build the application, but would also like to continue to use
datasets etc because of their ease of use.

Is there somewhere I can go which will point me in the direction of a hybrid
model - or must I decide now which way I want to go?


Jeremy,

You are basically using a model which is known as business objects,
i.e. you are putting a layer in place between the Database Layer and
the Presentation Layer that understands your business rules. An
alternative approach of course is to place these business rules in the
database as stored procedures and triggers.

There are good reasons for both of these approaches.

Your problem is as you say is to tie the business objects to the
database, there are two common approaches to this, the first is to
have as a private member a typed record in each class and a typed
recordset in the collection and use that to interact with the
database. The second is to give your objects the ability to access
the database directly. Again both approaches are valid. There are a
number of articles on the internet that discuss the merits of these
approaches.

Doug Taylor

Many thanks
Jeremy Holt


Doug,

Many thanks for your thoughts on this. I had previoulsy thought about a
private typed record in the class, but then found myself inserting the data
into the class properties from the dataset - this seemed rather
counter-intuituve in that if I already have the typed dataset, why would I
want to transfer this data back into my "typed" class. I also have a problem
visualising how one would handle the "collection ".

In my business model, I have defined the following classes:
Class Product
ProductID as integer
SampleSize as double
Description as string
Grade as string
MoistureContent as double
Ash as double
Rotten as double
End Class

Class LaboratoryAnaly sis
LabID as integer
Date as date
Products as List(Of Product)
End Class

Class Truck
TruckID as integer
NumberPlate as string
Origin as string
Quantity as integer
LabAnalysis as List(Of LaboratoryAnaly sis)
End Class

Class Warehouse
WarehouseID as integer
Trucks as List(Of Truck)
End Class

I tend to think in terms of stored procs/triggers filling/updating datasets,
producing dataviews which are consumed by the UI. Single records (master part
of master/details) are obtained through passing a parameter to the stored
proc. As I said in my previous post, I know it works, and its relatively easy
to do.

However, I am constantly drawn back to the idea of classes/collection of
classes, because of the elegance of the Class Designer.

In my "dataset world" in order to fill my Warehouse I would have a stored
proc which queried the database and would do an inner join accross the tables
to give me the "collection " of Trucks - in reality a dataview, which would
continue to drill down through the LaboratoryAnaly sis to the Products that
were analysed in the laboratory etc. My query would thus be able to give me
how many tons of Rotten Apples I have in the Warehouse.

In my "Generics world" my Business Objects code would be something like:

Dim TotalWeight as integer
Dim RottenWeight as double
For each T as Truck in Warehouse.Truck s
TotalWeight += T.Quantity
For each L as LaboratoryAnaly sis IN T.LabAnalysis
For each P as Product in L.Products
RottenWeight += (T.Quantity * P.Rotten)
Next
Next
Next

Assuming I'm along the right lines so far, how would I get the data, and
update the data into my collections? I guess something like:

Class Product
ProductID as integer
SampleSize as double
Description as string
Grade as string
MoistureContent as double
Ash as double
Rotten as double

Sub Load(ProductID as integer)
Dim ds as dsProducts
' Fill dataset
'SELECT ProductID, SampleSize, Description, Grade, MoistureContent , Ash,
Rotten FROM Products WHERE ProductID BETWEEN COALESCE(-1, '@ProductID) AND
COALESCE(65535, @ProductID)
For Each row as dsProducts.Prod uctsRow in dsProducts
Me.SampleSize = row.SampleSize
Me.Description = row.Description
etc.
Next
End Sub
End Class

However, this is where I run into my mental "brick wall":
1) Should Class Product not just expose the dataset, saving me the effort of
the loop to fill the class properties with the row details?
2) How do I update Class Product? Assuming that I'm using a DataGridSource
(asp.net or win.forms), if the souce of these UI elements is a dataview, then
I can use all of ADO.Net's capababilities, i.e. Merge, GetChanges(data set)
etc.

If I carry on down the road of my "Generics" model do I have to lose all the
"cool" things about ADO.Net? Alternativley, how do I model my "traditiona l
database oriented" design using Class Designer?

I do hope that I have been able to clearly express my confusion, and hope
that someone could point me in the right direction.

Many thanks
Jeremy Holt
Nov 21 '05 #16
Cor

In which forum would you suggest I post?

Thanks
Jeremy

"Cor Ligthert" <no************ @planet.nl> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
Jeremy,

This can be very interesting to discuss this in these newsgroups.

http://forums.microsoft.com/MSDN/default.aspx

For those problems you have now is in my opinion beta testing for.

Cor

Nov 21 '05 #17
> Cor

In which forum would you suggest I post?


http://forums.microsoft.com/msdn/Sho...spx?ForumID=32

Nov 21 '05 #18
On Fri, 24 Jun 2005 09:09:06 -0700, "JeremyHolt "
<Je********@dis cussions.micros oft.com> wrote:


"Doug Taylor" wrote:
On Thu, 23 Jun 2005 16:55:01 -0700, "JeremyHolt "
<Je********@dis cussions.micros oft.com> wrote:
>Hi,
>
>I have previously written fairly large projects using datasets/dataviews
>with good results.
>However, ever since having got hold of VB.Net Beta 2, I have been looking at
>generics - List(Of type), and been messing around with the class designer.
>
>I am now starting a new project, where the backend is presently an
>antiquated DB2 database running on an AS/400 which may or may not move to SQL
>Server, and the UI will be both Windows Forms and Explorer.
>
>Playing around with the class designer, I have created my model, which is
>essentially classes and collections of classes. The designer allows me to
>visualise very clearly the interrelationsh ips between the various classes. In
>the past, I have always started with the database and built the application
>from there on up. Since the prospect of actually getting the data in and out
>of the AS/400 is so daunting, I decided to build the middle tier (business
>rules) first and then worry about the data access layer.
>
>However, I have now hit a mental brick wall. I can't see how and where I
>will be able to update/insert the back-end data from these classes. I
>downloaded the TimeTracker v 2.0 Starter Kit from asp.net, but since I'm not
>very goods with C#, haven't been able to really figure out the logic between
>the n tiers.
>
>I'm in a bit of a quandry - I would really like to continue using the class
>designer to build the application, but would also like to continue to use
>datasets etc because of their ease of use.
>
>Is there somewhere I can go which will point me in the direction of a hybrid
>model - or must I decide now which way I want to go?
Jeremy,

You are basically using a model which is known as business objects,
i.e. you are putting a layer in place between the Database Layer and
the Presentation Layer that understands your business rules. An
alternative approach of course is to place these business rules in the
database as stored procedures and triggers.

There are good reasons for both of these approaches.

Your problem is as you say is to tie the business objects to the
database, there are two common approaches to this, the first is to
have as a private member a typed record in each class and a typed
recordset in the collection and use that to interact with the
database. The second is to give your objects the ability to access
the database directly. Again both approaches are valid. There are a
number of articles on the internet that discuss the merits of these
approaches.

Doug Taylor
>
>Many thanks
>Jeremy Holt
>


Doug,

Many thanks for your thoughts on this. I had previoulsy thought about a
private typed record in the class, but then found myself inserting the data
into the class properties from the dataset - this seemed rather
counter-intuituve in that if I already have the typed dataset, why would I
want to transfer this data back into my "typed" class. I also have a problem
visualising how one would handle the "collection ".

In my business model, I have defined the following classes:
Class Product
ProductID as integer
SampleSize as double
Description as string
Grade as string
MoistureContent as double
Ash as double
Rotten as double
End Class

Class LaboratoryAnaly sis
LabID as integer
Date as date
Products as List(Of Product)
End Class

Class Truck
TruckID as integer
NumberPlate as string
Origin as string
Quantity as integer
LabAnalysis as List(Of LaboratoryAnaly sis)
End Class

Class Warehouse
WarehouseID as integer
Trucks as List(Of Truck)
End Class

I tend to think in terms of stored procs/triggers filling/updating datasets,
producing dataviews which are consumed by the UI. Single records (master part
of master/details) are obtained through passing a parameter to the stored
proc. As I said in my previous post, I know it works, and its relatively easy
to do.

However, I am constantly drawn back to the idea of classes/collection of
classes, because of the elegance of the Class Designer.

In my "dataset world" in order to fill my Warehouse I would have a stored
proc which queried the database and would do an inner join accross the tables
to give me the "collection " of Trucks - in reality a dataview, which would
continue to drill down through the LaboratoryAnaly sis to the Products that
were analysed in the laboratory etc. My query would thus be able to give me
how many tons of Rotten Apples I have in the Warehouse.

In my "Generics world" my Business Objects code would be something like:

Dim TotalWeight as integer
Dim RottenWeight as double
For each T as Truck in Warehouse.Truck s
TotalWeight += T.Quantity
For each L as LaboratoryAnaly sis IN T.LabAnalysis
For each P as Product in L.Products
RottenWeight += (T.Quantity * P.Rotten)
Next
Next
Next

Assuming I'm along the right lines so far, how would I get the data, and
update the data into my collections? I guess something like:

Class Product
ProductID as integer
SampleSize as double
Description as string
Grade as string
MoistureContent as double
Ash as double
Rotten as double

Sub Load(ProductID as integer)
Dim ds as dsProducts
' Fill dataset
'SELECT ProductID, SampleSize, Description, Grade, MoistureContent , Ash,
Rotten FROM Products WHERE ProductID BETWEEN COALESCE(-1, '@ProductID) AND
COALESCE(65535 , @ProductID)
For Each row as dsProducts.Prod uctsRow in dsProducts
Me.SampleSize = row.SampleSize
Me.Description = row.Description
etc.
Next
End Sub
End Class

However, this is where I run into my mental "brick wall":
1) Should Class Product not just expose the dataset, saving me the effort of
the loop to fill the class properties with the row details?
2) How do I update Class Product? Assuming that I'm using a DataGridSource
(asp.net or win.forms), if the souce of these UI elements is a dataview, then
I can use all of ADO.Net's capababilities, i.e. Merge, GetChanges(data set)
etc.

If I carry on down the road of my "Generics" model do I have to lose all the
"cool" things about ADO.Net? Alternativley, how do I model my "traditiona l
database oriented" design using Class Designer?

I do hope that I have been able to clearly express my confusion, and hope
that someone could point me in the right direction.


Firstly I'll state I haven't yet looked at the latest release of
Visual studio so I'm not sure of the capabilities of the LIST object,
but I assume you can inherit from it.

Assuming you have an inherited list ProductList in your 'LIMS'
(Laboratory Information Management System) with a private member
dsProducts

In your product class if you expose a friend property as
dsProducts.Prod uctsRow then the load method (of the product
collection) could look something like

For Each row as dsProducts.Prod uctsRow in dsProducts
Product.Product Row = Row

Next
Where Product is retried from the appropriate item of the list.

Then the Friend ProductRow should be a copy of its data in the
datatable. I personally don't like this approach as it tends to be
very memory hungry.

The alternative approach is in your class to track the state of the
object i.e. is it a new object or one that has been retrieved from the
database or has it been modified and then provide appropriate Insert
Delete and Update methods.

As in all of these things the best approach will depend on the
environment you are working in and such factors as data ownership and
data volumes.

If the use of computers within a laboratory is of interest to you then
there is a discusion group (the LIMS LIST) at
Ma*******@lims. taratec.com
Many thanks
Jeremy Holt


Nov 21 '05 #19

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

Similar topics

16
3037
by: D Witherspoon | last post by:
I am developing a Windows Forms application in VB.NET that will use .NET remoting to access the data tier classes. A very simple way I have come up with is by creating typed (.xsd) datasets. For example dsParts.xsd and including that in the data tier. I then will create a class that looks like this Public Class CPart Inherits dsParts
41
4731
by: laimis | last post by:
Hey guys, I just recently got introduced to data mappers (DTO mapper). So now I have a SqlHelper being used by DTOMapper and then business layer is using DTOMapper when it needs to persist object to database or load them back. Everything is working nicely so far. My question is, is it OK practice to use DTOMapper rfom the presentation layer? For instance, if I want to present in HTML format the list of entries in my database, should I...
2
2213
by: headware | last post by:
I'm relatively new to ASP.NET and ADO.NET, but I have a basic design question regarding the use of web services and APS.NET applications. Right now we have an application that uses web services to access the database layer. However, the code works in a pretty cumbersome and ungeneric way. Basically every query, update, and insert has its own function. So you see a lot of functions like webService.InsertCustomer(name, age, phone); or...
8
1673
by: Keith-Earl | last post by:
Okay, looking for a Best Practice. We are building a classic three tier app in VB.NET. When we load up a WebForm we have access to very useful objects such as the Session object. We frequently store short lists in Session or even Application objects and retrieve them later without having to make a round trip to the db. We think the best place to do all this is in the Business tier and not to clutter up the client (WebForm). In order...
13
3114
by: Alan Silver | last post by:
Hello, MSDN (amongst other places) is full of helpful advice on ways to do data access, but they all seem geared to wards enterprise applications. Maybe I'm in a minority, but I don't have those sorts of clients. Mine are all small businesses whose sites will never reach those sorts of scales. I deal with businesses whose sites get maybe a few hundred visitors per day (some not even that much) and get no more than ten orders per day....
4
3019
by: pratham | last post by:
Hi! I'm making a database application and i heard from a friend that it is more proffecional and easy to do this with bussines objects. Can anyone tell me where i can find more info on bussines objects and how to implement them with c#? I would appreciate any help. How can i decide that what things go into business layer and what
0
1581
by: uncensored | last post by:
Hi, Sort of new with the whole treeview control and I was wondering is there a way to build a treeview menu using my SQL data I pull from a database instead of having to hard code it into the webpage. Pasted below is my current code but what I would like to do is instead make a table in SQL that data can be added or modified to and have it generate the menu according to the data instead. Thanks for the help, Mike <mytree:treeview...
0
9405
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10013
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9960
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9841
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8838
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6655
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5280
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5424
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2807
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.