Advertisement
pexea12

Design Patterns

Feb 1st, 2016
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.65 KB | None | 0 0
  1. OO Principles:
  2. - Encapsulate what varies
  3. - Favor composition over inheritance
  4. - Program to interface, not implementation
  5. - Strive for loosely coupled designs between objects that interact
  6. - Classes should be open for extension, but closed for modification
  7. - Depend on abstractions. Do not depend on concrete classes
  8. - Only talk to your friends
  9. - Don't call us, we'll call you
  10. - A class should have only one reason to change
  11.  
  12. OO Patterns:
  13. - Strategy: defines a family of algorithm, encapsulates each one, and makes them interchangeable. Strategy lets the algorithm vary independently from clients that use it
  14. - Observer: defines a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically
  15. - Decorator: Attach additional responsibilities to an object dynamically, provide a flexible alternative to subclassing for extending functionality
  16. - Factory: Define an interface for creating an object but let subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to the subclasses
  17. - Abstract factory: Provide an interface for creating families of related or dependent objects without specifying their concrete classes
  18. - Singleton: Ensure a class only has one instance and provide a global point to access to it
  19. - Command: Encapsulates a request as an object, thereby letting you parameterize clients with different requests, queue or log requests and support undoable operations
  20. - Adapter: Converts the interface of a class into another interface clients expect. Lets classes work together that couldn't otherwise because of incompatible interfaces
  21. - Facade: Provides a unified interface to a set of interfaces in a subsystems. Facade defines a higher-level interface that makes the subsystem easier to use
  22. - Template: Define the skeleton of an algorithm in an operation, deferring some steps to subclasses. Template Method lets subclasses redefine certain steps of an algorithm without changing the algorithm's structure
  23. - Iterator: Provide a way to access the elements of an aggregate object sequentially without exposing its underlying representation
  24. - Composite: Compose objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions of objects uniformly
  25. - State: Allow an object to alter ít behavior when ít internal state changes. The object will appear to change íts class
  26. - Compound (MVC): combines two or more patterns into a solution that solves a recurring or general problem
  27. - Bridge
  28. - Builder
  29. - Chain of Responsibility
  30. - Flyweight
  31. - Interpreter
  32. - Mediator
  33. - Memento
  34. - Prototype
  35. - Visitor
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement