Architectural dilemma C# project

  • Thread starter Thread starter Sharon
  • Start date Start date
S

Sharon

Hi all

I'm developing an application assembled from 10 different projects like:

Web services, Client project, Error handling project, class library , and
more .

Most of those projects need to get Database services to insert / Read
information



How do I plan correctly the database interfacing?



I thought of several ways:

Project containing DB classes and one class is the DB interface using static
methods like SELECT / DELETE . INSERT .

dbInt.SELECT(.);



Or regular class that each project will have to make an instance

DB dbImp = newDB()

dbImp.SELECT(.);



And in the select function I will implement the data lock / Wait for data
synchronization.



Please advise me what to do

Thank you

Sharon
 
Sharon said:
Hi all

I'm developing an application assembled from 10 different projects like:

Web services, Client project, Error handling project, class library , and
more .

Most of those projects need to get Database services to insert / Read
information



How do I plan correctly the database interfacing?

It sounds like a perfect fit for the Microsoft Enterprise Library:
http://tinyurl.com/6sqkl
 
If you are simply going to make a CRUD layer, the Microsoft Enterprise
library should work fine, as it can slightly abstract the CRUD methods
(CREATE, READ, UPDATE and DELETE).

If you want to move to a Service Oriented Architecture (SOA) and use Object
Relational Mapping (ORM), you will be better to think in terms of messages,
not CRUD. What I mean here is the transactional steps are a bit larger. To
facilitate ORM, you may be best working with some form of data persistence
layer (or similar - Rockford Lhotka's latest book has a variation on
persistence that he claims gets rid of some of the inherent problems of
persistence layers).

Of the two, the Enterprise library direction (abstract data layer for CRUD)
is the easiest to implement.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think outside the box!
*************************************************
 
Hi Gregory

My application uses simple SELECT UPDATE INSERT sql's

I don’t use transactions, and the database is relatively simple but contains
a lot of data,

In this version of the app i use access DB and I’m facing a lot of troubles
with this database

My problems mostly because of the multi threaded architecture of my app,

When I open several connections to the database, it fails,



The question is if I can write simple class that will allow me to interact
with the data from any place in my application,

And will be thread safe so it let the app run lots of queries.







Sorry for my English

Thank you

Sharon
 
Back
Top