Click here to Skip to main content
15,886,104 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
GeneralRe: Architecture 101.... Pin
led mike11-Mar-08 7:42
led mike11-Mar-08 7:42 
GeneralRe: Architecture 101.... Pin
daniel.byrne11-Mar-08 7:48
daniel.byrne11-Mar-08 7:48 
GeneralRe: Architecture 101.... Pin
led mike11-Mar-08 7:58
led mike11-Mar-08 7:58 
GeneralRe: Architecture 101.... Pin
daniel.byrne11-Mar-08 8:06
daniel.byrne11-Mar-08 8:06 
GeneralRe: Architecture 101.... Pin
Scott Dorman11-Mar-08 8:20
professionalScott Dorman11-Mar-08 8:20 
GeneralRe: Architecture 101.... Pin
led mike11-Mar-08 8:56
led mike11-Mar-08 8:56 
RantRe: Architecture 101.... Pin
jtvberg11-Apr-08 10:11
jtvberg11-Apr-08 10:11 
GeneralRe: Architecture 101.... Pin
Pete O'Hanlon11-Mar-08 11:17
mvePete O'Hanlon11-Mar-08 11:17 
daniel.byrne wrote:
I have been thinking for a while that this is a bad design (should you get the data before
you create the instance of the class and pass this to the constructor?)
and if this is the case, wouldn't you just be moving the SQL into the UI or the calling method...


The whole point of a DAL is to abstract the "messy" part of retrieving data away from the UI which should neither care nor know how the data was retrieved or stored in the first place. That's not the job of the UI. The DAL is the place to manage the whole CRUD operations.

A common technique for data access is to provide a static Fill method that returns you an instantiated version of your model. This method could (for instance) use a DataRow to populate it's own information, so you'd have a controller class which retrieved a set of data (in the form of a DataReader) and then populate a collection of your model simply by "Filling" each item in the collection. BTW - there are some excellent code generators that automate the tedious process of getting the data out of the database and into your model.


Deja View - the feeling that you've seen this post before.

My blog | My articles



GeneralClass Design Help Pin
mark_w_4-Mar-08 22:27
mark_w_4-Mar-08 22:27 
GeneralRe: Class Design Help Pin
Steven Campbell5-Mar-08 10:31
Steven Campbell5-Mar-08 10:31 
GeneralRe: Class Design Help Pin
mark_w_5-Mar-08 22:36
mark_w_5-Mar-08 22:36 
QuestionGenral architecture question. Pin
joysnlove3-Mar-08 14:06
joysnlove3-Mar-08 14:06 
GeneralRe: Genral architecture question. [modified] Pin
mark_w_4-Mar-08 22:36
mark_w_4-Mar-08 22:36 
GeneralRe: Genral architecture question. Pin
Pete O'Hanlon5-Mar-08 1:04
mvePete O'Hanlon5-Mar-08 1:04 
GeneralManaging Application ImageLists Pin
Tristan Rhodes3-Mar-08 2:05
Tristan Rhodes3-Mar-08 2:05 
GeneralRe: Managing Application ImageLists Pin
Pete O'Hanlon3-Mar-08 3:44
mvePete O'Hanlon3-Mar-08 3:44 
GeneralRe: Managing Application ImageLists Pin
Tristan Rhodes3-Mar-08 4:25
Tristan Rhodes3-Mar-08 4:25 
GeneralRe: Managing Application ImageLists Pin
Pete O'Hanlon3-Mar-08 4:51
mvePete O'Hanlon3-Mar-08 4:51 
GeneralClient / Server Design Pin
Member 368144327-Feb-08 23:34
Member 368144327-Feb-08 23:34 
GeneralRe: Client / Server Design Pin
Pete O'Hanlon28-Feb-08 4:48
mvePete O'Hanlon28-Feb-08 4:48 
GeneralRe: Client / Server Design Pin
led mike28-Feb-08 5:15
led mike28-Feb-08 5:15 
GeneralRe: Client / Server Design Pin
Paul Conrad29-Feb-08 7:33
professionalPaul Conrad29-Feb-08 7:33 
AnswerRe: Client / Server Design Pin
Steven Campbell5-Mar-08 10:10
Steven Campbell5-Mar-08 10:10 
GeneralObject level isolation than locking Pin
sreejith ss nair26-Feb-08 21:07
sreejith ss nair26-Feb-08 21:07 
GeneralRe: Object level isolation than locking Pin
Pete O'Hanlon26-Feb-08 22:42
mvePete O'Hanlon26-Feb-08 22:42 

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.