Code Against Interfaces, Not Implementations
From APIDesign
(Difference between revisions)
(→Have You Ever Wondered...?) |
|||
Line 1: | Line 1: | ||
== Have You Ever Wondered...? == | == Have You Ever Wondered...? == | ||
- | Have you ever participated in a flamewar between people who believe API should be full of '''interface'''s and those who believe it is better to use '''class'''es? Was the dispute resolved somehow or people just | + | Have you ever participated in a flamewar between people who believe API should be full of '''interface'''s and those who believe it is better to use '''class'''es? Was the dispute resolved somehow or people just kept their original views? Yes, I've participated in such discussions few times and yes, they never lead to any conclusions. However then I've managed to look at the old ''code against interfaces'' advice in new light and things started to make sense. Since then I have eliminated flamewars of this kind almost completely. Probably because the revelation is not only surprising, but also backed by rational reasoning. You can find this all in the chapter 6, plus see application of this rule for [[APIDesignPatterns:RequestResponse|Request/Response]] API Design Pattern. |
Revision as of 20:27, 2 August 2008
Have You Ever Wondered...?
Have you ever participated in a flamewar between people who believe API should be full of interfaces and those who believe it is better to use classes? Was the dispute resolved somehow or people just kept their original views? Yes, I've participated in such discussions few times and yes, they never lead to any conclusions. However then I've managed to look at the old code against interfaces advice in new light and things started to make sense. Since then I have eliminated flamewars of this kind almost completely. Probably because the revelation is not only surprising, but also backed by rational reasoning. You can find this all in the chapter 6, plus see application of this rule for Request/Response API Design Pattern.