Skip to content

MJeremy2017/design-patterns

Repository files navigation

Design Patterns

A Pattern is a solution to a problem in a context.

Refactoring time is Patterns time!

Refactoring is the process of making changes to your code to improve the way it is organized. The goal is to improve its structure, not change its behavior. This is a great time to reexamine your design to see if it might be better structured with patterns

If you don’t need it now, don’t do it now.

If you have a practical need to support change in a design today, go ahead and employ a pattern to handle that change. However, if the reason is only hypothetical, don’t add the pattern, it is only going to add complexity to your system, and you might never need it!

An Anti-Pattern tells you how to go from a problem to a BAD solution.

OO Principles

  • Encapsulate what varies.
  • Favor composition over inheritance.
  • Abstraction Encapsulation Polymorphism Inheritance
  • Program to interfaces, not implementations.
  • Strive for loosely coupled designs between objects that interact.
  • Classes should be open for extension but closed for modification.
  • Depend on abstractions. Do not depend on concrete classes.
  • Only talk to your friends. Don’t call us, we’ll call you.
  • A class should have only one reason to change.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages