a class encapsulates state and operations, while a subsystem encapsulates classes.
CyrilSmedalıntı yaptı3 yıl önce
Discussion of Creational Patterns
CyrilSmedalıntı yaptı3 yıl önce
The creational patterns provide different ways to remove explicit references to concrete classes from code that needs to instantiate them:
Creational pattern examples
CyrilSmedalıntı yaptı3 yıl önce
How to Use a Design Pattern
CyrilSmedalıntı yaptı3 yıl önce
How to Select a Design Pattern
CyrilSmedalıntı yaptı3 yıl önce
when you eliminate dependencies on specific operations by isolating and encapsulating each operation, you make it easier to reuse an operation in different contexts
CyrilSmedalıntı yaptı3 yıl önce
Object composition in general and delegation in particular provide flexible alternatives to inheritance for combining behavior. New functionality can be added to an application by composing existing objects in new ways rather than by defining new subclasses of existing classes. On the other hand, heavy use of object composition can make designs harder to understand. Many design patterns produce designs in which you can introduce customized functionality just by defining one subclass and composing its instances with existing ones