Posted By: jogisarge | Dec 5th, 2008 @ 2:03 PM
page 1 of 1
Comments: 3 | Views: 588
Hello,

can anybody give me tipps in coding 3-tier apps.
i want to code a winform app using 3-tier architecture.
because i am new in c# i have a few questions.
How should i pass the data through my tiers ?
(datasets,datatables or list<T>, or ? )

can anybody give me an example for this ?

by jogi
Dr Herbie
Dr Herbie
Horses for courses

I'd start with this article from MSDN.  There is no 'right' way to do this, just lots of solutions each with different benefits.

I find that typed datasets are handy for smaller applications, but the number of data adapters you end up writing can balloon when the app grows. Datasets have the advantage of keeping track of their own 'dirty' state so updating the data source is relatively easy.

On the other hand, custom data objects free you from the database schema, so you can architect your application for the best solution, rather than accidentally architecting it around the database. With custom data objects you have to keep track of the dirtyness yourself.  CSLA.NET is one library you might want to look at if you're going with custom business objects.

Essentially, it's too big a question to answer easily!


Herbie

jh71283
jh71283
Throw new System.Beverage. OutOfCoffeeException​()
Why write a dataadapter when the TableAdapters get created for you?
Dr Herbie
Dr Herbie
Horses for courses
Sorry, my terminology is out of date -- I still think in .NET1.0 !

In larger applications, I find that the need to optimise means I write more custom TableAdapters with specifically crafted SQL (like when you need to return a list of data, but to speed things up you only want specific fields).
In smaller apps, most data stuff can get done with drag and drop from data sources.

Herbie
page 1 of 1
Comments: 3 | Views: 588
Microsoft Communities