By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,706 Members | 1,105 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,706 IT Pros & Developers. It's quick & easy.

Best practice - Connected/Disconnected mode - and more

P: n/a
Hello,

I'm looking for documentation with "Best Practice" for ASP.NET application

In which case use Connected or Disconnected mode

Typed dataset or not ?

I didn'd find anything pertinent ....

If you have a good link you are welcome :)

Regards,
Jun 27 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
In many ways, this is like asking: Which is better, a hammer or a
screwdriver?

It really depends on your goals. Let me give a what if. Suppose you want the
highest performing application. It is going to be a monolithic application
where all of the code is in a single executable. It will also likely be in
assembly code of some sort or at the very least some lower level language
like C. The reason is you do not want anything more than one executable is
you do not want to take any chances of marshalling across any boundaries.
Now, there are times you need this application. But, in most cases, you have
to trade off some of this performance for things like maintainability,
scalability, etc.
In which case use Connected or Disconnected mode
In general, you will want to build software as a service. The implication
here is your data layer is considered a service that your business layer
uses. Your business layer is a service your UI works with. I say works with
here, as we are moving more towards MVC and MVP type of patterns in this
space. This means the controller marries pieces and not an ASPX page. While
the difference is subtle in some ways, it is radical in others.

Taking this model, it makes sense that data is portable. It cannot be easily
portable if you are connected to the source all of the time. Now, what you
choose to use for portability is up for grabs. The trend is towards custom
objects, but custom objects have a downside of potentially being coupled
tightly to your data model. This leads people to ORM tools, of which LINQ is
not one, no matter what people sell it at (LINQ is ORM-like in many ways,
thus the confusion). THe push to ORM is so you can regenerate your objects
when business changes without having to resort to a lot of recoding.

But, you might decide that a DataSet is fine as a custom object. It is
deconstructable into individual objects, so this is not necessarily a bad
thing.

What is important here is you really cannot stay connected all the time.
First, it requires that you maintain a connection to a database, which is an
expensive resource to remain connected to. This is due to many factors,
including the memory on the database server (and web server) to maintain the
connection, as well as the expense of locking, etc.
Typed dataset or not ?
The biggest benefit of being strongly typed is finding out you have a
problem at design time rather than run time. Depending on what resources
your company has devoted to testing, this can be critical to a good
application. Does this mean a strongly typed Dataset? Not necessarily, as
business objects are also "strongly typed". In many circles, the move is
away from strongly typed datasets to LINQ, but this is a good strategy, long
term, if you are flipping from the anonymous types to actual business
objects, especially if you are moving objects across class boundaries.

Hope this helps clear up the mud a bit.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://gregorybeamer.spaces.live.com/lists/feed.rss

or just read it:
http://gregorybeamer.spaces.live.com/

********************************************
| Think outside the box! |
********************************************
"Gabriel" <no****@nospam.comwrote in message
news:e9**************@TK2MSFTNGP02.phx.gbl...
Hello,

I'm looking for documentation with "Best Practice" for ASP.NET application

In which case use Connected or Disconnected mode

Typed dataset or not ?

I didn'd find anything pertinent ....

If you have a good link you are welcome :)

Regards,
Jun 27 '08 #2

P: n/a
Hi

If its a matter of data access performance ... i would rather use the
old fashion data reader... but
if developer productivity is key term over performance then linq is
better...

http://alexpinsker.blogspot.com/2007...g-linq-vs.html
Thanks
Munna
Jun 27 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.