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

C# Application Designs

Hello,

I've been creating small applications in c# using an access db backend.
I've noticed that on all of those applications I rarely apply any OOP
technologies (such as Inheretance, Encapusulation, Interfaces, etc.). I
would like to take advantage of those technologies so that the
applications I create are easier to maintain and can be upgraded with
out (or as little) problems as possible. Speaking to a developer he
told me to try to sepearte the program into layers (presentation,
business, data access). I know how to create the presenation, but I am
getting stuck how to set up the other two layers.

Maybe I can give you an example of what I am trying to do and someone
out there can tell me how I could set up this. I have the following
tables in a database:

Customers
CustomerTypes
Contacts
ContactTypes
TechTickets
TechTicketTypes
TechAgents
TechAgentTypes

In the past applications I've created a class that would query the
database and query it to retreive a list of Customers, open Tech
Tickets, List of Tech Agents, and list of Contacts. This is all that I
have done to work with the data in the database.

Things I'd like to do is to be able to create new Customers, Contacts,
TechTickets, etc. in the Database. In addition I'd want to search for
and edit the entities referenced above.

Can anyone give me an idea as to how you would try to what I am trying
to do. Maybe there are some web sites out there with an example that I
can use as a template on how to go about doing this? Any information
that you can provide will be greatly appreciated!

Thanks,

Ed_P.
Nov 16 '05 #1
1 1499
As far as your specific problem is concerned: the Agile developer in me
says: Don't overdesign this.

If it works the way it is, why change it.

On the other hand, you should know the fundamentals of OO design, so that
your code will be easier to maintain.
For that part, I can help. Start here:
http://blogs.msdn.com/nickmalik/arch...21/328727.aspx

The pattern you are looking for is the Layers pattern, described by
Buschmann.
The goal is to create layers in your application that seperate the concerns.
Using this pattern, the data access layer overcomes the impedence between
relational storage and object oriented heirarchies.
The business logic layer handles rules specific to the business (limits on
behavior, calculations based on business needs, logic for auditing and
logging, etc).
The user interface layer simply maps the U/I to the business logic layer,
and does as little else as possible (because that's already plenty).

Personally, I find this pattern limiting. I would fall back to the even
earlier pattern of Model-View-Controller to describe the interacting
components within an application, with your data access layer acting as the
model, the user interface layer acting as the view, and the business logic
layer acting as controller. The shift is subtle, but it is more comfortable
to me.

To learn more: google the terms:
Buschmann layers pattern
Model view controller
Microsoft patterns and practices

Hope this helps,
--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"Ed_P." <ed**@mail.com> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
Hello,

I've been creating small applications in c# using an access db backend.
I've noticed that on all of those applications I rarely apply any OOP
technologies (such as Inheretance, Encapusulation, Interfaces, etc.). I
would like to take advantage of those technologies so that the
applications I create are easier to maintain and can be upgraded with
out (or as little) problems as possible. Speaking to a developer he
told me to try to sepearte the program into layers (presentation,
business, data access). I know how to create the presenation, but I am
getting stuck how to set up the other two layers.

Maybe I can give you an example of what I am trying to do and someone
out there can tell me how I could set up this. I have the following
tables in a database:

Customers
CustomerTypes
Contacts
ContactTypes
TechTickets
TechTicketTypes
TechAgents
TechAgentTypes

In the past applications I've created a class that would query the
database and query it to retreive a list of Customers, open Tech
Tickets, List of Tech Agents, and list of Contacts. This is all that I
have done to work with the data in the database.

Things I'd like to do is to be able to create new Customers, Contacts,
TechTickets, etc. in the Database. In addition I'd want to search for
and edit the entities referenced above.

Can anyone give me an idea as to how you would try to what I am trying
to do. Maybe there are some web sites out there with an example that I
can use as a template on how to go about doing this? Any information
that you can provide will be greatly appreciated!

Thanks,

Ed_P.

Nov 16 '05 #2

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

Similar topics

145
by: Mark Johnson | last post by:
Oddly enough, I found it difficult, using Google, to find a list of best-of sites based on the quality of their css packages. So I'd ask. Does anyone know of particularly good sites which are in...
3
by: Joris Dobbelsteen | last post by:
Dear, I have some considerations I need to take designing a distributed application (it's for a school project). Basically I'm looking for some reference or guidiance material/literature and...
3
by: Joris Dobbelsteen | last post by:
Dear, I have some considerations I need to take designing a distributed application (it's for a school project). Basically I'm looking for some reference or guidiance material/literature and...
4
by: Chris | last post by:
Hi All, I'm looking for C# application design standards in Visual studio 2005( controls & variables naming conventionas, security designs standards and application designs) Thanks in advance,...
0
by: service0073 | last post by:
Designs For Fine Jewelry Pieces Fine jewelry is created from the finest precious metals and the gems that are set in these metals could be what makes the jewelry so fine. Jewelry lovers can wear...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.