Skip to content

mark all books contains grasp|solid|cupid|yagni|dry|kiss principles #16

Description

@timnavigate

GRASP

General Responsibility Assignment Software Patterns (or Principles), abbreviated GRASP, is a set of nine fundamental principles in object design and responsibility assignment: 6  first published by Craig Larman in his 1997 book Applying UML and Patterns

Information Expert

related Pattern or Principle:
Low Coupling High Cohesion

Creator

related Pattern or Principle:
Low Coupling Factory patterns

Controller

related Pattern or Principle:
Command, Facade, Layers, Pure Fabrication

Indirection
Low Coupling
High Cohesion
Polymorphism
Protected Variations
Pure Fabrication

related Patterns and Principles:
Low Coupling High Cohesion

...

SOLID

Software engineer and instructor Robert C. Martin introduced the basic principles of SOLID design in his 2000 paper Design Principles and Design Patterns about software rot

The SOLID acronym was coined around 2004 by Michael Feathers

Single-responsibility principle

states that there should never be more than one reason for a class to change. In other words, every class should have only one responsibility.

Importance

  • Maintainability when classes have a single, well-defined responsibility, they're easier to understand and modify
  • Testability it's easier to write unit tests for classes with a single focus
  • Flexibility changes to one responsibility don't affect unrelated parts of the system
Open–closed

principle states that software entities should be open for extension, but closed for modification

Importance

  • Extensibility new features can be added without modifying existing code
  • Stability reduces the risk of introducing bugs when making changes
  • Flexibility adapts to changing requirements more easily
Liskov substitution principle

states that functions that use pointers or references to base classes must be able to use pointers or references of derived classes without knowing it

Importance

  • Polymorphism enables the use of polymorphic behavior, making code more flexible and reusable
  • Reliability ensures that subclasses adhere to the contract defined by the superclass
  • Predictability guarantees that replacing a superclass object with a subclass object won't break the program
Interface segregation principle

states that clients should not be forced to depend upon interface methods that they do not use

Importance

  • Decoupling reduces dependencies between classes, making the code more modular and maintainable
  • Flexibility allows for more targeted implementations of interfaces
  • Avoids unnecessary dependencies clients don't have to depend on methods they don't use
Dependency inversion principle

states that one should depend upon abstractions, not concretes

Importance

  • Loose coupling reduces dependencies between modules, making the code more flexible and easier to test
  • Flexibility enables changes to implementations without affecting clients
  • Maintainability makes code easier to understand and modify

...

CUPID

Composable

plays well with others through a small surface area, minimal dependencies, and clear intentions

Unix philosophy

focuses on doing one single thing exceptionally well with a simple, consistent model

Predictable

behaves exactly as expected by being deterministic, transparent, and free of hidden side effects

Idiomatic

feels natural to use within the chosen programming language, ecosystem, and team conventions

Domain-based

models the solution structure and vocabulary directly after the real-world problem domain

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentation

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions