Design Patterns

COMP 310    Java Resources  Eclipse Resources

 

 

Design patterns as expressions of CS principles:

Question: Why are there only a few types of bridges in use today?  There are only 4-6 different types of bridges, depending on who you ask:  See for instance:. http://en.wikipedia.org/wiki/Bridge or http://library.thinkquest.org/J002223/types/types.html.

 

Design Pattern CS Principle(s)
Union Polymorphism, inheritance
Composite Recursive data structures
Visitor Decoupled data and algorithms
Extended Visitors Decoupled data and algorithms with variant hosts
Strategy Delegation to abstract processes/behaviors with known semantics
Command Delegation to abstract processes/behaviors with unknown semantics
State Dynamic reclassification -- objects that have changeable states and hence changeable behaviors.   Also, encapsulation barriers to decouple changes.
Model-View-Controller Decomposition of a system into interacting, yet decoupled modules
Adapter Use of indirection layers for decoupling and communication via syntactic translations
Intepreter Data-driven algorithms, polymorphic dispatching, and recusion.
Abstract Factory Abstraction of the creation process of an entity
Template Concrete process involving abstract behaviors.
Singleton Uniqueness
Null Object Concept of "zero" (something that represents nothingness)
Observer-observable Decoupled communications from a single sender to multiple receivers.
Decorator Encapsulation barriers/indirection layers to intercept and modify processing paths.
Flyweight Resource pooling

To look for design patterns in the problem is to look for the underlying CS principles that are driving it.   The design patterns and the abstract notions that they represent comprise the "chunks" into which a problem is decomposed in order to understand it -- "Abstract decomposition"

 

 

 

 

© 2020 by Stephen Wong