Thursday, January 05, 2006

War between typed datasets and custom entities

War between typed datasets and custom entities

In Eurocenter currently we are preparing for a new project-kickoff which is going to be based on the .NET platform. Among many other design decisions we are currently considering an implementation technology for our domain model. We have to decide between "typed datasets" and "custom entities". Both the methods has their own pros and cons. I have done a small research on this and I thought of sharing those information through this blog post.

Here are some major reasons where I think datasets are better in some situations.
  • Database integration of the domain objects is very simple. DataAdaptor classes take care of the most of the database operations of the dataset. Also dataset has ability to remember the original values making the dirty object identification very easy.

  • Easy serialization of data entities to XML

  • Easy binding to most of the UI components

  • Easy integration with other tools and components (E.g. Biztalk Server)

  • Very good documentation and community support
Antway saying all those plus points of datasets, there are very strong arguments why and where we should not use datasets but go with custom objects.
  • Datasets makes the system less object oriented (as business methods are separated from the domain model)

  • Too much of generated code of datasets causes code duplication and lesser maintainability.

  • Exposing datasets as SOA can make services less interoperable.

  • Custom class approach is much cleaner and clear.

  • Unit testing is pretty much easy with custom class approach as data is easily bound to the operations.

  • Use of DataReaders, SPs and Custom Entities seems to perform better in the sense of memory usage and data fetch time.

In my opinion, we need to make sure that we use right tool at the right scenario. In a complex application (lots of integrations), I would prefer going with custom entities. If the application is a data driven or when the application is a disconnected data centered desktop application I would consider using datasets.


creed said...

I suppose TEMPUS is a good candidate for data sets.

Anonymous said...

Wazzzup All. Don't delete please!
acne treatment
proactive acne treatment
best acne treatment
acne scar treatment
natural acne treatment
acne home treatment
adult acne treatment
acne treatment product
acne skin care treatment product
acne treatment skin care

BuyLevitra said...

Thanks for article!

Phentermine said...

Thanks for interesting article.

Viagra said...

Glad to read articles like this. Thanks to author!

Anonimous said...

Excellent website. Good work. Very useful. I will bookmark!