Take the 2-minute tour ×

I was just curious, it's something I think most people are aware of as a technique:

You have some abominable data that simply must be parsed and you can do nothing to simplify the algorithm for doing it, so the best you can do is isolate the complexity of that algorithm to one place rather than having parts of the algorithm strewn all over. Then after isolating it, cementing the boundaries of it with some interface or contract to ensure the complexity in it does not leak out.

Where does this drive to isolate complexities live in the library of design principles? I don't think it is word for word one of the formally documented design principles, though I'm guessing there are one or two that overlap with this very closely.

share|improve this question

2 Answers 2

up vote 3 down vote accepted

I would consider this a special case of the Single Responsibility Principle.

Essentially, you have a component dedicated to the implementation, execution, and consistency of the specified algorith - rather than distributing bits and pieces of the algorithm across several different components.

This both encapsulates the algorithm and ensures that if it needs to change over time, there's only a single area of the code that is impacted.

share|improve this answer

The principle that satisfies your description (as I understand it) is the Black Box principle - For example, see this link: http://it.toolbox.com/blogs/enterprise-solutions/design-principles-black-boxes-16028

share|improve this answer

Your Answer


