Method Design Architecture guidance needed...
From: Tim Smith (timasmith_at_hotmail.com)
Date: 08/26/04
- Next message: Universe: "Re: Virtual Functions in OO Analysis"
- Previous message: Universe: "Re: What is the Definition of Type"
- Next in thread: Dave Benjamin: "Re: Method Design Architecture guidance needed..."
- Reply: Dave Benjamin: "Re: Method Design Architecture guidance needed..."
- Reply: Cristiano Sadun: "Re: Method Design Architecture guidance needed..."
- Reply: H. S. Lahman: "Re: Method Design Architecture guidance needed..."
- Reply: Universe: "Re: Method Design Architecture guidance needed..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 25 Aug 2004 18:15:00 -0700
I have 20-50 methods (C# or Java) with the following identical content
which I wish to write only once!
public SomeObjOrVoid MethodDiffSigEachTime(SomeParams p) {
ResouceObj resObj = null;
ResourceTrans resTran = null;
SomeObjOrVoid returnVal = null;
try {
resObj = GetResource();
resTran = resObj.StartTrans();
// METHOD SPECIFIC CODE GOES HERE
} catch (Exception e) {
LogError(e);
} finally {
resObj.Close();
resTran.Close();
}
return returnVal;
}
I tried to use reflection, which works but loses on performance and
exceptions lose a lot of information.
There must some way to design around duplicating so much code for this
service orientated architecture...
- Next message: Universe: "Re: Virtual Functions in OO Analysis"
- Previous message: Universe: "Re: What is the Definition of Type"
- Next in thread: Dave Benjamin: "Re: Method Design Architecture guidance needed..."
- Reply: Dave Benjamin: "Re: Method Design Architecture guidance needed..."
- Reply: Cristiano Sadun: "Re: Method Design Architecture guidance needed..."
- Reply: H. S. Lahman: "Re: Method Design Architecture guidance needed..."
- Reply: Universe: "Re: Method Design Architecture guidance needed..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|