Course Summary
Despite many improvements in hardware, developing quality software
on-time and under budget remains hard. Moreover, developing high
quality reusable software is even harder. In my experience, the
principles, practices, and skills required to develop such software
are best learned by gaining a firm understanding of patterns, pattern
languages, and frameworks.
A pattern describes a reusable solution to a common problem that
arises within a particular context of software design. When related
patterns are woven together they form a pattern language that provides
vocabulary and a process for the orderly resolution of software
development problems. A framework is an integrated set of software
components that collaborate to provide a reusable architecture for a
family of related applications. Frameworks can also be viewed as
concrete realizations of pattern languages that facilitate direct
reuse of detailed designs and source code.
This LiveLessons course describes how to apply patterns and frameworks
to alleviate the complexity of developing software via the use of
object-oriented design techniques and Java programming language
features. We'll use a case study based on many patterns in the book
Design Patterns: Elements of Reusable Object-Oriented
Software (the so-called ``Gang of Four'' or ``GoF'' book) to
showcase pattern-oriented design and programming techniques in Java.
This case study will help us evaluate the limitations with alternative
design and programming methods (such as algorithm decomposition) and
demonstrate by example how patterns and object-orientation
help alleviate these limitations.
Course Topics
The Table of Contents for the course is available here.
The following is a summary of the key topics covered in this course:
- Lesson 1 presents an overview of patterns to help you recognize
the importance of design experience, understand how patterns can help
improve software quality and developer productivity, identify common
characteristics in pattern descriptions, and know the history of the
Gang of Four book and its patterns, as well as know key relationships
between patterns.
- Lesson 2 presents the functional and non-functional requirements
of object-oriented expression tree app that we'll use throughout the
course as a realistic--yet tractable--case study to motivate the need
for--and benefits of--key Gang of Four patterns written in Java that
run on a range of runtime platforms, including Android and Eclipse.
- Lesson 3 presents an algorithmic decomposition of the expression
tree processing app to help you understand and evaluate the benefits
and limitations of this historically popular design paradigm.
- Lesson 4 presents an object-oriented design of the expression
tree processing app to help you understand and evaluate the benefits
and limitations of this paradigm.
- Lesson 5--which is the bulk of the course--describes how more
than a dozen patterns from the ``Gang of Four'' book can be applied to
resolve various design problems in the Java expression tree processing
app implementation, including improving its modularity, extensibility,
portability, and quality. The Gang of Four patterns we cover in
detail include the following:
- Composite, which treats individual objects and multiple,
recursively-composed objects uniformly.
- Bridge, which separates an abstraction from its
implementation(s) so the two can vary independently.
- Interpreter, which when given a language, define a
representation for its grammar, along with an interpreter that uses
the representation to interpret sentences in the language.
- Builder, which separate the construction of a complex
object from its representation.
- Iterator, which accesses elements of an aggregate without
exposing its representation.
- Strategy, which defines a family of algorithms, encapsulate
each one, and make them interchangeable to let clients and algorithms
vary independently.
- Visitor, which centralizes operations on an object
structure so that they can vary independently, but still behave
polymorphically.
- Command, which encapsulates the request for a service as
an object.
- Factory Method, which provide an interface for creating an
object, but leaves choice of object's concrete type to a subclass.
- State, which allows an object to alter its behavior when
its internal state changes.the object will appear to change its
class.
- Template Method, which provides a skeleton of an algorithm
in a method, deferring some steps to subclasses.
- and finally Singleton, which ensures a class only has one
instance and provides a global point of access.
We'll also touch on several other Gang of Four patterns, including
Abstract Factory, Observer, Adapter, and Decorator.
- Lesson 6--wraps up the course by discussing of the benefits and
limitations of patterns.
Suggestions for improvement are welcome (especially if they are
accompanied with updates to the source code). Note that the GUI
version of the Calculator "Verbose Mode" is still a work-in-progress.
If you'd like to help improve it please let me know.