Click here to Skip to main content
15,890,438 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
GeneralRe: Base class method access VS. abstract class Method access Pin
netfed12-Jan-14 0:51
netfed12-Jan-14 0:51 
GeneralRe: Base class method access VS. abstract class Method access Pin
Ron Beyer12-Jan-14 4:33
professionalRon Beyer12-Jan-14 4:33 
GeneralRe: Base class method access VS. abstract class Method access Pin
netfed12-Jan-14 6:17
netfed12-Jan-14 6:17 
GeneralRe: Base class method access VS. abstract class Method access Pin
Ron Beyer12-Jan-14 6:40
professionalRon Beyer12-Jan-14 6:40 
GeneralRe: Base class method access VS. abstract class Method access Pin
Shameel12-Jan-14 4:54
professionalShameel12-Jan-14 4:54 
AnswerRe: Base class method access VS. abstract class Method access Pin
Keld Ølykke9-Jan-14 14:33
Keld Ølykke9-Jan-14 14:33 
GeneralRe: Base class method access VS. abstract class Method access Pin
netfed12-Jan-14 1:16
netfed12-Jan-14 1:16 
GeneralRe: Base class method access VS. abstract class Method access Pin
Keld Ølykke12-Jan-14 8:06
Keld Ølykke12-Jan-14 8:06 
Hi,

You are welcome. Maybe you should post the runnable code, if you think it will help people.


"but what do you mean by the following:

- (derived class) always call base in overriden virtual method/property?"

Inheritance in OOP is relatively loose. The only thing you can be certain about is that constructors are chained e.g. new Y() will call the constructor of Y that as its first statement will call the constructor of A, etc.... all the way up til the contructor of Object. You can then have your constructor code in different implementation called on the way back from Object.

For all other methods/properties no such guarantee exists. In other words it is optional to call a base-method, which makes it pretty hard to manage private fields in the base class Smile | :)
So these 2 go together:
-----------------
- (abstract class) always expect virtual methods/properties to be called by derived classes
- (derived class) always call base in overriden virtual method/property
-----------------
It is just 2 calling convention rules that mimic the constructor chaining for all virtual methods. In this way we can design interdependency between A and X - even though the language supports that you can avoid calling base methods/properties.

I hope it makes sense... otherwise I can elaborate.

Thx for the nice link, btw.

Kind Regards,
Keld Ølykke
QuestionImplementation of Loose Coupling Pattern Pin
User 905247816-Dec-13 14:41
User 905247816-Dec-13 14:41 
AnswerRe: Implementation of Loose Coupling Pattern Pin
Antonio Ripa27-Dec-13 2:25
professionalAntonio Ripa27-Dec-13 2:25 
GeneralRe: Implementation of Loose Coupling Pattern Pin
jschell27-Dec-13 12:57
jschell27-Dec-13 12:57 
GeneralRe: Implementation of Loose Coupling Pattern Pin
Kornfeld Eliyahu Peter4-Jan-14 23:13
professionalKornfeld Eliyahu Peter4-Jan-14 23:13 
AnswerRe: Implementation of Loose Coupling Pattern Pin
Keld Ølykke1-Jan-14 10:02
Keld Ølykke1-Jan-14 10:02 
QuestionWhich is better architecture, also for security reasons Pin
nstk29-Nov-13 5:33
nstk29-Nov-13 5:33 
AnswerRe: Which is better architecture, also for security reasons Pin
Mycroft Holmes29-Nov-13 12:45
professionalMycroft Holmes29-Nov-13 12:45 
AnswerRe: Which is better architecture, also for security reasons Pin
jschell2-Dec-13 10:11
jschell2-Dec-13 10:11 
AnswerRe: Which is better architecture, also for security reasons Pin
Shameel6-Jan-14 4:02
professionalShameel6-Jan-14 4:02 
QuestionWeb browser issue Pin
iqtechways24-Nov-13 20:53
professionaliqtechways24-Nov-13 20:53 
AnswerRe: Web browser issue Pin
Pete O'Hanlon24-Nov-13 21:22
mvePete O'Hanlon24-Nov-13 21:22 
AnswerRe: Web browser issue Pin
Vishal Pand3y27-Nov-13 0:39
Vishal Pand3y27-Nov-13 0:39 
Questionfirst step of my project Pin
srinivas ruttala7-Nov-13 22:50
srinivas ruttala7-Nov-13 22:50 
AnswerRe: first step of my project PinPopular
Simon_Whale7-Nov-13 23:52
Simon_Whale7-Nov-13 23:52 
GeneralRe: first step of my project Pin
WuRunZhe22-Nov-13 16:25
WuRunZhe22-Nov-13 16:25 
AnswerRe: first step of my project Pin
jschell8-Nov-13 9:15
jschell8-Nov-13 9:15 
GeneralRe: first step of my project Pin
Albert Holguin15-Nov-13 5:25
professionalAlbert Holguin15-Nov-13 5:25 

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.