473,385 Members | 1,693 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,385 software developers and data experts.

C# datalayer architecture - comments please!

Hi

I'm writing a datalayer for a C# application. Currently, I've implemented it using the following main components

- An interface called IDataAcces
- A singleton object called DataAccess implementing that interface
- A static class called SqlQueryBuilder which is used by DataAccess to build dynamic SQL queries
- A static class called SqlWorker which is used by DataAccess to execute SQL queries
- A static class called DBAccess which delivers database connections to SqlWorker

Is this a decent architecture? I'm kind of thinking it's not very object oriented... but is that a problem? If so, why? Any thoughts would be greatly appreciated!
Nov 15 '05 #1
2 3908
Ranier,

While the interface is a good idea, I don't know of the value of it if
you are going to have a singleton.

I am curious, why not just have a class that has references to all of
these to do it's work? Have a class that implements your interface, then
uses SqlQueryBuilder, SqlWorker, and DBAccess internally to perform its
work.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Ranier Dunno" <an*******@discussions.microsoft.com> wrote in message
news:97**********************************@microsof t.com...
Hi,

I'm writing a datalayer for a C# application. Currently, I've implemented it using the following main components:
- An interface called IDataAccess
- A singleton object called DataAccess implementing that interface.
- A static class called SqlQueryBuilder which is used by DataAccess to build dynamic SQL queries. - A static class called SqlWorker which is used by DataAccess to execute SQL queries. - A static class called DBAccess which delivers database connections to SqlWorker.
Is this a decent architecture? I'm kind of thinking it's not very object

oriented... but is that a problem? If so, why? Any thoughts would be greatly
appreciated!
Nov 15 '05 #2
Ranier Dunno wrote:
Hi,

I'm writing a datalayer for a C# application. Currently, I've implemented it using the following main components:

- An interface called IDataAccess
- A singleton object called DataAccess implementing that interface.
- A static class called SqlQueryBuilder which is used by DataAccess to build dynamic SQL queries.
- A static class called SqlWorker which is used by DataAccess to execute SQL queries.
- A static class called DBAccess which delivers database connections to SqlWorker.

Is this a decent architecture? I'm kind of thinking it's not very object oriented... but is that a problem? If so, why? Any thoughts would be greatly appreciated!

You might want to compare it with the MS Data Access Application Block
to get ideas:

http://msdn.microsoft.com/library/en...ml/daab-rm.asp

--
mikeb
Nov 15 '05 #3

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

Similar topics

3
by: Michael Crawford | last post by:
Hi, Where would one start for this type of application: I want to create an vb.net container application that has the gives the end user the ability to install and uninstall plugins or add-in...
25
by: David Noble | last post by:
We've been developing a web site using 3-tier architecture for 18 months now. There is a common layer that defines the classes - using XML schemas. The data layer acts as a wrapper to 3 databases...
4
by: Nick Goloborodko | last post by:
Hi, I'm in the process of conceptualizing a new ASP.NET application. I'm a relative newbie in ASP.NET / .NET in general, so any comments will be greatly appreciated. Basically i need to make...
3
by: Ken H | last post by:
Hi I have a question about architecting solutions.. I have a part of a project which requires me to track person details (name, addresses, etc... Should I be creating Person objects, Address...
2
by: hecsan07 | last post by:
Hey I am looking for an article or a tutorial to creating a DataLayer utilizing ..NET 1.1. Everything I dig up lately is only for .net 2.0. We are not quite ready yet to implement that in my...
2
by: Ken Ross | last post by:
I'm in the early stages of working up the design for a large .Net web application and want to make sure that we have the best possible physical architecture to support the logical architecture and...
0
by: srikar | last post by:
Hi all, I am having a problem, when I am compiling the code in 32 bit option on a 64 bit machine using the macro CPPFLAGS= -m32 I am getting the following warnings from the linker . ...
6
by: mattmao | last post by:
Hi all. There is a challenge question I encountered recently, which says: "In plain English, there are six different ways when you want to tell someone else about the current time: ...
0
by: ddmetro | last post by:
Hi All, Our project is to optimize gcc's instruction scheduling. It requires us to specify architecture information (basically number of cycles per instruction, stall and branch delays)...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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,...

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.