Click here to Skip to main content
15,877,574 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
GeneralRe: Wow, what ever Pin
Paul Conrad1-Dec-08 8:04
professionalPaul Conrad1-Dec-08 8:04 
AnswerRe: Releasing .Net programs Pin
Paul Conrad1-Dec-08 6:03
professionalPaul Conrad1-Dec-08 6:03 
QuestionDatabase transaction boundaries in three tier Pin
AliasElias27-Nov-08 2:32
AliasElias27-Nov-08 2:32 
AnswerRe: Database transaction boundaries in three tier Pin
Joe DiNatale1-Dec-08 5:58
Joe DiNatale1-Dec-08 5:58 
GeneralRe: Database transaction boundaries in three tier Pin
AliasElias2-Dec-08 1:47
AliasElias2-Dec-08 1:47 
AnswerRe: Database transaction boundaries in three tier Pin
CodingYoshi3-Dec-08 18:28
CodingYoshi3-Dec-08 18:28 
GeneralRe: Database transaction boundaries in three tier Pin
AliasElias3-Dec-08 21:37
AliasElias3-Dec-08 21:37 
GeneralRe: Database transaction boundaries in three tier Pin
CodingYoshi4-Dec-08 4:17
CodingYoshi4-Dec-08 4:17 
Here is what I would do in such a case:

Person class will have a method called Save(). When this method is called it will call the DAL's Save method and pass itself in. DAL will ask the person if it should be inserted or updated--no need to create separate methods for update and insert but you can. If it is to be inserted then DAL should call its own private method and insert the person and do the same if update.

For multiple persons, I would create a PersonCollection class and when Save() is called it will call the PersonCollectionDAL and pass itself in. The PersonCollectionDAL can either ask each person to Save() and pass a transaction over to it. Make this Save() method internal so it is only accessible from DAL Layer not UI Layer. Alternatively, the PersonCollectionDAL can throw all the persons in a DataTable and ask a dataAdapter to insert them. There is no right and wrong way, it is about software craftsmanship.

If you are worried about reusing the insert methods code you mentioned above, then simply make the code a private method and the two public methods (Single and Transactional) can both use it.

Obviously, this is just a suggestion and when you start your implementation you will have other obstacles to overcome.

Finally, although transactions can be used to speed things up for multiple inserts, yet I do not like using them because if one person is not inserted then why should the other ones roll back. Transactions are supposed to be for steps which depend on each other and either all pass or all fail. It is pretty obvious that is not the case here.
AnswerRe: Database transaction boundaries in three tier Pin
Hesham Amin9-Dec-08 7:38
Hesham Amin9-Dec-08 7:38 
QuestionImplementing SOA in .Netframework Pin
Muneeb R. Baig25-Nov-08 22:22
Muneeb R. Baig25-Nov-08 22:22 
AnswerRe: Implementing SOA in .Netframework Pin
Rob Graham17-Dec-08 4:29
Rob Graham17-Dec-08 4:29 
QuestionWaterfall vs Agile and Project Estimates Pin
emunews25-Nov-08 9:21
emunews25-Nov-08 9:21 
AnswerRe: Waterfall vs Agile and Project Estimates Pin
Pete O'Hanlon25-Nov-08 9:58
mvePete O'Hanlon25-Nov-08 9:58 
GeneralRe: Waterfall vs Agile and Project Estimates Pin
emunews25-Nov-08 10:00
emunews25-Nov-08 10:00 
GeneralRe: Waterfall vs Agile and Project Estimates Pin
led mike25-Nov-08 11:55
led mike25-Nov-08 11:55 
GeneralRe: Waterfall vs Agile and Project Estimates Pin
Pete O'Hanlon25-Nov-08 12:02
mvePete O'Hanlon25-Nov-08 12:02 
GeneralRe: Waterfall vs Agile and Project Estimates Pin
emunews1-Dec-08 2:57
emunews1-Dec-08 2:57 
GeneralRe: Waterfall vs Agile and Project Estimates Pin
Pete O'Hanlon1-Dec-08 3:18
mvePete O'Hanlon1-Dec-08 3:18 
GeneralRe: Waterfall vs Agile and Project Estimates Pin
emunews1-Dec-08 3:22
emunews1-Dec-08 3:22 
GeneralRe: Waterfall vs Agile and Project Estimates Pin
Pete O'Hanlon1-Dec-08 3:34
mvePete O'Hanlon1-Dec-08 3:34 
AnswerRe: Waterfall vs Agile and Project Estimates Pin
PH-MAT1-Dec-08 19:25
PH-MAT1-Dec-08 19:25 
AnswerRe: Waterfall vs Agile and Project Estimates [modified] Pin
Member 36807854-Dec-08 10:50
Member 36807854-Dec-08 10:50 
QuestionCode portability - .NET/Unix Pin
vsyam19-Nov-08 6:44
vsyam19-Nov-08 6:44 
AnswerRe: Code portability - .NET/Unix Pin
Wendelius19-Nov-08 8:06
mentorWendelius19-Nov-08 8:06 
GeneralRe: Code portability - .NET/Unix Pin
led mike19-Nov-08 8:17
led mike19-Nov-08 8:17 

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.