Click here to Skip to main content
15,887,027 members
Home / Discussions / C#
   

C#

 
GeneralRe: Architectural question (crisis) Pin
Anonymous29-Apr-04 23:06
Anonymous29-Apr-04 23:06 
GeneralRe: Architectural question (crisis) Pin
Jan Vercauteren30-Apr-04 0:37
Jan Vercauteren30-Apr-04 0:37 
GeneralRe: Architectural question (crisis) Pin
bjoernen30-Apr-04 1:54
bjoernen30-Apr-04 1:54 
GeneralRe: Architectural question (crisis) Pin
Jan Vercauteren30-Apr-04 2:46
Jan Vercauteren30-Apr-04 2:46 
GeneralRe: Architectural question (crisis) Pin
Heath Stewart30-Apr-04 4:05
protectorHeath Stewart30-Apr-04 4:05 
GeneralRe: Architectural question (crisis) Pin
Jan Vercauteren30-Apr-04 4:55
Jan Vercauteren30-Apr-04 4:55 
GeneralRe: Architectural question (crisis) Pin
Heath Stewart30-Apr-04 5:10
protectorHeath Stewart30-Apr-04 5:10 
GeneralRe: Architectural question (crisis) Pin
bjoernen30-Apr-04 11:51
bjoernen30-Apr-04 11:51 
I'm sure there are many ways to solve this, and much has to do with taste.

For most applications I prefer a 3-tier solution: data, business and facade/presentation, but that is of course depending a lot on the scenario.

The data tier consists of two kinds of classes, none of them static:

1. The objects in the object model (usually maps to tables in a relational database). Those are very much like structures, with no logic in them, just data fields for transport. For example the Customer class. Take a look at xsd.exe to generate those out of schemas.

2. Factory/accessor classes that creates and delivers object model instances, or recieves object model instances. For example CustomerFactory (or CustomerDB if you don't like the "concrete factory" pattern analogy). Those classes contain logic for retrieving data and updating data. If the data resides in SQL server they handle connection objects and have all the insert, update and select in them (or SP's handle that). If the data comes from a web service, they contain web service consumer proxies etc.

Example of methods:
public Customer FindByCustomerID(int id)
public OperationResult Save(Customer[] customers)

I think the most important design decision for you to consider is that the data-tier should not be aware of the other tiers, and it shall reveal nothing about the actual data sources to the other tiers. It delivers the data to whoever needs it, period. Much more can be said about the details, and many books have been written on the subject. Good luck with your project.


Regards,
Björn Morén
Stockholm, Sweden

GeneralRe: Architectural question (crisis) Pin
Jan Vercauteren30-Apr-04 13:07
Jan Vercauteren30-Apr-04 13:07 
GeneralStupid string to int question Pin
Anonymous29-Apr-04 20:53
Anonymous29-Apr-04 20:53 
GeneralRe: Stupid string to int question Pin
Anonymous29-Apr-04 21:05
Anonymous29-Apr-04 21:05 
GeneralRe: Stupid string to int question Pin
Heath Stewart30-Apr-04 3:29
protectorHeath Stewart30-Apr-04 3:29 
GeneralRe: Stupid string to int question Pin
medcon29-Apr-04 22:41
medcon29-Apr-04 22:41 
GeneralCrystal Report fields Pin
DougW4829-Apr-04 20:01
DougW4829-Apr-04 20:01 
GeneralRe: Crystal Report fields Pin
..Hubert..29-Apr-04 22:55
..Hubert..29-Apr-04 22:55 
GeneralRe: Crystal Report fields Pin
hassan azizi1-May-04 7:51
hassan azizi1-May-04 7:51 
GeneralWeb request from Windows Forms user control Pin
Shree29-Apr-04 17:32
Shree29-Apr-04 17:32 
GeneralRe: Web request from Windows Forms user control Pin
Heath Stewart30-Apr-04 3:28
protectorHeath Stewart30-Apr-04 3:28 
Generalip address Pin
kendao29-Apr-04 15:37
kendao29-Apr-04 15:37 
GeneralRe: ip address Pin
Corinna John29-Apr-04 22:31
Corinna John29-Apr-04 22:31 
GeneralTo handle list view column width change Pin
machocr29-Apr-04 14:09
machocr29-Apr-04 14:09 
GeneralRe: To handle list view column width change Pin
Heath Stewart29-Apr-04 14:30
protectorHeath Stewart29-Apr-04 14:30 
GeneralRe: To handle list view column width change Pin
machocr29-Apr-04 14:51
machocr29-Apr-04 14:51 
GeneralRe: To handle list view column width change Pin
machocr29-Apr-04 15:08
machocr29-Apr-04 15:08 
GeneralRe: To handle list view column width change Pin
Heath Stewart30-Apr-04 3:23
protectorHeath Stewart30-Apr-04 3:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.