Beyond SOLID: The Dependency Elimination Principle

148 views
Skip to first unread message

Imre Kószó

unread,
Feb 11, 2015, 9:34:51 AM2/11/15
to clean-code...@googlegroups.com
Stumbled upon this and I thought it would be on-topic here: http://qualityisspeed.blogspot.nl/2014/09/beyond-solid-dependency-elimination.html

Caio Fernando Bertoldi Paes de Andrade

unread,
Feb 11, 2015, 11:36:38 AM2/11/15
to clean-code...@googlegroups.com
The author seems to be bothered by the anaemic domain model created by applying SOLID, and instead uses his own made-up principles to end up in a rich domain model.

In the end he has applied SOLID anyway and doesn’t even notice. ;-)

Caio

On 11 Feb 2015, at 12:34, Imre Kószó <imre....@gmail.com> wrote:

Stumbled upon this and I thought it would be on-topic here: http://qualityisspeed.blogspot.nl/2014/09/beyond-solid-dependency-elimination.html

--
The only way to go fast is to go well.
---
You received this message because you are subscribed to the Google Groups "Clean Code Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clean-code-discu...@googlegroups.com.
To post to this group, send email to clean-code...@googlegroups.com.
Visit this group at http://groups.google.com/group/clean-code-discussion.

Caio Fernando Bertoldi Paes de Andrade

unread,
Feb 11, 2015, 11:43:47 AM2/11/15
to clean-code...@googlegroups.com
On a sidenote,

Almost a year ago DHH came eager to kill TDD and Clean Code, but ended up just renaming them to System Testing and Code Clarity.

After all the hype someone twitted something like “Uncle Bob, beware, they will also come for SOLID soon”.

It seems they have come, and all they could do is rename it to Dependency Elimination Principle. ;-)

Caio

Eldan

unread,
Feb 11, 2015, 5:16:16 PM2/11/15
to clean-code...@googlegroups.com
Hi, this is actually the exact same idea of The Law Of Demter:
http://en.wikipedia.org/wiki/Law_of_Demeter

The Law Of Demeter (by WIKI) states:
  • Each unit should have only limited knowledge about other units: only units "closely" related to the current unit.
  • Each unit should only talk to its friends; don't talk to strangers.
  • Only talk to your immediate friends.

e.g: Applying this rule in a static language like C# would be changing the reference type of a List<T> to IEnumerable<T> (an interface it derives from)
when you only want what IEnumerable<T> offers you (ability to enumerate the collection)
another way (but a different way) of applying the rule would be to remove (redundant) middle man objects and just simply reference the objects that you need.

Reply all
Reply to author
Forward
0 new messages