[MonoDevelop] Typed dataset issue

Onur Gumus emperon at gmail.com
Sun Feb 24 04:52:41 EST 2008


For a few things. As a rule of thumb I believe if a framework genereates C#
code, then it starts to smell. For typed datasets the situation got much
worse since you can't even modify the generated source code.

The second drawback when your database schema changes typed datasets start
to become unmaintable and unrecoverable breaks occur. Since typed datasets
generated dircectly by current database schmea any changes to your database
should be reflected to your typed datasets. That means regenerating all the
code. Which in turn breaks your code that interacts with database layer. I
really have had hard time.

The thing is the above is also valid for linq to sql. Linq to sql brings a
very nice natural syntax for querying database however  to use linq to sql
you also need to generated (messy) code via sql metal.


Ironically Subsonic goes the same code generation way how ever , it enables
you to modify the code being generated. So although it is not my top choice
, subsonic seems to me a better option

My top choice would be NHibernate for large projects and Castle Active
Recrod for small to medium projects. Castle Active Record is in deed built
on top of NHibernate which abstracts NHibernate in a way that we can use
Martin Fowler's Active Record pattern (very similar to ruby on rails). The
difference is Castle Active Record is very easy to learn and setup where as
NHibernate has a really steep learning curve (due to its enormous power. I
mean  it!!! It is powerful)


The difference between NHibernate derived frameworks and subsonic linq and
dataset is on how you approach the problems. With NHibernate you go fully
domain driven approach. First design your domain objects , classes via UML
while completely ignoring the existance of your database. ( And I mean it
!!! you should really forget about it ). Build your classes, abstract
classes and inheritence trees, associations and so on and , let NHibernate
do the dirty job for you , thus it will create all the tables and
associations (including your persistent subclasses and interfaces). For linq
we also have an experimental Linq to NHibernate binding which is a plus


ADO.NET Entity framework is following the same approach IIRC

However on some projects the above cannot be applied since you already have
a database structure and you have to build your application on top of it. In
those cases, NHibernate performs very well due to its high confugrability.
However for those "data driven" applications , subsonic or linq to sql might
suit better since they are coming from data to domain unlike nhibernate.


These topics are highly being debated, and those above just reflects my
opinons based on my personal experience. So I am not after starting a
flamewar if you disagree. Use to the tool that you are happy with.

Happy coding :)

Onur




On Sat, Feb 23, 2008 at 10:42 PM, Swaminathan Saikumar <swami at giveexam.com>
wrote:

> Hello, thanks for the awesome suggestions. I wasn't even aware of the
> other frameworks.
> I'm just curious; why did you think Typed Datasets are bad?
>
>
> On 2/23/08, Onur Gumus <emperon at gmail.com> wrote:
> >
> >
> > Hello, I am not sure if typed datasets are supported directly by mono.
> > But actually Typed datasets are visual studio generated code.
> >
> > Furthermore, I have quite an experience on Typed Datasets, and my
> > conclusion is they are badly designed and does more harm than good( They are
> > also mostly ignored in .NET 3.0+ that no one mentiones them any more).
> >
> > Alternatively you may want to check out  the following frameworks which
> > offer much better solutions than typed datasets:
> >
> > Subsonic, NHibernate, Castle Active Record, Linq to sql (Linq to sql
> > does not work with mono at the moment)
> >
> > Regards
> >
> > Onur
> >
> >
> > On Sat, Feb 23, 2008 at 4:25 PM, Sharique uddin Ahmed Farooqui <
> > safknw at gmail.com> wrote:
> >
> > > Hi,
> > >
> > > I have created a web application using VS 2005 express. I used typed
> > > dataset in application.  It works well. Now I created a web application in
> > > Monodevelop. I imported every file from VS project folder. When I compile
> > > this MD application, it doesn't compile typed dataset.
> > >
> > > How I can resolve this?
> > > Is typed dataset is not supported in mono?
> > > --
> > > Sharique uddin Ahmed Farooqui
> > > (C++/C# Developer, IT Consultant)
> > > A revolution is about to begin.
> > > A world is about to change.
> > > And you and I are "the initiator".
> > >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/monodevelop-list/attachments/20080224/33466a75/attachment.html 


More information about the Monodevelop-list mailing list