.NETGURU
designing dataacess layer implemeting 2 type of databases
Messages   Related Types
This message was discovered on ASPFriends.com 'ngfx-patterns' list.


edward bakker
-- Copied from [aspngarchitecture] to [ngfx-patterns] by Charles M. Carroll <Click here to reveal e-mail address> --Hi all,Currently I am "architecting" a project using .NET Beta 2. I am desining the architecture for a large employee benefit system.The archicture consists of a workflow(process), business, data acceess layer. It is a MUST for the aplication to support both Microsoft SQL Server and Oracle database. It is forbidden to use stored procedures... don't ask my why!!!In the dataacces layer we implement serveral methods for accessing the data. for instance the method "getcustomer" on the customerdataaccess class.At this moment the plan is too inherit the customer dataacces class in a "customerDBMicrosoft" class. In this class the actual connection is created for the microsoft database and the data is retrieved.At the same moment a "customerDBOracle" class exist, which connects too the oracle and retrieves the data when using an oracle database. The problem is that we don't want to "store" the SQL statement in de "...DBMicrosoft" and "...DBOracle" class. This because in maybe 90 % the statements will be the same for both database's.Inheriting the "DB" classes from the dataacces layer makes it necessary to program al the "connection code" in each seperate class (CustomerDBMicrosoft, OrderDBMicrosoft, CustomerDBOracle, etc.) since multiple inheritance is not possible. It is NOT possible also to create a "baseMicrosoft" or "baseOracle" classMy question !!! Can anyone suggest an nice architecture for the above problem. Stored procedures are NOT allowed, and in case Oracle and Microsoft SQL statements are the same, it is preffered to store them once !!!Hope this is clear, thanks in advance !!!!Edward Bakker_________________________________________________________________Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
Reply to this message...
 
    
Brian Boyce
Edward,

While not the most secure have you considered storing the SQL statements
within an XML document. The XML can then store (SQL Server + Oracle ) OR
Generic SQL. If Security is a problem then read the XML in from an encrypted
file into a SQL wrapper class which returns the appropriate SQL based on a
key

Don't know if it helps, but it may trigger another idea that will.

Brian Boyce
Alphatec Software

-----Original Message-----
From: edward bakker [mailto:Click here to reveal e-mail address]
Sent: 07 November 2001 10:34
To: ngfx-patterns
Subject: [ngfx-patterns] designing dataacess layer implemeting 2 type of
databases

-- Copied from [aspngarchitecture] to [ngfx-patterns] by Charles M. Carroll
<Click here to reveal e-mail address> --

Hi all,

Currently I am "architecting" a project using .NET Beta 2. I am desining the

architecture for a large employee benefit system.

The archicture consists of a workflow(process), business, data acceess
layer. It is a MUST for the aplication to support both Microsoft SQL Server
and Oracle database. It is forbidden to use stored procedures... don't ask
my why!!!

In the dataacces layer we implement serveral methods for accessing the data.

for instance the method "getcustomer" on the customerdataaccess class.

At this moment the plan is too inherit the customer dataacces class in a
"customerDBMicrosoft" class. In this class the actual connection is created
for the microsoft database and the data is retrieved.

At the same moment a "customerDBOracle" class exist, which connects too the
oracle and retrieves the data when using an oracle database. The problem is
that we don't want to "store" the SQL statement in de "...DBMicrosoft" and
"...DBOracle" class. This because in maybe 90 % the statements will be the
same for both database's.

Inheriting the "DB" classes from the dataacces layer makes it necessary to
program al the "connection code" in each seperate class
(CustomerDBMicrosoft, OrderDBMicrosoft, CustomerDBOracle, etc.) since
multiple inheritance is not possible. It is NOT possible also to create a
"baseMicrosoft" or "baseOracle" class

My question !!! Can anyone suggest an nice architecture for the above
problem. Stored procedures are NOT allowed, and in case Oracle and Microsoft

SQL statements are the same, it is preffered to store them once !!!

Hope this is clear, thanks in advance !!!!

Edward Bakker

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp

| [ngfx-patterns] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngbeta.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

Reply to this message...
 
 




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification