Click here to Skip to main content
15,898,588 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
AnswerRe: TDD, Mocks, and Isolating Legacy Application Components? Pin
Mark Churchill13-Dec-08 2:35
Mark Churchill13-Dec-08 2:35 
GeneralRe: TDD, Mocks, and Isolating Legacy Application Components? Pin
Philip Laureano13-Dec-08 3:24
Philip Laureano13-Dec-08 3:24 
GeneralRe: TDD, Mocks, and Isolating Legacy Application Components? Pin
Pete O'Hanlon16-Dec-08 10:07
mvePete O'Hanlon16-Dec-08 10:07 
GeneralRe: TDD, Mocks, and Isolating Legacy Application Components? Pin
Philip Laureano16-Dec-08 13:48
Philip Laureano16-Dec-08 13:48 
AnswerRe: TDD, Mocks, and Isolating Legacy Application Components? Pin
Jon Rista6-Jan-09 6:37
Jon Rista6-Jan-09 6:37 
GeneralRe: TDD, Mocks, and Isolating Legacy Application Components? Pin
Pete O'Hanlon6-Jan-09 8:28
mvePete O'Hanlon6-Jan-09 8:28 
GeneralRe: TDD, Mocks, and Isolating Legacy Application Components? Pin
Jon Rista6-Jan-09 9:11
Jon Rista6-Jan-09 9:11 
QuestionHow this can be done in Atomic way? Pin
paresh_joe8-Dec-08 19:27
paresh_joe8-Dec-08 19:27 
Class A
{
B bsObject;

public void FunctionOfClassA()
{
bsObject.FunctionOfClassB()
}
}

Class B
{
public void FunctionOfClassB()
{
}
}

I have my program structure as shown above.
I want a way to apply atomicity to this. I mean if Class B's data write worked fine but Class A's calculations failed then want to rollback the data write. i want it all succeed or rollback.

One way i can think of is to create a DB ptr and begin transaction just before call to FunctionOfClassB() and pass it as a parameter. so in this FunctionOfClassB will use same db ptr to write data. And it would also be possible in FunctionOfClassA() to check if calculations went ok then commit or rollback.

My requirement is to not to make any change in parameter list or not to provide a new method with new parameter.

Class A
{
B bsObject;

public void FunctionOfClassA()
{
bsObject.FunctionOfClassB()
// some calculations
// Here I want to decide whether to commit or rollback
}
}

Class B
{
public void FunctionOfClassB()
{
// here i want to begin a transaction
// some data writing.
}
}

Can anyone give an high level summary how this could be possible?
GeneralRe: How this can be done in Atomic way? Pin
led mike9-Dec-08 4:30
led mike9-Dec-08 4:30 
AnswerRe: How this can be done in Atomic way? Pin
CodingYoshi10-Dec-08 3:44
CodingYoshi10-Dec-08 3:44 
GeneralRe: How this can be done in Atomic way? Pin
paresh_joe10-Dec-08 23:36
paresh_joe10-Dec-08 23:36 
GeneralRe: How this can be done in Atomic way? Pin
CodingYoshi11-Dec-08 3:34
CodingYoshi11-Dec-08 3:34 
AnswerRe: How this can be done in Atomic way? Pin
samdevloper8-Mar-09 19:18
samdevloper8-Mar-09 19:18 
GeneralRe: How this can be done in Atomic way? Pin
CodingYoshi11-Mar-09 18:27
CodingYoshi11-Mar-09 18:27 
GeneralRe: How this can be done in Atomic way? Pin
samdevloper5-Mar-09 2:50
samdevloper5-Mar-09 2:50 
AnswerRe: How this can be done in Atomic way? Pin
samdevloper9-Mar-09 2:37
samdevloper9-Mar-09 2:37 
AnswerRe: How this can be done in Atomic way? Pin
samdevloper9-Mar-09 2:38
samdevloper9-Mar-09 2:38 
GeneralRe: How this can be done in Atomic way? Pin
samdevloper5-Mar-09 2:48
samdevloper5-Mar-09 2:48 
QuestionInterprocess communication Pin
carlop()3-Dec-08 22:07
carlop()3-Dec-08 22:07 
AnswerRe: Interprocess communication Pin
Eddy Vluggen16-Dec-08 22:22
professionalEddy Vluggen16-Dec-08 22:22 
QuestionAssertion vs. Exception Pin
CodingYoshi3-Dec-08 11:32
CodingYoshi3-Dec-08 11:32 
AnswerRe: Assertion vs. Exception Pin
Mark Churchill3-Dec-08 14:14
Mark Churchill3-Dec-08 14:14 
GeneralRe: Assertion vs. Exception Pin
CodingYoshi3-Dec-08 17:35
CodingYoshi3-Dec-08 17:35 
GeneralRe: Assertion vs. Exception Pin
Mark Churchill3-Dec-08 18:13
Mark Churchill3-Dec-08 18:13 
QuestionApplications, patterns and technikes based on behavior analysis. Pin
Ahmed Charfeddine3-Dec-08 0:10
Ahmed Charfeddine3-Dec-08 0:10 

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.