Hiding Access to Multiple Databases
From: Shane Mingins (shanemingins_at_yahoo.com.clothes)
Date: 02/25/04
- Next message: Donald Roby: "Re: Relational model versus object model"
- Previous message: H. S. Lahman: "Re: New paradigm of introspective OO development"
- Next in thread: Cristiano Sadun: "Re: Hiding Access to Multiple Databases"
- Reply: Cristiano Sadun: "Re: Hiding Access to Multiple Databases"
- Reply: Alfredo Novoa: "Re: Hiding Access to Multiple Databases"
- Reply: H. S. Lahman: "Re: Hiding Access to Multiple Databases"
- Reply: Robert C. Martin: "Re: Hiding Access to Multiple Databases"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 26 Feb 2004 11:57:23 +1300
Hi
I am wondering if there is a pattern/solution to accessing multiple
instances of a database?
As an example:
I have two different databases (A & B) with Customers in. Customer "Xavier
Smith" is in both databases.
In database A Xavier has sales of $1000.00
In database B Xavier has sales of $2000.00
What I want to achieve in the Domain Layer is something like:
DB.getCustomers() and return a list of distinct customers, IOW Xavier will
appear once.
Then with the instance of Customer representing Xavier I wish to be able to
call getTotalSales(DateRange) and return $3000.00
The only possibilities that I can see is either:
One solution needs Customer to "know" which of the databases it came from
(i.e. A or B, or both A and B) to quickly request the sales values;
Or the databases are re-queried when getTotalSales is called to determine
which contain the Customer to then request the sales values;
Or each database is queried for sales values with one of those queries
possibly returning zero.
So are there other possibilities to consider?
Or is it a question of choosing between performance over separation, IOW to
totally isolate the Domain Layer from knowledge of the "where" it came from
there will be a loss in performance?
[In case it is relevant to a reply, I am using Java, the databases are
proprietary with read-only access via JDBC-ODBC]
Thanks
Shane
shanemingins@yahoo.com.clothes
remove clothes before replying
"When everybody actually is out to get you, paranoia is just good
thinking." -- Woody Allan
- Next message: Donald Roby: "Re: Relational model versus object model"
- Previous message: H. S. Lahman: "Re: New paradigm of introspective OO development"
- Next in thread: Cristiano Sadun: "Re: Hiding Access to Multiple Databases"
- Reply: Cristiano Sadun: "Re: Hiding Access to Multiple Databases"
- Reply: Alfredo Novoa: "Re: Hiding Access to Multiple Databases"
- Reply: H. S. Lahman: "Re: Hiding Access to Multiple Databases"
- Reply: Robert C. Martin: "Re: Hiding Access to Multiple Databases"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|