Click here to Skip to main content
15,905,144 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
George_George wrote:
A small confusion. I think whether or not making a method virtual is dependent on whether derived class needs to override it, and has nothing to do with whether the method is big or small.

Well this is true. Neverthless whenever we're talking about little pieces of common code, IMHO we have two points to consider:
(1) such methods have little functionality, i.e. if you don't need it you can replace the call with few lines of code.
(2) such methods are shared by a relevant number of other methods, i.e. you can find calls to such methods here and there.

From this viewpoint, IMHO, the design is cleaner if such pieces of code remains unchanged.

But, I know, at the end, it is matter of taste.


George_George wrote:
Why do you making decision whether a method is virtual or not also based on whether the method is big or small? what is your trade-off?


No. I make my decision based on the overall structure of the project and provided the points (1) and (2) hold for such 'helper' methods.
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 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 
GeneralIs it not safe to use RectF::Equals? (float comparison problem) [modified] Pin
followait18-Mar-08 19:10
followait18-Mar-08 19:10 
GeneralRe: Is it not safe to use RectF::Equals? (float comparison problem) Pin
Mark Salsbery18-Mar-08 20:05
Mark Salsbery18-Mar-08 20:05 
Questionnot installaing visual studio .Net 2003 in vista? Pin
rowdy_vc++18-Mar-08 18:55
rowdy_vc++18-Mar-08 18:55 
AnswerRe: not installaing visual studio .Net 2003 in vista? Pin
Naveen18-Mar-08 19:18
Naveen18-Mar-08 19:18 
AnswerRe: not installaing visual studio .Net 2003 in vista? Pin
Rajesh R Subramanian18-Mar-08 22:05
professionalRajesh R Subramanian18-Mar-08 22:05 
AnswerRe: not installaing visual studio .Net 2003 in vista? Pin
David Crow19-Mar-08 4:23
David Crow19-Mar-08 4:23 
GeneralStructure array initialization error Pin
LiYS18-Mar-08 18:53
LiYS18-Mar-08 18:53 
GeneralRe: Structure array initialization error Pin
Naveen18-Mar-08 19:08
Naveen18-Mar-08 19:08 

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.