Documentos de Académico
Documentos de Profesional
Documentos de Cultura
In software engineering, behavioral design patterns are design patterns that identify common communication
patterns between objects and realize these patterns. By doing so, these patterns increase flexibility in carrying
out this communication.
§ Chain of responsibility pattern: Command objects are handled or passed on to other objects by logic-
containing processing objects
§ Iterator pattern: Iterators are used to access the elements of an aggregate object sequentially without
exposing its underlying representation
§ Mediator pattern: Provides a unified interface to a set of interfaces in a subsystem
§ Memento pattern: Provides the ability to restore an object to its previous state (rollback)
§ Observer pattern: aka Publish/Subscribe or Event Listener. Objects register to observe an event that may
be raised by another object
§ Weak reference pattern: De-couple an observer from an observable.[2]
§ State pattern: A clean way for an object to partially change its type at runtime
In computer programming, the interpreter pattern is a design pattern that specifies how to evaluate
sentences in a language. The basic idea is to have a class for each symbol (terminal or nonterminal)
in a specialized computer language. The syntax tree of a sentence in the language is an instance of
the composite pattern and is used to evaluate (interpret) the sentence.[1]
The mediator pattern defines an object that encapsulates how a set of objects interact. This pattern
is considered to be a behavioral pattern due to the way it can alter the program's running behavior.
With the mediator pattern, communication between objects is encapsulated with a mediator object.
Objects no longer communicate directly with each other, but instead communicate through the
mediator. This reduces the dependencies between communicating objects, thereby lowering
the coupling.
The memento pattern is a software design pattern that provides the ability to restore an object to its
previous state (undo via rollback).
The memento pattern is implemented with two objects: the originator and a caretaker. The originator
is some object that has an internal state. The caretaker is going to do something to the originator,
but wants to be able to undo the change. The caretaker first asks the originator for a memento
object. Then it does whatever operation (or sequence of operations) it was going to do. To roll back
to the state before the operations, it returns the memento object to the originator. The memento
object itself is anopaque object (one which the caretaker cannot, or should not, change). When using
this pattern, care should be taken if the originator may change other objects or resources - the
memento pattern operates on a single object.
The observer pattern is a software design pattern in which an object, called the subject, maintains
a list of its dependents, called observers, and notifies them automatically of any state changes,
usually by calling one of their methods. It is mainly used to implement distributed event
handling systems. Observer is also a key part in the familiar MVCarchitectural pattern. In fact the
observer pattern was first implemented in Smalltalk's MVC based user interface framework.[1]
The state pattern, which closely resembles Strategy Pattern, is a behavioral software design
pattern, also known as the objects for states pattern. This pattern is used incomputer
programming to represent the state of an object. This is a clean way for an object to partially change
its type at runtime[1]:395.
A template method defines the program skeleton of an algorithm. One or more of the algorithm
steps can be overridden by subclasses to allow differing behaviors while ensuring that the
overarching algorithm is still followed.
In object-oriented programming, first a class is created that provides the basic steps of an algorithm
design. These steps are implemented using abstract methods. Later on, subclasses change the
abstract methods to implement real actions. Thus the general algorithm is saved in one place but the
concrete steps may be changed by the subclasses.
In object-oriented programming and software engineering, the visitor design pattern is a way of
separating an algorithmfrom an object structure on which it operates. A practical result of this
separation is the ability to add new operations to existing object structures without modifying those
structures. It is one way to easily follow the open/closed principle.
Behavioral patterns
In Design In Code
Name Description Other
Patterns Complete[17]
representation to interpret
sentences in the language.
Represent an operation to be
performed on the elements of an
object structure. Visitor lets you
Visitor Yes No N/A
define a new operation without
changing the classes of the
elements on which it operates.
software architecture describes elements of a system and the relations among them. We
also emphasized that every system has many kinds of elements and that different
architectural structures are useful, even necessary, to present a complete picture of the
architecture of a system. Each structure concentrates on one aspect of the architecture.
Relation among
Structure Elements Elements Has Influence Over
DECOMPOSITION STRUCTURE
Assign work teams so that their Modules structured as a hierarchy; each work team
interactions were minimized assigned to a second-level module and all of its
descendants
USES STRUCTURE
Incrementally build and test Create "is-allowed-to-use" structure for programmers that
system functions limits procedures each can use
Design for platform change Restrict number of procedures that use platform directly
libWWW is a compact, portable library that can be built on to create Web-based applications
such as clients, servers, databases, and Web spiders. It is organized into five layers, as
Figure 13.4. A layered view of libWWW
Hide information
Configuration files
Air traffic control (ATC) is among the most demanding of all software applications. It is hard
real time, meaning that timing deadlines must be met absolutely; it is safety critical,
meaning that human lives may be lost if the system does not perform correctly; and it
is highly distributed, requiring dozens of controllers to work cooperatively to guide aircraft
through the airways system. In the United States, whose skies are filled with more
commercial, private, and military aircraft than any other part of the world, ATC is an area of
intense public scrutiny. Aside from the obvious safety issues, building and maintaining a
safe, reliable airways system requires enormous expenditures of public money. ATC is a
multibillion-dollar undertaking.
This chapter is a case study of one part of a once-planned, next-generation ATC system for
the United States. We will see how its architecture?in particular, a set of carefully chosen
views (as in Chapter 2) coupled with the right tactics (as in Chapter 5)?held the key to
achieving its demanding and wide-ranging requirements. Although this system was never
put into operation because of budgetary constraints, it was implemented and demonstrated
that the system could meet its quality goals.
In the United States, air traffic is controlled by the Federal Aviation Administration (FAA), a
government agency responsible for aviation safety in general. The FAA is the customer for
the system we will describe. As a flight progresses from its departure airport to its arrival
airport, it deals with several ATC entities that guide it safely through each portion of the
airways (and ground facilities) it is using. Ground control coordinates the movement of
aircraft on the ground at an airport. Towers control aircraft flying within an
airport's terminal control area, a cylindrical section of airspace centered at an airport.
Finally, en route centers divide the skies over the country into 22 large sections of
responsibility.
Consider an airline flight from Key West, Florida, to Washington, D.C.'s Dulles Airport. The
crew of the flight will communicate with Key West ground control to taxi from the gate to
the end of the runway, Key West tower during takeoff and climb-out, and then Miami Center
(the en route center whose airspace covers Key West) once it leaves the Key West terminal
control area. From there the flight will be handed off to Jacksonville Center, Atlanta Center,
and so forth, until it enters the airspace controlled by Washington Center. From Washington
Center, it will be handed off to the Dulles tower, which will guide its approach and landing.
Flying from point A to point B in the U.S. air traffic control system.
The system we will study is called the Initial Sector Suite System (ISSS), which was
intended to be an upgraded hardware and software system for the 22 en route centers in
the United States. It was part of a much larger government procurement that would have,
in stages, installed similar upgraded systems in the towers and ground control facilities, as
well as the transoceanic ATC facilities.
The fact that ISSS was to be procured as only one of a set of strongly related systems had a
profound effect on its architecture. In particular, there was great incentive to adopt common
designs and elements where possible because the ISSS developer also intended to bid on
the other systems. After all, these different systems (en route center, tower, ground
control) share many elements: interfaces to radio systems, interfaces to flight plan
databases, interfaces to each other, interpreting radar data, requirements for reliability and
performance, and so on. Thus, the ISSS design was influenced broadly by the requirements
for all of the upgraded systems, not just the ISSS-specific ones. The complete set of
upgraded systems was to be called the Advanced Automation System (AAS).
Ultimately, the AAS program was canceled in favor of a less ambitious, less costly, more
staged upgrade plan. Nevertheless, ISSS is still an illuminating case study because, when
the program was canceled, the design and most of the code were actually already
completed. Furthermore, the architecture of the system (as well as most other aspects) was
This case study illustrates the entire Architecture Business Cycle (ABC), but especially
shows how a product line architecture led CelsiusTech to new business opportunities. Figure
15.1 shows the roles of the ABC stakeholders in the CelsiusTech experience.
Configuration files
Component
replacement
Adherence to
defined protocols