Re: App Architecture: Typed Datasets, EntLib, Performance
- From: "sloan" <sloan@xxxxxxxxx>
- Date: Wed, 13 Sep 2006 11:15:54 -0400
See
http://sholliday.spaces.live.com/
In my 5/24/2006 blog entry, I reference this MS article
And a reference to read from start to finish, aka, very informative for a
bird's eye view:
*
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/BOAGag.asp
Deploying Business Entities
find that heading in the MS article.
Read the 3 points, several times each. It takes a few reads to have it sink
in.
Then I'd get the code from my blog, the 5/24/2006 article.
I've matched the MS article , and have typed datasets as the common library
living outside of the tiers.
The enterprise blocks are barely going to affect performance.
The only place they hurt , just a tad bit, is using reflection to
instantiate the concrete classes.
However, reflection compared to the overhead of db communication, is about 3
drops in a gallon of water.
Cowboy is right on, performance is not the be all end all.
You can get great performance with application blocks.
You might read this article also:
http://www.codeproject.com/gen/design/DudeWheresMyBusinessLogic.asp
Finally: The MS article talks about the pros/cons of (typed) datasets vs
custom objects (business entities).
I choose custom objects most of the time.
For reports, I use strong typed datasets.
That's my rule of thumb.
"Cowboy (Gregory A. Beamer)" <NoSpamMgbworld@xxxxxxxxxxxxxxxxxx> wrote in
message news:uCylOiz1GHA.1548@xxxxxxxxxxxxxxxxxxxxxxx
Before getting too deep into this, I have one comment. DO NOT code foras
performance alone.
You can write an application that blows the socks off others if you move
much of your application to C code and put a service layer on top for thethat
.NET bits. In the process, you sacrifice maintainability and extensibility
and possibility scalability as well. But, damn, it performs.
To your question, efficiency is not the only thing you should be concerned
with. It is possible you will save a few cycles using untyped DataSets on
the back end. I am not convinced this is the case, but it is certainly
possible. In the process, however, you opt for two disparate systems with
different sets of rules. This leads to a team that is split and where you
cannot easily move people around from middle tier to back end. If this is
how your organization is set up, it is not an issue.
To your questions (INLINE)
"Karch" <nospam@xxxxxxxxxxxxxx> wrote in message
news:eMkPW$y1GHA.1256@xxxxxxxxxxxxxxxxxxxxxxx
I have a web application that I have partitioned into 4 assemblies: web
application (presentation), business entities (typed datasets), business
objects (business logic), and data access (using DAAB). The two areas
andwhere I have read conflicting information are the use of typed datasets
typeddata access using the Enterprise Library.
Typed datasets:
There seems to be agreement that the use of typed datasets is "good".
However, there is some disagreement about _where_ they should be filled
and used. Some say that they should not be filled by the data access
layer, but rather should exist only in the business layer, which would
merge the untyped dataset returned from the data layer and pass the
indataset to the the web application.
1. Is it more efficient to use untyped datasets in the data access layer
and merge the results into a typed dataset at the business layer level?
Not sure.
2. What are the recommendations or guidelines for using typed datasets
frontthis type of architecture?
I would recommend choosing your architecture, objects or datasets, up
and sticking with the same archtiecture throughout. If you find that youapplication
need more cycles due to a perf problem, you can then adjust the
to try other options like the one you suggest.generators
Overall, I am more fond of true business objects, but I use code
to avoid having to type a lot (lazy programmers rule ;->). I am currentlyis
using CodeSmith with .NET Tiers, but I actually prefer LLBLGen Pro, as it
much easier to define complex relationships. Both create objects thatcareful
perform nicely.
A word of caution: If you go with a O/R Mapping layer, as I have, be
as there are some really crappy open source implementations out there(there
are some good ones, but I ran through quite a few before deciding I wasnot
realy "getting something for free" and purchased a commercial O/R Mapper).caled
As an example, because it is on the top of my head, there is a project
Typed Data Objects that does not use the same name for its dyanmicis
parameters. The negative here is you cannot reuse query plans. I am sure
some of the other projects out there suffer from similar issues, so do
research if you go the O/R route.
Data access:
I see the value in using DAAB if I want to be completely provider
agnostic, but what if I know that I will always be using SQL Server?
1. Am I better off in this case, from a performance perspective, to just
use data adapters and sqlclient?
The DAAB (and Enterprise Library) offer more than simple data access. For
example, you have someone else responsible for the data layer code, which
a nice thing. Less for you to maintain.the
It does add a bit of weight, but I am not sure it is significant enough to
make a decision on the weight alone. I would aim for the EntLib instead of
just the DAAB, as you get some other bits and it is a better model than
DAAB model.your
Sticking with standard, however? Sure, if you have the need of rolling
own data layer, it is an option.performance,
2. Am I just buying myself fewer lines of code at the expense of
performance by using DAAB?
Possibly, but I would state that you should not focus solely on
unless you have or foresee a performance problem. Too many people areparty
focused solely on performance and forget other aspects. Using a third
library (like EntLib or DAAB) saves you time to focus on other things. Ifswitch
you find out, during modeling, that you have a perf problem, you can
out to a layer that mimics the routines of the DAAB but is lighter in perfcan
weight. In fact, if you completely abstract your data access layer, you
switch to whatever you want.I
I do not, however, think the DAAB is going to be the biggest issue in your
list of potential perf issues.
3. In cases where I expect only one row from a stored procedure, should
tobe using out parameters in my stored procedure and assigning the values
a dataset or should I just fill the dataset with a recordset?
If you are getting back a single value, out parameters might gain you
something. If you are grabbing a full row, I am not sure you are going to
buy anything for the complexity you are adding.
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
*************************************************
Think outside of the box!
*************************************************
.
- Follow-Ups:
- References:
- App Architecture: Typed Datasets, EntLib, Performance
- From: Karch
- Re: App Architecture: Typed Datasets, EntLib, Performance
- From: Cowboy \(Gregory A. Beamer\)
- App Architecture: Typed Datasets, EntLib, Performance
- Prev by Date: Re: App Architecture: Typed Datasets, EntLib, Performance
- Next by Date: Re: Overhead converting .htm files to .aspx
- Previous by thread: Re: App Architecture: Typed Datasets, EntLib, Performance
- Next by thread: Re: App Architecture: Typed Datasets, EntLib, Performance
- Index(es):
Relevant Pages
|