Click here to Skip to main content
15,884,629 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
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 
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 
I agree with Luc on performance issues, but I disagree when he say that the added structure would not be beneficial. If your core Job function cannot stand on its own (i.e., requires pre- and post- function, regardless of how different those functions may be from derived class to derived class), then I personally would absolutely declare the Pre- and Post- as "abstract" methods to ensure that every new derived class you create implements Pre- and Post-. This is exactly why "abstract" declarations were invented. You could then invoke Pre- and Post- from Base::Job and not have to implement a Derived::Job method at all. Like this (I apologize if my syntax isn't perfect. Been doing a lot of C++/CLI, so I might not be completely right in native C++ syntax):

class Base
{
public:
   virtual void Job()
   {
      Pre();
      // actual job code here
      Post();
   }
protected:
   virtual void Pre() abstract;
   virtual void Post() abstract;
}

class Derived : public Base
{
protected:
   virtual void Pre() override
   {
      //derived-specific pre-job code here
   }

   virtual void Post() override
   {
      //derived-specific post-job code here
   }
}

// Calling Code:
Derived* myDerived = new Derived();
myDerived->Job(); // invokes Job in base class, which in turn invokes Pre/Post in derived class.

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

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.