473,394 Members | 1,759 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Advice on Data Layer

I want to create an n-tier app and I would like an advice of you that
know more than me about this.

I want my app to support multiple databases in the way that when a
client wants to use Oracle and not SQL server, I can easily port the
data layer without touching the rest of the code.

So, I have 2 ideas.

1: Take the way MS Pet Shop did (I read a LOT in many sites how this
architecture is flawed) in creating an IDAL where i declare DAL
interfaces to all my objects and implement them in the real DAL (SqlDAL,
OracleDAL, etc).

2: Create abstract classes that implement common code to all the DALs
(like some selects are really equal in any database) and override them
in the real implementation providing the code that is different.

Both of them include am Data Access Interface to provide common way to
access all the data from a single point, and a Factory to choose which
DAL I should use.

I would like to know from you what is best in your opinion, even other
idea that i didn't write. I don't know if my references are the best ones.

Other thing that I am in doubt is that way MS pet shop uses to
instantiate classes. Is there any performance issues using
Assembly.CreateInstance(string)? I'm afraid that when using lots of
requests per second, this could affect the application.

Thanks in advance.
Nov 22 '05 #1
1 1463
I am using LLBLGen Pro (http://www.llblgen.com) myself: you can generate
your DAL for multiple databases. By using e.g. the facade pattern or
another layer on top of the two generated DALs you can create the wanted
effect.

Natan wrote:
I want to create an n-tier app and I would like an advice of you that
know more than me about this.

I want my app to support multiple databases in the way that when a
client wants to use Oracle and not SQL server, I can easily port the
data layer without touching the rest of the code.

So, I have 2 ideas.

1: Take the way MS Pet Shop did (I read a LOT in many sites how this
architecture is flawed) in creating an IDAL where i declare DAL
interfaces to all my objects and implement them in the real DAL (SqlDAL,
OracleDAL, etc).

2: Create abstract classes that implement common code to all the DALs
(like some selects are really equal in any database) and override them
in the real implementation providing the code that is different.

Both of them include am Data Access Interface to provide common way to
access all the data from a single point, and a Factory to choose which
DAL I should use.

I would like to know from you what is best in your opinion, even other
idea that i didn't write. I don't know if my references are the best ones.

Other thing that I am in doubt is that way MS pet shop uses to
instantiate classes. Is there any performance issues using
Assembly.CreateInstance(string)? I'm afraid that when using lots of
requests per second, this could affect the application.

Thanks in advance.

Nov 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: M O J O | last post by:
Hi, I'm creating an CRM solution for my company. I want to split up the solution into several classlibraries, so I dont need to build the entire solution every time I run my project. First...
1
by: Natan | last post by:
I want to create an n-tier app and I would like an advice of you that know more than me about this. I want my app to support multiple databases in the way that when a client wants to use Oracle...
4
by: mallen | last post by:
Hi All, I have a web application with the usual 3 layers; presentation, business, and DB. We are just about to start work on a new project with a totally separate presentation layer, but will...
1
by: Johann Blake | last post by:
I am looking for a good solution on how to implement data access in an application so that there is a clean separation between the data access layer, the business layer and the GUI layer. I am...
9
by: Laban | last post by:
Hi, I find myself using static methods more than I probably should, so I am looking for some advice on a better approach. For example, I am writing an app that involves quite a bit of database...
6
by: V. Jenks | last post by:
I apologize if this is the wrong forum for this, I could not locate one that was exactly appropriate for this topic. Over the last couple of years I've been doing a lot of reading on design...
3
by: Shapper | last post by:
Hello, Until now I have been using Dreamweaver to create ASP.Net/VB web sites. I gave up of using it. Too many limitations. What is the best software to create ASP.NET/VB web sites? Maybe...
13
by: Alan Silver | last post by:
Hello, MSDN (amongst other places) is full of helpful advice on ways to do data access, but they all seem geared to wards enterprise applications. Maybe I'm in a minority, but I don't have those...
1
by: MuZZy | last post by:
Hi, I'm going to develop a pretty simple document management application and i want to use WCF to connect back-end to smart client front-end. That application will allow to create a...
13
by: terry.holland | last post by:
I have a three tiered CRM application (ASP.Net UI, VB.Net Business Layer & VB.Net Data Access Layer) that consists of number of classes. The application will be deployed to a number of clients. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.