Re: Databinding - Best Practice (object-oriented)
From: Grant Frisken (gfrisken.minusspam_at_optusnet.com.au)
Date: 06/06/04
- Next message: Harry Maes: "Re: Databinding - Best Practice (object-oriented)"
- Previous message: Alfredo Novoa: "Re: Databinding - Best Practice (object-oriented)"
- In reply to: Alfredo Novoa: "Re: Databinding - Best Practice (object-oriented)"
- Next in thread: Alfredo Novoa: "Re: Databinding - Best Practice (object-oriented)"
- Reply: Alfredo Novoa: "Re: Databinding - Best Practice (object-oriented)"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 7 Jun 2004 09:19:32 +1000
"Alfredo Novoa" <alfredo@nospam.es> wrote in message
news:40c385db.18444381@msnews.microsoft.com...
> On Sun, 6 Jun 2004 14:39:00 +1000, "Grant Frisken"
> <gfrisken.minusspam@optusnet.com.au> wrote:
>
> >ADO.NET is one way of mapping a relational database into an object
oriented
> >space. For my money it suffers from the fact that it is a very thin
> >mapping that means your application code is very exposed to the actual
> >database structure.
>
> No, you are wrong. The actual database structure is hidden by the SQL
> DBMS. Your application code is not exposed to the internal data
> structures used by the DBMS.
I meant of course that your code is exposed to the relational model - which
is in general a different way of looking at the problem domain then many OO
designers would use. This is not to say that it is necessarily better or
worse - just different - and when using object oriented design and languages
there is an impedance mismatch between the two models. ADO.NET does
nothing to address this, it just maps the relational model into objects
which results, in my view, in a somewhat unnatural object oriented usage if
you choose to use this model directly throughout your code.
> > It also results in objects which are fairly
> >"unnatural" for purist OO designers - that is the objects "Tables, Rows"
> >have no real basis in the domain.
>
> A table represents a set of true logical propositions. If the table is
> well designed it has all to do with the "domain".
>
> >Implementing a fatter OO mapping layer does take some more work (mostly
> >boiler plate code) in the data layer - although there are several
commercial
> >and free OO Relational mapping products available that do this
> >automatically.
>
> And all of them I know make great blunders. For instance most of them
> identify tables with classes.
This doesn't have to be the case. I've developed OO/Relational mappings in
the past which allow much more sophisticated mapping then one class = one
table. I agree that the tools that attempt to auto generate a relational
structure from an OO hierarchy based on such simple heuristics tend to
produce very ugly and inefficient database structures (just as I believe
direct mapping of a relational database structure into object oriented
design tends to produce ugly object oriented code). The two layers, in my
view, need to be designed somewhat independantly to maximise the strengths
of both technologies.
> > But I think the work is worth it because it allows the bulk
>
> I agree on that a good replacement for ADO.NET would worth the work.
> The best I know is here: www.alphora.com
>
I see you have pushed this product several times - you wouldn't happen to
have a financial interest in it would you :-)
> >of your application to be isolated from the exact implementation details
of
> >the data layer and makes this code much cleaner and easy to understand.
>
> As I said before all DBMSs already do that.
You appear to come from a very strong DMBS background - which means that you
are probably very comfortable using this model throughout your code.
Others will prefer to work with an application model that is closer to the
design modelling that they do (which typically will not include tables,
relations and rows etc as first order objects).
Regards
Grant
- Next message: Harry Maes: "Re: Databinding - Best Practice (object-oriented)"
- Previous message: Alfredo Novoa: "Re: Databinding - Best Practice (object-oriented)"
- In reply to: Alfredo Novoa: "Re: Databinding - Best Practice (object-oriented)"
- Next in thread: Alfredo Novoa: "Re: Databinding - Best Practice (object-oriented)"
- Reply: Alfredo Novoa: "Re: Databinding - Best Practice (object-oriented)"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|