Wednesday, 17 October 2007

Datasets versus custom objects

Here is a list of benefits and concerns for each approach I compiled from various Internet sources and books. If you see other points or disagree with (some) things , don't hestitate to drop a line.

Datasets (.NET2.0)

Benefits



  • Disconnnected data-container out-of-the box
  • Typed datasets enhance ease-of-programming compared to "plain" datasets
  • Table dataAdpaters automatically generated
  • Visual designer in VS.NET to create typed datasets manually or via server explorer
  • Add new data source wizard creates Typed datasets from database schema.
  • Full two-way data-binding capabilities
  • Built-in support to receive notifications when something changes inside.
  • Search/sorting capabilities out-of-the-box (some help of DataView class)
  • Work together with data adapters to retrieve and persist data.
  • You can define relationships between tables (referential constraints)
  • You can define constraint on columns (Uniqueness)
  • Can hold many kinds of data types (.NET framework)
  • The DataSet is serializable out-of-the-box (also binary )
  • Has integrated XML capabilities
  • Has built-in support for optimistic concurrency
  • You can add custom logic in typed Dataset partial classes
  • Using annotations, you can change the names of contained objects to more meaningful names without changing the underlying schema, making code easier for clients to use.
  • handle NULL values out-of-the box
  • Lot of third party controls support datasets
  • Multiple version of a column value can exist and is available out-of-the-box (row state , GetChanges, Merge)
  • With SQLdataAdapters you can load muliple tables in a dataset at once

Concerns



  • Everything is represented in .NET Object type. There is a lot of casting/boxing going on
  • Datasets used in webservices are not ideal from interoperability standpoint
  • relational API maybe too restrictive (Tables and Relations properties). Need for special methods to represent/manipulate business entities.
  • DataSet is tied directly to the database model. Abstractions are more diffeiclut . you must adhere to thinking in tables and related concepts.
  • Inheritance. Your typed dataset must inherit from DataSet, which precludes the use of any other base classes.

Custom Collections

Benefits



  • provide the means to expose data in easy-to-access APIs without forcing every data model to fit in the relational model. You can still make a one-to-one mapping with the database but you can more easily use OO technisues to model the your problem domain.
  • Advanced relationships like inheritance are possible.
  • You can add any behaviour that is needed. Custom entities can contain methods to encapsulate (simple) business rules. Custom entity classes can perform simple validation tests in their property accessors to detect invalid business entity data.
  • custom class can be marked as serializable
  • Code can be easier to understand/maintain
  • LINQ To SQL, Entity Framework are special features in future version of .NET. So MS recognizes benefits of this way of working (or is it under market pressure :)
  • using custom classes makes for easier unit testing


concerns



  • Programming effort can be bigger than all-dataset scenario
  • you must implement a interfaces in order to provide for effective containment and data-binding capabilities
  • Mapping custom collections and entities to a database can also be a complicated process that can require a significant amount of code (need for code generation/ORM tool)
  • To support optimistic concurrency time stamp columns must be defined in the database and included as part of the instance data.
  • Support for multiple versions of data state within an entity must be coded.
  • No Searching and sorting of data out of the box. You must define your own mechanism to support searching and sorting of entities.

Sources & recommended reading

21 comments:

rama said...

I think this is the best article today about the future technology. Thanks for taking your own time to discuss this topic, I feel happy about that curiosity has increased to learn more about this topic.Artificial Intelligence Training in Bangalore. Keep sharing your information regularly for my future reference.

Balaji said...

Good Post..Thanks for sharing such a wonderful article....


RPA Training in Chennai
AWS Training in Chennai
Blue Prism Training in Chennai

Jaweed Khan said...

Thank For Sharing Your Information The Information Shared Is Very Valuable Please Keep Updating Us Time Went On Just Reading The Article Python Online Course

cynthiawilliams said...

Great, this article is quite awesome and I have bookmarked this page for my future reference. Keep blogging like this with the latest info.
DevOps course in Chennai
Best DevOps Training in Chennai
AWS Training in Chennai
AWS Certification in Chennai
RPA Training in Chennai
Robotics Process Automation Training in Chennai
DevOps Training in Anna Nagar
DevOps Training in Chennai

Swashthika said...

Alot of blogs I see these days don't really provide anything that I'm interested in, but I'm most definitely interested in this one. Just thought that I would post and let you know. Nice! thank you so much! Thank you for sharing.
honor mobile service centre
honor service center chennai
honor service center in chennai
honor service centre chennai

Anbarasan14 said...

Thanks for sharing the recent updates with us. This is really helpful to me.

IELTS Classes in Mumbai
IELTS Coaching in Mumbai
IELTS Mumbai
Best IELTS Coaching in Mumbai
IELTS Center in Mumbai
Spoken English Classes in Chennai
Best Spoken English Classes in Chennai
Spoken English Class in Chennai

Gowri said...


It’s interesting content and Great work. Definitely, it will be helpful for others. I would like to follow your blog. Keep post

Check out:
react js course fees
react interview questions medium
reactjs interview questions pdf

Online Training said...

Very informative blog and useful article thank you for sharing with us, keep posting learn more about aws with cloud computing

AWS Online Training

AI Training

Rathinam said...


Superb..! Very comprehensive content for this topic with good explanation. I glad to read your great post, keep doing...
JMeter Training in Chennai
JMeter Training
Power BI Training in Chennai
Job Openings in Chennai
Linux Training in Chennai
Tableau Training in Chennai
Oracle Training in Chennai
Oracle DBA Training in Chennai
JMeter Training in Velachery
JMeter Training in Vadapalani

Softgen Infotech said...

Really very happy to say, your post is very interesting to read. I never stop myself to say something about it. You’re doing a great job. Keep it up…

Learn SAP Training from the Industry Experts we bridge the gap between the need of the industry. Softgen Infotech provide the Best SAP ABAP Training in Bangalore with 100% Placement Assistance. Book a Free Demo Today.

Realtime Experts said...

It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful.sap crm training in bangalore

Realtime Experts said...

Great post!I am actually getting ready to across this information,i am very happy to this commands.Also great blog here with all of the valuable information you have.Well done,its a great knowledgez.

eTechno Soft Solutions said...

Such a great word which you use in your article and article is amazing knowledge. thank you for sharing it.

Looking for SAP HANA ADMIN Training in Bangalore, learn from eTechno Soft Solutions SAP HANA ADMIN Training on online training and classroom training. Join today!

Unknown said...


python course in coimbatore
java course in coimbatore
python training in coimbatore
java training in coimbatore
php course in coimbatore
php training in coimbatore
android course in coimbatore
android training in coimbatore
datascience course in coimbatore
datascience training in coimbatore
ethical hacking course in coimbatore
ethical hacking training in coimbatore
artificial intelligence course in coimbatore
artificial intelligence training in coimbatore
digital marketing course in coimbatore
digital marketing training in coimbatore
embedded system course in coimbatore
embedded system training in coimbatore

Salman said...

Effective blog with a lot of information. I just Shared you the link below for Courses .They really provide good level of training and Placement,I just Had Artificial Intelligence Classes in this institute , Just Check This Link You can get it more information about the Artificial Intelligence course.


Java training in chennai | Java training in annanagar | Java training in omr | Java training in porur | Java training in tambaram | Java training in velachery

Amrita Bansal said...

Awesome. You have clearly explained … It's very useful for me to know about new things. Keep on blogging.

Data Analytics Training in Gurgaon

Unknown said...

I was unable to oppose remarking. Totally composed! tech updates

jeya sofia said...

Great Post with valuable information. I am glad that I have visited this site. Share more updates.
IELTS Classes in Chennai
Best IELTS Coaching in Chennai


Joseph Vijay said...

Very Informative article. Thank you for sharing with us.
Eagle paper plane | Zazoom | Easy Freezy | Fold n fly

SPACEBAR COUNTER said...

It is the best way to cure the anger and stress. Sometimes, harsh words and angriness can break our relationship. And I think playing this clicking game can save your relation at the time of anger. According to my opinion, open and play the click speed test during your hard time. I guarantee that you will feel relax and find your solution to the problem as well.
spacebar clicker

novahazel said...

Thank you for sharing this valuable information.
Hindi fonts download