Opinions on my DAL solution (oracle & sql) ?

Posts   
 
    
swegele
User
Posts: 33
Joined: 25-Jan-2007
# Posted on: 31-Jan-2007 21:57:20   

We support both Oracle and SQL. The columns are identical but the datatypes are not. (No Text, Blobs or stuff like that) But a customer is always SQL or alway Oracle...no switching going on.

So my understanding is that the adapter pattern with IDataAdapter soution will not work for me because the differences in datatypes.

So what I did was to create a MyDAL.dll that is SelfServicing built on SQL. Then I can build another MyDAL.dll based on Oracle. If I send the product to a customer with Oracle I give them the MyDAL.dll build on Oracle and visa versa. The only way to tell the difference between the two dll's would be to look at their properties to see the description information.

My business layer shouldn't care which DLL it is interacting with right?

The only problem seems to be duplicated code but: - I didn't write it, LLBLGen did simple_smile - Supporting Oracle is a pain...just a matter of where you feel the pain.

What do you veterans think?

Sean

Walaa avatar
Walaa
Support Team
Posts: 14983
Joined: 21-Aug-2005
# Posted on: 01-Feb-2007 09:00:52   

It would have been much better if the dataTypes match in both databases. (And match means they map to the same .NET dataTypes)

If not you can use TypeConverters to unify the .NET dataTypes used by each database solutions. This will enable you to use the same Adapter -> DBGeneric classes for both databases, and only switch between the DBSpecific classes of each database.

Otherwise your solution seems OK. But your BL won't be able to use the Generated Business Objects (eg. OrderEntity) since most probably it will have different data types for each database.

So as long as you don't want to use the generated Entity classes in the BL or in the interactions between the DAL and the BL, you are in a safe track.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39749
Joined: 17-Aug-2003
# Posted on: 01-Feb-2007 10:47:44   

I'd also advice to look into typeconverters to make the .net types of both projects the same. Most of the time it's pretty minor. You then can write a single code base against a single entity set.

Frans Bouma | Lead developer LLBLGen Pro
swegele
User
Posts: 33
Joined: 25-Jan-2007
# Posted on: 01-Feb-2007 18:33:09   

Thanks guys...I think I will follow your advice to build a SQL Adapter project now and start reading up on the TypeConverters.

I have some time before we would have a customer on Oracle so I can wait until you are done with your project migration tool.

Listen, you have a great product here, making my job soo much easier. The demo has convinced me and we will be buying full version very soon. Thank you for your dedication to the concepts!

Sean Wegele