Click here to Skip to main content
15,902,938 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralELF parser Pin
Ravinder Are18-Mar-08 19:52
Ravinder Are18-Mar-08 19:52 
GeneralRe: ELF parser Pin
CPallini18-Mar-08 22:57
mveCPallini18-Mar-08 22:57 
AnswerRe: ELF parser Pin
JudyL_MD19-Mar-08 2:45
JudyL_MD19-Mar-08 2:45 
QuestionHow do they do that? virutal lan Pin
NovaNuker18-Mar-08 19:34
NovaNuker18-Mar-08 19:34 
GeneralVirtual function design pattern Pin
George_George18-Mar-08 19:18
George_George18-Mar-08 19:18 
GeneralRe: Virtual function design pattern Pin
followait18-Mar-08 20:00
followait18-Mar-08 20:00 
GeneralRe: Virtual function design pattern Pin
George_George19-Mar-08 0:00
George_George19-Mar-08 0:00 
GeneralRe: Virtual function design pattern Pin
CPallini19-Mar-08 0:54
mveCPallini19-Mar-08 0:54 
Yes. They represent (in class hierarchy designer mind) simple unit of common behaviour, for instance:
class Base
{
//...
public:
virtual void do_things();
protected:
void do_common1();
void do_common2();
bool test_common();
};

class Derived: public Base
{
public:
virtual void do_things();
//...
};

Base::do_things()
{
//...
}

Derived::do_things()
{
  do_something_specific();
  do_common1();
  do_something_else_specific();
  if ( test_common() )
  {
   do_common2();
  }
  else
  {
   do_something_specific3();
  }
  //...
}


If Derived class designer doesn't like do_common1 behaviour, he (or she) can replace it with another piece of code, specific of do_things implementation of Derived class. This help to keep the overall project architecture cleaner, because common behaviours remain unchanged through class hierachy, while changes happen inside methods deliberately designed for the purpose. Roughly speaking it is a granularity problem: keep little common behaviours invariant.

Smile | :)

If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.

This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke


GeneralRe: Virtual function design pattern Pin
George_George19-Mar-08 1:14
George_George19-Mar-08 1:14 
GeneralRe: Virtual function design pattern Pin
CPallini19-Mar-08 1:31
mveCPallini19-Mar-08 1:31 
GeneralRe: Virtual function design pattern Pin
George_George19-Mar-08 2:30
George_George19-Mar-08 2:30 
GeneralRe: Virtual function design pattern Pin
CPallini19-Mar-08 3:01
mveCPallini19-Mar-08 3:01 
GeneralRe: Virtual function design pattern Pin
George_George19-Mar-08 3:15
George_George19-Mar-08 3:15 
GeneralRe: Virtual function design pattern Pin
CPallini19-Mar-08 3:29
mveCPallini19-Mar-08 3:29 
GeneralRe: Virtual function design pattern Pin
George_George19-Mar-08 17:20
George_George19-Mar-08 17:20 
GeneralRe: Virtual function design pattern Pin
CPallini19-Mar-08 22:26
mveCPallini19-Mar-08 22:26 
GeneralRe: Virtual function design pattern Pin
George_George19-Mar-08 22:38
George_George19-Mar-08 22:38 
GeneralRe: Virtual function design pattern Pin
followait19-Mar-08 1:42
followait19-Mar-08 1:42 
GeneralRe: Virtual function design pattern Pin
George_George19-Mar-08 2:21
George_George19-Mar-08 2:21 
GeneralRe: Virtual function design pattern [modified] Pin
followait19-Mar-08 2:49
followait19-Mar-08 2:49 
GeneralRe: Virtual function design pattern Pin
George_George19-Mar-08 3:16
George_George19-Mar-08 3:16 
GeneralRe: Virtual function design pattern Pin
followait19-Mar-08 3:37
followait19-Mar-08 3:37 
GeneralRe: Virtual function design pattern Pin
George_George19-Mar-08 17:22
George_George19-Mar-08 17:22 
GeneralRe: Virtual function design pattern Pin
followait19-Mar-08 18:00
followait19-Mar-08 18:00 
GeneralRe: Virtual function design pattern Pin
George_George19-Mar-08 18:30
George_George19-Mar-08 18:30 

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.