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
-
-
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 -
Why write a dataadapter when the TableAdapters get created for you?Dr Herbie said: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
-
Sorry, my terminology is out of date -- I still think in .NET1.0 !jh71283 said:
Why write a dataadapter when the TableAdapters get created for you?Dr Herbie said:*snip*
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
Thread Closed
This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.