Click here to Skip to main content
15,887,477 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
GeneralRe: 'Interface' Considered Harmful : Uncle Bob Pin
popchecker15-Jan-15 0:52
popchecker15-Jan-15 0:52 
GeneralRe: 'Interface' Considered Harmful : Uncle Bob Pin
Richard MacCutchan15-Jan-15 2:29
mveRichard MacCutchan15-Jan-15 2:29 
GeneralRe: 'Interface' Considered Harmful : Uncle Bob Pin
popchecker15-Jan-15 2:44
popchecker15-Jan-15 2:44 
GeneralRe: 'Interface' Considered Harmful : Uncle Bob Pin
Richard MacCutchan15-Jan-15 3:03
mveRichard MacCutchan15-Jan-15 3:03 
GeneralRe: 'Interface' Considered Harmful : Uncle Bob Pin
popchecker15-Jan-15 3:54
popchecker15-Jan-15 3:54 
GeneralRe: 'Interface' Considered Harmful : Uncle Bob Pin
Pete O'Hanlon15-Jan-15 5:35
mvePete O'Hanlon15-Jan-15 5:35 
GeneralRe: 'Interface' Considered Harmful : Uncle Bob Pin
popchecker15-Jan-15 17:08
popchecker15-Jan-15 17:08 
AnswerRe: 'Interface' Considered Harmful : Uncle Bob Pin
Keld Ølykke5-Mar-15 3:53
Keld Ølykke5-Mar-15 3:53 
Hi,

Thank you for the blog link.

You propose what is called mixin, which is really the go to solution to avoid bloated inheritance hierarchies.

The good thing about mixin of Subject is that you hide functionality and avoids to duplicate the code in Subject.
The bad thing is that you still need to duplicate the code that calls Subject aka relaying.
DI with mixin is also good since you make the dependency known to the outside. This opens up for implementation replacement from the outside and gives better transparency.

However, Uncle Bob really wants to hide stuff and use inheritance to avoid ANY code duplication and he can't do that in a single inheritance language.

I love interfaces because they form a specification layer without any implementation details. I love abstract classes because they can be implementation templates for concrete classes. I do not want to mix the 2 concerns - at all. And it IS a tad annoying when you need add mixin in you abstract classes to avoid code duplication.

I wouldn't mind multiple inheritance, if the language/compiler could manage diamonds in a consistent and obvious way (No, C++ doesn't). The class hierarchy is however implementation - not specification (IMHO). Uncle Bob doesn't address that view on the interface keyword.... and I am not sure the interface keyword had that view in mind when invented.
GeneralRe: 'Interface' Considered Harmful : Uncle Bob Pin
TheGreatAndPowerfulOz23-Jun-15 10:15
TheGreatAndPowerfulOz23-Jun-15 10:15 
GeneralRe: 'Interface' Considered Harmful : Uncle Bob Pin
Keld Ølykke23-Jun-15 13:52
Keld Ølykke23-Jun-15 13:52 
GeneralRe: 'Interface' Considered Harmful : Uncle Bob Pin
TheGreatAndPowerfulOz23-Jun-15 13:57
TheGreatAndPowerfulOz23-Jun-15 13:57 
GeneralRe: 'Interface' Considered Harmful : Uncle Bob Pin
Keld Ølykke23-Jun-15 14:07
Keld Ølykke23-Jun-15 14:07 
Suggestionlogical Pin
Member 113586967-Jan-15 22:42
Member 113586967-Jan-15 22:42 
GeneralRe: logical Pin
Richard MacCutchan7-Jan-15 22:53
mveRichard MacCutchan7-Jan-15 22:53 
QuestionSOLID Open/Close principles in Python Pin
Khamidulla6-Jan-15 3:14
Khamidulla6-Jan-15 3:14 
AnswerRe: SOLID Open/Close principles in Python Pin
Eddy Vluggen8-Jan-15 0:28
professionalEddy Vluggen8-Jan-15 0:28 
AnswerRe: SOLID Open/Close principles in Python Pin
Richard MacCutchan8-Jan-15 0:58
mveRichard MacCutchan8-Jan-15 0:58 
AnswerRe: SOLID Open/Close principles in Python Pin
Richard MacCutchan9-Jan-15 4:31
mveRichard MacCutchan9-Jan-15 4:31 
QuestionHow can i explain this to our programmers? Pin
Member 1133122523-Dec-14 5:10
Member 1133122523-Dec-14 5:10 
AnswerRe: How can i explain this to our programmers? Pin
Eddy Vluggen23-Dec-14 7:54
professionalEddy Vluggen23-Dec-14 7:54 
AnswerRe: How can i explain this to our programmers? Pin
Dominic Burford30-Dec-14 5:38
professionalDominic Burford30-Dec-14 5:38 
AnswerRe: How can i explain this to our programmers? Pin
jschell30-Dec-14 11:10
jschell30-Dec-14 11:10 
QuestionA good pattern for complex search criteria? Pin
Member 1132553220-Dec-14 14:05
Member 1132553220-Dec-14 14:05 
AnswerRe: A good pattern for complex search criteria? Pin
Garth J Lancaster20-Dec-14 14:28
professionalGarth J Lancaster20-Dec-14 14:28 
AnswerRe: A good pattern for complex search criteria? Pin
Eddy Vluggen23-Dec-14 8:03
professionalEddy Vluggen23-Dec-14 8:03 

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.