Re: O/R Mapper



"Frans Bouma [C# MVP]" <perseus.usenetNOSPAM@xxxxxxxxx> a écrit dans le
message de news: xn0eh6pwmd80mm000@xxxxxxxxxxxxxxxxxxxxx

| what the definition of 'best' is in your statement is still vague.

I did not state that my OPF was the best, just that deriving classes from
tables was not the best. Unfortunately, unitl we get a "perfect" OODB, we
will all be working with compromise due to the impedance mismatch between
the two paradigms.

| But, tell me: why is this 'better' ? Of course wacky setups are
| thinkable where there are clear differences, the question is if this
| will bring you any advantage.

Because this is an accurate modelling of the real compositional nature of
such classes; it is not abstracted to "make it fit" a relational database.

| Yes, I know. 3 years full time now and counting.

Heheh, then it should start getting easier now :-))

| Btw I was referring to the model you proposed: add fields / hierarchy
| elements to classes and let a tool propagate the changes to the db.
| (which you seem to declare 'best'). The propagation of changes to the
| db can be cumbersome in a huge schema with lots of data.

As I have already said, I did not say that this method was "the best", just
that it avoids having an object model coerced into a relational one.

| So, your 'superior' mapper always cranks out the proper upgrade
| scripts, and takes into account the full load of the db ? Remember: you
| claimed starting with classes and let the o/r mapper update the db
| according to the changes made to the class model be 'best'. So, 'not
| true', what does that really mean?

We don't write migration scripts, the OPF looks after that for us; since we
wrote the scripting engine.

Our OPF evaluates execution times and attempts to optimise the generated
SQL; if it still can't achieve desired speeds, then we have a facility for
injecting a custom generator for any given type.

Most complex data retrieval that would require joins, etc tends to be for
what I would call reporting classes. IOW, they are complex queries for
something like, how many of a certain product were sold to Mr Bloggs in
2004. For these scenarios, we write a class like ProductSalesSummary and
ensure that the OPF contains a custom query, handcrafted if necessary.

I am not saying that your design doesn't have value; it certainly makes a
quick migration for legacy databases but for new-build projects, we have
found the object-led approach works very well.

Joanna

--
Joanna Carter [TeamB]
Consultant Software Engineer


.



Relevant Pages

  • Re: Delphi 6 vs C# speed comparison
    ... > a ton of limitations). ... I don't give my OPF for free either. ... Joanna Carter ... TeamBUG support for UK-BUG ...
    (borland.public.delphi.non-technical)
  • Re: "Facets" or how to reduce available members...
    ... | So refactor your code and put a middle tier between the db components ... It's called an OPF - see TechInsite or Bold or ECO. ... Joanna Carter ... TeamBUG support for UK-BUG ...
    (borland.public.delphi.language.objectpascal)
  • Re: OODesign approach in reality
    ... Joanna Carter wrote: ... column in a detail table simply by determining that a list property is readonly and that it is part of an IComposite implementing class. ... Joanna, are you using a table per class in your OPF, mapping properties to columns, or what kinda approach do you have? ...
    (borland.public.delphi.non-technical)