Click here to Skip to main content
15,899,754 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
GeneralRe: Developing to try to make a difference? Pin
RobCroll4-Jan-11 7:29
RobCroll4-Jan-11 7:29 
GeneralRe: Developing to try to make a difference? Pin
Mycroft Holmes13-Jan-11 12:16
professionalMycroft Holmes13-Jan-11 12:16 
GeneralRe: Developing to try to make a difference? Pin
Todd Baxter17-Jan-11 2:37
Todd Baxter17-Jan-11 2:37 
GeneralRe: Developing to try to make a difference? Pin
Todd Baxter17-Jan-11 4:08
Todd Baxter17-Jan-11 4:08 
QuestionHelp: Which design method should I use for this particular case? Pin
xyzsnl27-Dec-10 2:44
xyzsnl27-Dec-10 2:44 
AnswerRe: Help: Which design method should I use for this particular case? Pin
Eddy Vluggen28-Dec-10 7:42
professionalEddy Vluggen28-Dec-10 7:42 
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 
I have this situation and I want to know the opinions of other members on this. My language is C++.

There is a base class that has the most vital virtual function called Job. Within the derived classes, there are several possibilities of things to be done before Job and/or after it. The Job would have to be done for about a hundred times* (The design has no problem, so if this sounds absurd it is only because I am not providing the exact details of the class). Also, this is supposed to run on multiple platforms, including .NET, mobile etc and not just native code on big fast CPUs. The core that contains this will remain in C++ and the necessary wrapping etc will be done to get it to run on the said platforms.

In this scenario, considering speed and other things, which would be a better solution?

1. Have just the Job function and let the derived class do something like this
DerivedClass::Job()
{
// pre operations
// Base::Job() or the override
// post operations
}


2. Have three virtual functions, PreJob, Job, PostJob and have the call to Job be bracketed like the following so that the code is neatly segregated

JobCaller()
{
pBaseClass->PreJob()
pBaseClass->Job()
pBaseClass->PostJob()
}


EDIT: *about hundred for user interaction events like mouse clicks, screen taps etc depending on the platform. Basically, the user may "test" the load by playing with it.
...byte till it megahertz...

my donation to web rubbish

modified on Thursday, December 23, 2010 8:02 AM

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 
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 

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.