Click here to Skip to main content
15,891,943 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
AnswerRe: Help: Which design method should I use for this particular case? Pin
RobCroll4-Jan-11 3:52
RobCroll4-Jan-11 3:52 
QuestionSome thoughts about virtual methods [modified] Pin
bleedingfingers22-Dec-10 22:46
bleedingfingers22-Dec-10 22:46 
AnswerRe: Some thoughts about virtual methods Pin
Luc Pattyn23-Dec-10 1:11
sitebuilderLuc Pattyn23-Dec-10 1:11 
GeneralRe: Some thoughts about virtual methods Pin
Xpnctoc30-Dec-10 17:31
Xpnctoc30-Dec-10 17:31 
GeneralRe: Some thoughts about virtual methods Pin
Bernhard Hiller30-Dec-10 20:13
Bernhard Hiller30-Dec-10 20:13 
AnswerRe: Some thoughts about virtual methods Pin
Pete O'Hanlon23-Dec-10 1:54
mvePete O'Hanlon23-Dec-10 1:54 
AnswerRe: Some thoughts about virtual methods Pin
Paul Michalik7-Jan-11 1:55
Paul Michalik7-Jan-11 1:55 
AnswerRe: Some thoughts about virtual methods Pin
dasblinkenlight13-Jan-11 4:51
dasblinkenlight13-Jan-11 4:51 
From a perfectionists' point of view, having job callers deal with sequences of calls violates encapsulation: job callers do not need to know that a job requires a "setup" and a "cleanup" steps.

To hide the internals from your callers while keeping the distinction in your implementations, make an abstract class with a skeleton method, then override pre/post/job methods as needed in your derived classes. This technique is commonly known as the "Template Method" pattern[^]; I prefer "skeleton" to avoid confusion with C++ templates.
C++
AbstractClass::Job()
{
    doPreJob();
    doJob();
    doPostJob();
}

DerivedClass::doPreJob() {}

DerivedClass::doJob() {}

DerivedClass::doPostJob() {}

JobCaller()
{
    pAbstractClass -> Job();
}

QuestionEstimation of server for launching a site Pin
nainakarri16-Dec-10 22:26
nainakarri16-Dec-10 22:26 
AnswerRe: Estimation of server for launching a site Pin
Richard MacCutchan16-Dec-10 22:57
mveRichard MacCutchan16-Dec-10 22:57 
GeneralRe: Estimation of server for launching a site Pin
nainakarri17-Dec-10 0:01
nainakarri17-Dec-10 0:01 
GeneralRe: Estimation of server for launching a site Pin
Richard MacCutchan17-Dec-10 1:21
mveRichard MacCutchan17-Dec-10 1:21 
AnswerRe: Estimation of server for launching a site Pin
Luc Pattyn17-Dec-10 1:33
sitebuilderLuc Pattyn17-Dec-10 1:33 
QuestionGuidance on solution and project structure. Pin
Brady Kelly9-Dec-10 19:24
Brady Kelly9-Dec-10 19:24 
AnswerRe: Guidance on solution and project structure. Pin
Luc Pattyn9-Dec-10 22:50
sitebuilderLuc Pattyn9-Dec-10 22:50 
GeneralRe: Guidance on solution and project structure. Pin
Brady Kelly10-Dec-10 8:20
Brady Kelly10-Dec-10 8:20 
GeneralRe: Guidance on solution and project structure. Pin
Luc Pattyn10-Dec-10 9:15
sitebuilderLuc Pattyn10-Dec-10 9:15 
GeneralRe: Guidance on solution and project structure. Pin
RobCroll26-Dec-10 3:13
RobCroll26-Dec-10 3:13 
AnswerRe: Guidance on solution and project structure. Pin
RobCroll26-Dec-10 3:34
RobCroll26-Dec-10 3:34 
AnswerRe: Guidance on solution and project structure. Pin
Bernhard Hiller30-Dec-10 20:24
Bernhard Hiller30-Dec-10 20:24 
QuestionDevelopment Methodology Pin
Civic067-Dec-10 5:06
Civic067-Dec-10 5:06 
AnswerRe: Development Methodology Pin
Richard MacCutchan10-Dec-10 2:59
mveRichard MacCutchan10-Dec-10 2:59 
AnswerRe: Development Methodology Pin
T M Gray10-Dec-10 10:17
T M Gray10-Dec-10 10:17 
RantRe: Development Methodology Pin
RobCroll26-Dec-10 3:08
RobCroll26-Dec-10 3:08 
QuestionWhy use Visual Studio? Pin
Gjm7-Dec-10 2:07
Gjm7-Dec-10 2:07 

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.