Hi Joanna,
Thankyou for the detailed reply. I'm still digesting what you've written,
so I'll reply with any questions soon :).
Chris
"Joanna Carter [TeamB]" <joanna@not.for.spam> wrote in message
news:ORNkdeYCGHA.4076@TK2MSFTNGP14.phx.gbl...[color=blue]
> "Joanna Carter [TeamB]" <joanna@not.for.spam> a écrit dans le message de
> news:
OmX7YQYCGHA.532@TK2MSFTNGP15.phx.gbl...
>
> And I still didn't really answer your question.
>
> There really isn't anything that allows you to retrieve objects directly
> froma database, which is why I mentioned the OPF idea. A database is not
> modelled on tha same paradigm as an object model; the database uses a
> relational model which is subtly different from an object model.
>
> e.g.
>
> database :
>
> OrderLine
> - ID: integer
> - OrderID: integer
> - Quantity: integer
> - ProductID: integer
> - UnitPrice: float
> - Total: float
>
> Order
> - ID: integer
> - Ref: string
> - Date: DateTime
> - CustomerID: integer
> - Total: float
>
> object model :
>
> OrderLine
> - ID: integer
> - Quantity: integer
> - Product: Product
> - UnitPrice: float
> - Total: float
>
> Order
> - ID: integer
> - Ref: string
> - Date: DateTime
> - Customer: Customer
> - Lines: List<OrderLine>
> - Total: float
>
> Notice that in the relational model, the Order table has no knowledge of
> the
> OrderLine table but the OrderLine table has to have a foreign key field to
> link its records to a particular record in the Order Table; there may be
> additional referential integrity constraints and things like cascade
> deletion to ensure that when an Order is deleted, all its Lines are also
> deleted.
>
> Using an OO approach, we can dispense with the foreign key from the Line
> to
> the Order as the Order already knows about its Lines; in fact, there
> really
> is no need for the Line to know about the Order, as in the relational
> model.
> Notice also that we do not use integer IDs to link object together, but
> instead real references to real objects.
>
> It is this "impedance mismatch" between the relational model and the
> object
> model that is resolved in an OPF. A mapping hierarchy lets us specify the
> relational foreign key field links without polluting the object model. In
> fact all a relational database behind an OPF has to do is simple single
> table selects, updates and deletes, most of the time, as all the integrity
> between objects is taken care of in the business object layer.
>
> Joanna
>
> --
> Joanna Carter [TeamB]
> Consultant Software Engineer
>
>[/color]