?
Solved

Using the sane DAL (Data Access Layer) on a desktop and Windows Mobile System, with diferent databases clients

Posted on 2010-09-01
5
Medium Priority
?
640 Views
Last Modified: 2012-05-10
Hi experts.

I'm developping an application that will run on both desktop and Windows Mobile platform. Since the application is the same, I'm developing it in a 3 tier project. The Data tier and the Business Tier will be the same on both applications. Only the presentation tier will be different.

My DAL was built in a way that we can connect to an Oracle Database (System.Data.OracleClient) when used by the Desktop app and to an SqlCE database, when using Windows Mobile.

The problem is that the DAL references both Oracle and SqlCE libraries when loaded and, to make it work on Desktop I need to install SqlCE, that will be never used in this way. Worse then this, when the DAL is loaded on a Windows mobile, they also needs to load OracleClient, that will never be available.

So, is there any way to load this references on runtime, without performance hits, and without loosing the connection pool that exists on OracleClient, or will I need to develop 2 DALs, one to each case described?

Thanks a lot.

0
Comment
Question by:regisdaniel
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 16

Accepted Solution

by:
Vikram Singh Saini earned 1600 total points
ID: 33583550
Hi,

There are two things:

(1) No, you can  not add reference at runtime.  Adding  reference creates  several classes that provide you different methods and properties; those  classes need to be compiled before they can be used.
 
(2) But Yes, the same can be made possible by Reflection. You should have look on link:
http://www.codeguru.com/csharp/csharp/cs_syntax/reflection/article.php/c5881

Regards,
VSS
0
 
LVL 1

Assisted Solution

by:waheedk
waheedk earned 200 total points
ID: 33583840
you need to develop two different DALs each for a DBMS, and use a DAL factory for loading the required DAL.
0
 

Author Comment

by:regisdaniel
ID: 33585238
Hi VSS and Waheedk, thanks for your help.

VSS, do you know if the Connection Pool functionality will be preserved if I use reflection, as you suggest ?

Waheedk, the solution you provided, using a Database Factory, also uses Reflection to Load the correct DAL?

Thanks.
0
 
LVL 16

Expert Comment

by:Vikram Singh Saini
ID: 33585282
Hi,

As far I know about Connection Pooling it is the concept that is attached with website. For e.g., if your website which is been deployed on IIS server, then if your application is connecting to database, and you have made Connection Pooling to true, then in that case the asp worker process is there to maintain connection pooling, & it is preserved until any type of modifcations is not done in connectionString be it in ordering or in the data within it.

However after a specified period of time, if connections are not used from connection pool they are destroyed automatically. So I think there should be no issues while using reflection.

Regards,
VSS
0
 
LVL 6

Assisted Solution

by:PJBX
PJBX earned 200 total points
ID: 33592283
I think you should have separate DALs.  How much data do you plan on loading? I would be concerned about SQLCE and memory. However, if you have to, the Entity Framework 4 might be an option for both platforms.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question