business objects vs. datasets

  • Thread starter Penelope Dramas
  • Start date
P

Penelope Dramas

Hello,

I'm in a front of very serious .net redesign/rewrite of an old VB6
application.

I had been asked to make it .NET 2.0 and would like to ask couple of
questions regarding data access as this application is heavily data-centric
around MSDE database.

Would it be better to use custom business objects or extend
datasets/datatables for my classes?

This is what I'm thinking and just wanted to know if it's correct way.

Custom Bus. Object:
- Longer time to develop/test it.
- Loosely coupled with DataLayer.
- Extensible.

Datasets
- Faster/Easier.
- Tightly coupled with DataLayer.

I'm afraid that Microsoft is dropping ADO.NET and pushing WPF/Linq
initiative and don't want to end up rewriting business layer in 2-3 years to
adjust it to current framework.

Would like to hear your opinion and experiences...


Thanks ...
 
R

RobinS

Hi Penelope Dramas,

If you want to rewrite it using Business Objects, there's a new book coming
out next month by Deborah Kurata (Microsoft MVP) that shows exactly how to
do that. I read it, and am using that methodology. It's called "Doing
Objects in VB2005".

You can kind of go either way. I think it's harder to do it with business
objects, but the data access is tighter because you have more control over
it.

And yet I know of another MVP leading a large project who uses strongly
typed datasets. She still has her design in 3-layers, but her data layer
passes back strongly typed datasets for use in the UI.

She generates the datasets herself from the stored procedures and removes
the table adapter because they *only* use stored procedures. I'm not
exactly certain how she does that, it's something I want to follow up on to
find out.

So I don't have a definitive answer for you, but maybe this information
will help in some way. Other people will definitely have an opinion, I'm
sure.

Robin S.
Ts'i mahnu uterna ot twan ot geifur hingts uto.
 
G

Guest

Custom Bus. Object:
- Longer time to develop/test it.
- Loosely coupled with DataLayer.
- Extensible.

Datasets
- Faster/Easier.
- Tightly coupled with DataLayer.

Take a look at LLBLGen. LLBLGen Pro is a third party DAL which is very good
at auto-generating custom business objects.

The developer of LLBLGen Pro is planning to make it LINQ compatible too.

So in a sense, you get the feature of LINQ now - and with future linq
compatibility!
 
S

sloan

Go here

http://sholliday.spaces.live.com/blog/

6/5/2006
Custom Objects and Tiered Development II // 2.0

and

5/24/2006
Custom Objects/Collections and Tiered Development


The second one is 1.1, however.

Run some times to see the difference between populating your custom business
objects with an IDataReader vs populating strong DataSets.
You ~~will be surprised.

I mention a MS KB at the bottom on the 1.1 article "bird's eye view". Read
that thing several times.

On a system I need to upkeep, I 99% of the time go with Custom Objects now.

On reports, I go back to strong datasets.
 
P

Penelope Dramas

Thank you all for insight, I will buy that book feb 21 when it's coming out.

I don't think i will go with any code generators, we have already looked
into DevExpress XPO as well as CodeSmith but I would like to do it myself
and learn it better.

Am I right when I'm thinking that Microsoft might drop ADO.NET for good or
there's no reason to panic :) ?
 
R

RobinS

If you have a subscription to Safari, you can see Deborah Kurata's book
online. I understand it has been made available, or at least parts of it.
Amazon says it's going to be available 2/21.

http://www.amazon.com/Objects-Visua..._bbs_sr_1/002-2858380-8860814?ie=UTF8&s=books

I can't even *imagine* that Microsoft would drop ADO.Net, at least not in
the next couple of years. Farther ahead than that, who knows what they will
do. They seem headed in the XML direction, but I just don't see it for huge
amounts of data. Plus, it would hardly be in their best interest,
considering how hard they have worked to make SQLServer a viable
alternative to Oracle. So there has to be *some* way to transfer data back
and forth to SQLServer!

Robin S.
---------------------------------------
 
R

RobinS

You can also check out Rockford Lhotka's books if you want to know more
about Business Object ; he's very well-known in the field. I have looked at
them, but not read them. Deborah's book seemed a lot more "hands-on" to me,
and less theory.

Just my opinion.
Robin S.
---------------------------------
 
G

Guest

Also, If you don't have a subscription to Safari, your local libray might.
I checked my county libray here in CA and I can get access to Safari online
at home.

Jason Vermillion
 
R

RobinS

Oh, that's really cool. Is that CA as in California, or CA as in Canada? If
it's California, I'm heading down to the library to see if mine has that
capability.

Robin S.
-------------------------------
 
C

Cor Ligthert [MVP]

Penelope,

If you think about buying Deborah's book, than certainly don't forget to buy
the books from David and Bill (Sceppa and Vaughn). The last two are .Net
specialists as long as .Net exist.

Cor
 
G

Guest

I'm in California south of san francisco.

I'm not a big fan of ebooks but it let's you read through a book and see if
it is worth picking up a paper copy.

Jason Vermillion
 
R

RobinS

Cool. I live in the East Bay. You're right, it's nice to be able to see the
book before you buy it, and I'd rather have a paper copy that I can put
markers in, and write in. Thanks for the tip.

Robin S.
Ts'i mahnu uterna ot twan ot geifur hingts uto.
---------------------------------------------------------
 
R

RobinS

Just to clarify, they are data guys, not Business Objects guys. But both of
their books are certainly exemplary.

Robin S.
Ts'i mahnu uterna ot twan ot geifur hingts uto.
 
C

Cor Ligthert [MVP]

Robin,
Just to clarify, they are data guys, not Business Objects guys. But both
of their books are certainly exemplary.

Read the subject, you never can compare with only one factor.

:)

Cor
 
B

Bruce W. Darby

Robin,

When I purchased my copy of Start to Finish Visual Basic, I got a free 30
day trial of the Safari system. Did you not receive that with your copy? And
like yourself, I do prefer the paper copy... more than likely because I'm
old and set in my ways. hehehe

Bruce
 
R

RobinS

Yes, I probably did, but apparently I didn't notice. I'll check it out.
Thanks!

Robin S.
--------------------------------------------
 
R

RobinS

I've read the Sceppa book, but while it covers ADO.net and database access
and so forth in full, it's only related to business objects insofar as
storing the info after you've collected it. Technically, all that stuff
should be in one's data access layer anyway. It's definitely a great book.
I mostly use stored procedures and paramaterized queries, and he definitely
covers that.

I haven't read Bill's book, although I seem to keep visiting it at the
bookstore just to look at it. I haven't decided if I need it yet, so I
haven't bought it yet. Again, it's about SQLServer, etc., not how to create
a 3-layer application model.

Robin S.
 
W

William \(Bill\) Vaughn

Nope, it's not. It's about more pragmatic (and more commonly used)
approaches. Rocky Lhotka or Deb Kurata are the authorities on OO stuff.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
 
M

Matt Vaughn

Penelope,
If you really want custom objects (most flexibility, extensible, etc.);
there are costs involved. You will have to custom develop your business
domain - this is what I think you mean when you say custom business objects.
Rocky's books and framework are not the purest implementation of a business
domain.

I suggest you look at Eric Evans "Domain Driven Design" and/or Nillson's
book on the same subject with C#. Using DataSets or DLINQ with LINQ; or
NHibernate, .NetTiers, etc. will only get you so far. I have been
researching this topic and implementing various application frameworks at
this level. Do not tightely couple your business domain (custom objects)
with the data layer (nor inherit from these objects to add behavior). Using
DataSets or DLINQ or anything similiar is saying your business objects look
like your database. These are (2) entirely different structures: 1.
object-oriented and the other 2. relational.

This impedence mismatch only causes some to go down (my opinion) the wrong
path with trying to map business objects to generated objects based on the
data model. This mapping creates unnessesary overhead.

In order to add some balance to this email, I would think that using these
other techniques appropriate if the tight coupling is ok; and the
application will be committed to using this same technology for the lifetime
of the application. If it is a requirement for the data persistence layer to
be swapped out in the future - you only choice is NOT tightly couple these
data objects with the other tiers of the application. This is why I'm such a
fan of the custom business object; but this requires much planning and
structuring.

Regards,

Matt Vaughn
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top