From the course: Learning SOLID Programming Principles

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

GRASP patterns: High cohesion and indirection

GRASP patterns: High cohesion and indirection - Python Tutorial

From the course: Learning SOLID Programming Principles

GRASP patterns: High cohesion and indirection

- [Narrator] I'd like to continue looking at the Single Responsibility Principle. Remember the part that's tricky about this is always identifying the right level of abstraction. To understand what single means, I'll show some more of the general responsibility assignment software principles. There are a number of principles for determining what counts as responsibility. Previously, I talked about the controller of a use case or story and the creator of complex objects. Here I'll talk about two more concepts. Using high cohesion as a reason for combining objects, attributes or methods or using indirection that is a bridge or a link among separate objects. In the next section I'll talk about the remaining principles. The idea of high cohesion is a way to look at combining features. It may be more cohesive to make a single class which is responsible for closely related features splitting the sample list into two parts…

Contents