Re: Help! Difficulty understanding DB -> Object mapping




frebe wrote:
> > I do need to record the title of the product with the line item,
that
> > seems for sure price too.
>
> Denormalizing data might only be a good idea in datawarehouse
> solutions. In your transactional database, the schema must be
> normalized. The product title (and price) can be retrieved by a very
> simple join.
>
> > with data that may change copied into the LineItem.
>
> If you need history in your database, you change the schema to this:
> OrderLineItem(Order_ID, Product_ID, ProductVersion,...)
> Product(Product_ID, ....)
> ProductVersion(ProductVersion, title, price, ....)
>
> Copying all product data into every order line would cause you a data
> bloat.
>

This sounds like a reasonable idea. Are you putting the main
changeable details in ProductVersion (it seems that way but want to
check I am reading properly).

> > It seems that from the application, it is necessary to load the
> Product
> > object from somewhere
>
> >From the database, direct (using ADO) or indirect.
>
> > This seems like too many queries...
>
> What is the problem with this? Queries is a good way to fetch the
data
> you want for the current context.
>

The issue with queries which I thought you were referencing, was that I
will need to keep going back to the database to load up all of the
different objects referenced by the Order/OrderLineItem. From my
computer science course I have learnt that many journeys to the
database is a performance issue. Would you agree?

> > To view Order contents at the UI, have a different structure to
> > bring back the necessary data to be viewed, be that a resultset or
> > other information object?
>
> Using resultsets is the simpliest solution, but it is not type-safe
and
> error-prone (column names are types as strings). The domain object
> solution, will force you to write many find- and load-methods, unless
> you use a competent O/R mapper.
>

Yes, this is what I have.

> > I am using .NET - could you recommend somehting?
>
> No, I am using java. But I have heard that ADO is more capable than
> JDBC, so I would probably use ADO directly.
>

Fredrik thankyou.

> Fredrik Bertilsson
> http://butler.sourceforge.net

.



Relevant Pages

  • Desperate for help on serious TCP/IP connectivity problem
    ... MSDE either SP2 or SP3a) via TCP/IP under ADO results in queries being ... the connection to the database is made via TCP/IP ... We suspect that deep in the TCP/IP stack something is pumping messages, ...
    (microsoft.public.sqlserver)
  • Re: Run action query in back-end from front-end database
    ... ADO is a more generic approach. ... Since DAO was designed specifically for use with Jet databases, ... And I still don't buy your argument about why you have the queries in the ... whatnot in the back end database. ...
    (microsoft.public.access.externaldata)
  • Re: Help! Difficulty understanding DB -> Object mapping
    ... The product title (and price) can be retrieved by a very ... If you need history in your database, you change the schema to this: ... direct (using ADO) or indirect. ... > bring back the necessary data to be viewed, be that a resultset or ...
    (comp.object)
  • Re: DAO to ADO and stored procs
    ... We are moving an entire project from DAO to ADO. ... The Database is MS Access 2000 and nothing is changed from the database ... The problems are mainly queries with params, ... Access SQL syntax is a little different when you move from DAO to ADO ...
    (borland.public.delphi.database.ado)
  • Re: VBA CODE - ADODB
    ... You do not want to use DAO with Access or anything else at this time. ... A second reason is there's no advantage that ADO is going to give you ... It all depends on the code and queries. ... > most VB/DB code is so God-awful that the database layer doesn't matter. ...
    (microsoft.public.vb.general.discussion)