3
votes
0answers
182 views

Dependency Inversion Principle: Understanding how both low level components and high level components depend on abstractions

I'm learning about the Dependency Inversion Principle. It states that: High level modules should not depend upon low-level modules. Both should depend upon abstractions. For a while I tried to ...
5
votes
5answers
507 views

Martin Fowler's Refactoring book: switch statement is using other object's data, why is that bad ? A deeper explanation is sought for.

In the code sample below the Rental object is using Movie's fields to do a switch statement. Martin says : this is a bad idea but he does not give any deeper explanation as to why ? Of course, you ...
1
vote
1answer
153 views

Component design: getting cohesion right

I currently have a set of components named DataValues, ValueParsers, ValueFormatters and ValueValidators. The first one defines an abstract base class DataValue and contains a whole load of ...
12
votes
6answers
1k views

Loose Coupling in Object Oriented Design

I am trying to learn GRASP and I found this explained (here on page 3) about Low Coupling and I was very surprised when I found this: Consider the method addTrack for an Album class, two possible ...
2
votes
3answers
149 views

Abstracting out a module or using the Module Singleton directly?

I am working on a module which is dependent on other module for some functionality. Now the dependent module provides a lot of functionality and I need only few of them, hence got the idea to create ...
2
votes
4answers
111 views

Feature organization / authentication? [closed]

Let's say I have a product that has different features, or different feature access depending on things (i.e Premium User, Beta, Demo, Logged-in User, etc..). What's the best way to organize a system ...
17
votes
8answers
2k views

What can go wrong if the Liskov substitution principle is violated?

I was following this highly voted question on possible violation of Liskov Substitution principle. I know what the Liskov Substitution principle is, but what is still not clear in my mind is what ...
2
votes
3answers
582 views

Recommended content for layers

As an expansion from my previous question about using separate projects for seperate layers - Good practice on Visual Studio Solutions I now wish to know if I am putting the right functionality in ...
6
votes
5answers
290 views

Please help me give this principle a name [closed]

As a designer, I like providing interfaces that cater to a power/simplicity balance. For example, I think the LINQ designers followed that principle because they offered both dot-notation and ...