Principles of Visual Modeling: Topics
Principles of Visual Modeling: Topics
Module 2
Principles of Visual Modeling
Topics
What Is a Model? ................................................................................................. 2-4
Four Principles of Modeling ................................................................................ 2-11
What Is the UML? .............................................................................................. 2-17
A Language Is Not Enough to Build a System....................................................... 2-25
Objectives
Objectives
Describe the importance of visual modeling
and the role of Model Driven Architecture.
Define the four principles of visual
modeling.
Explain what the Unified Modeling
Language (UML) represents.
Define the type of process that best relates
to the UML.
What Is a Model?
What Is a Model?
A model is a simplification of reality.
According to Grady Booch, IBM Fellow, a model provides the blueprints of a system.
Models may encompass detailed plans, as well as more general plans that give a
30,000-foot view of the system under construction. A good model includes those
elements that are not relevant to the given level of abstraction. Every system may be
described from different aspects using different models, and each model is therefore
a semantically closed abstraction of the system. A model may be structural,
emphasizing the organization of the system, or it may be behavioral, emphasizing the
dynamics of the system.
Why Model?
Why Model?
Modeling achieves four aims:
Helps you to visualize a system as you want it to be.
Permits you to specify the structure or behavior of a
system.
Gives you a template that guides you in constructing a
system.
Documents the decisions you have made.
You build models of complex systems because
you cannot comprehend such a system in its
entirety.
You build models to better understand the system
you are developing.
According to Booch in The Unified Modeling Language User Guide, modeling achieves
four aims:
1. Models help you to visualize a system, as you want it to be. A model helps the
software team communicate the vision for the system being developed. It is
difficult for a software team to have a unified vision of a system that is described
only in specification and requirement documents. Models bring about
understanding of the system.
2. Models permit you to specify the structure of behavior of a system. A model
allows how to document system behavior and structure before coding the
system.
3. Models give a template that guide you in constructing a system. A model is an
invaluable tool during construction. It serves as a road map for a developer. Have
you experienced a situation where a developer coded incorrect behavior
because he or she was confused over the wording in a requirements document?
Modeling helps alleviate that situation.
4. Models document the decisions you’ve made. Models are valuable tools in the
long term because they give “hard” information on design decisions. You don’t
need to rely on someone’s memory.
You can take a piece of paper and a paper clip, and, in a few minutes, have a paper
airplane that entertains your kids. If it isn’t built just right, you can always start over
and build another airplane.
Would it be smart for you to build a fighter jet in the same way? That is, start with
some steel, nuts, bolts, and wiring and go right to work. Of course not. You’re
building an airplane that costs millions of dollars, and the cost of failure is high.
You’re also be part of a much larger team, needing blueprints and models to
effectively communicate with one another. (The Unified Modeling Language User
Guide, Booch, 1999.)
If defense contractors want to build fighter jets for the government, they need to
achieve a certain balance between the desires of the military with the realities of
aerospace engineering. They also want to treat their employees professionally, never
placing them at risk or driving them so hard that they burn out.
Curiously, many software development organizations begin wanting to build complex
software systems, but approach the problem as though they were building a paper
airplane.
With the increasing demand to build more complex software in shorter time,
development teams often retreat to the only thing they know how to do well - pound
out lines of code. Developers start working longer hours and frequently produce
code with a requirements document as their only source of input. However, there
eventually comes a time when the application collapses due to the lack of a well
thought-out architecture. Consequently, many of these software projects result in
failure.
MDA Viewpoints
MDA Viewpoints
Computational Independent Model (CIM)
Focus is on environment of the system and
requirements for the system
Platform Independent Model (PIM)
Focus is on system operation, independent of
platform
Platform Specific Model (PSM)
Focus is on detailed usage of system on specific
platform
10
11
12
The right models illuminate the most difficult development problems, offering insight
that you could not gain otherwise. The wrong models mislead you, causing you to
focus on irrelevant issues.
In software, the models you choose can greatly affect your world view. If you build a
system through the eyes of a database developer, you’ll likely end up with entity-
relationship models that push behavior into stored procedures and triggers. If you
build a system through the eyes of an object-oriented developer, you’ll end up with a
system that has its architecture centered around many classes and patterns of
interaction that direct how those classes work together.
Each world view leads to a different kind of system with different costs and benefits.
(The Unified Modeling Language User Guide, Booch, 1999.)
If you are building computer chips, sometimes you need a 30,000-foot view. For
example, you need your investors to visualize the end product. Other times, you
need to get down to the level of the circuits.
When developing a GUI system, a quick and dirty executable model of the user
interface may be all you need to communicate your intentions. Other times, when
you are dealing with cross-system interfaces of network bottlenecks, you need to
model down to the bit level. In either case, the best models are those that let you
choose your degree of detail, depending on who is doing the viewing and why they
need to view it. (The Unified Modeling Language User Guide, Booch, 1999.)
14
A physical model of a building that doesn’t respond the same way as the real
materials has limited value. It’s best to have models that have a clear connection to
reality. Where that connection is weak, you need to know exactly how those models
are divorced from the real world.
All models simplify reality. The trick is to be sure that your simplifications don’t mask
any important details. A good model reveals any potentially fatal flaws in design. (The
Unified Modeling Language User Guide, Booch, 1999.)
Analysts/Designers Programmers
Structure Software management
Use-Case View
End-user
Functionality
15
The key phrase is “nearly independent,” meaning that models can be built and
studied separately, but are still interrelated.
To understand the architecture of object-oriented systems, you need several
complementary and interlocking views. An architectural view can be defined as a
simplified description (an abstraction) of a system from a particular perspective or
vantage point, covering particular concerns, and omitting entities that are not relevant
to this perspective. Views are “slices” of models.
Each of the views below may have structural and behavioral aspects. Together, they
represent the blueprints of a software system.
• Use-case view exposing the requirements of the system
• Logical view capturing the vocabulary of the problem space and the solution
space
• Process view modeling the distribution of the system’s processes and threads
• Implementation view addressing the physical realization of the system
• Deployment view focusing on system engineering issues
To address these different needs, Rational has defined the “4+1 view” architecture
model.
Remember that not all systems require all views. The number of views is dependent
on the system you’re building. For example, a single processor does not require a
deployment view or a small program does not require an implementation view and
so on.
16
17
The software systems that you develop today are more complex than the human
mind can comprehend. This is why you model systems. Your model selection
profoundly influences how you attack the problem and shape the solution.
No single model is sufficient. Every complex system is best approached through a
small set of nearly independent models.
Therefore, to increase comprehension, a common language like the Unified
Modeling Language (UML) is used to express models.
A modeling language is a language whose vocabulary and rules focus on the
conceptual and physical representation of a system. A modeling language like the
UML is a standard language for software blueprints.
18
Typically, projects and organizations develop their own language for modeling
systems, making it difficult for outsiders and new team members to understand what
is going on.
Communicating these conceptual models to others is prone to error unless everyone
involved speaks the same language. The UML offers a set of symbols that represents
well-defined semantics. One developer can write a model in the UML, and another
developer can interpret that model unambiguously.
There are things about a software system you can’t understand unless you build
models that transcend the textual programming language. For example, the meaning
of a class hierarchy can be inferred, but not directly grasped, by staring at the code
for all the classes in the hierarchy. The UML is a graphical language that addresses this
problem.
If the developer who cut the code never wrote down the models, the information
would be lost forever. At best, the information would only be partially recoverable
from the implementation after the developer has moved on. Writing models in the
UML addresses this issue. An explicit model facilitates communication. (The Unified
Modeling Language User Guide, Booch, 1999.)
19
In this context, specifying means to build models that are precise, unambiguous, and
complete. In particular, the UML addresses the specification of all the important
analysis, design, and implementation decisions that must be made to develop and
deploy software-intensive systems. (The Unified Modeling Language User Guide,
Booch, 1999.)
20
The UML is not a visual programming language. However, models using the UML can
be directly connected to a variety of programming languages, making it possible to
map from a model in the UML to a programming language or even to a database.
If it is best expressed graphically, it is done graphically in the UML. If it is best
expressed textually, it is done in the programming language.
This mapping permits forward engineering: the generation of code from a UML
model to a programming language. Reverse engineering is also possible: the
reconstruction of a model from implementation back into the UML.
W indow s95
Window95
W indows 95
Use Case 1
¹®¼ -°ü¸®
Å ¬¶óÀÌ¾ðÆ® .EXE
¹® ¼ -°ü¸® ¾ÖÇ Ã¸ ´
W indow s
NT
Actor A Actor B
Use Case 2 Solaris
Alpha
UNIX
ÀÀ ¿ë¼-¹ö.EXE
W indows
NT
IBM
µ¥ÀÌÅ ¸º£À̽º ¼- ¹ö
DocumentLi st
code..
clos e( )
2: fetchDoc ( ) read( )
FileList
sortFil eList ( )
fLis t
create( )
3: create ( )
fillDocument( )
add( )
delete( )
1
4: create ( )
5: readDoc ( )
rep
7: readFile ( )
File
Repository
8: fillFile ( )
(fro m Persistenc e)
read( ) GrpFile
fillFile( )
21
UML 1.5
(March, ‘03)
The UML 2.0 is defined by two complementary specifications, the Infrastructure and
the Superstructure. The UML infrastructure defines foundational concepts that can be
used in part or entirely by other specifications. The UML superstructure defines the
complete UML. The superstructure specification is self contained and you won’t have
to read the infrastructure specification unless you are concerned about configuring
other specifications in parallel to UML.
The UML metamodel (a description of a model) is divided into two main packages,
structure and behavior with two supporting packages, auxiliary elements and profiles.
• The structure package defines the static structure of the UML.
• The behavior package defines the dynamic structure of the UML.
Each package is described by a chapter in the superstructure specification document.
Meyer Fusion
Before and after Operation descriptions,
conditions message numbering
Harel Embley
State charts Singleton classes,
High-level view
23
24
Team- Based
Development
Modeling Unified
Language Process
25
The UML provides a standard for the artifacts of development (semantic models,
syntactic notation, and diagrams) that must be controlled and exchanged. But the
UML is not a standard for the development process.
Despite all its value, you cannot achieve successful development of today’s complex
systems solely by using the UML. Successful development also requires employing an
equally robust development process.
26
Check Balance
Customer
Withdraw Money
27
Use cases are one recommended method for organizing your requirements. Instead
of a bulleted list of requirements, you organize them in a way that shows how
someone can use the system. By doing so, a requirement is more complete and
consistent. You can also better understand the importance of a requirement from a
user perspective.
It’s often difficult to tell how a system does what it is supposed to do from a
traditional object-oriented system model. This stems from the lack of a "thread"
through the system when it performs certain tasks. Use cases are that thread because
they define the behavior performed by a system.
Use cases are not part of "traditional" object orientation, but their importance has
become more and more apparent, further emphasized that use cases are part of the
UML.
An Architecture-Centric Process
An Architecture-Centric Process
A system’s architecture is used as a
primary artifact for conceptualizing,
constructing, managing, and evolving the
system under development.
Benefits:
Intellectual control over a project to manage its
complexity and to maintain system integrity.
Effective basis for large-scale reuse.
A basis for project management.
Assistance in component-based development.
28
Use cases drive the process end-to-end over the entire lifecycle. The design activities
are centered around architecture-centric architecture, or for software-intensive
systems, software architecture. The main focus of the early iterations of a
architecture-centric process is to produce and validate a software architecture, which
in the initial development cycle takes the form of an executable architectural
prototype that gradually evolves to become the final system in later iterations.
A complex system is more than the sum of its parts, more than a succession of small
independent tactical decisions. It must have some unifying, coherent structure to
organize those parts systematically, and provide precise rules on how to grow the
system without having its complexity “explode” beyond human understanding.
Architecture provides this structure and these rules.
By clearly articulating the major components and the critical interfaces among them,
architecture lets you reason about reuse, both internal reuse (the identification of
common parts), and external reuse (the incorporation of ready-made, off-the-shelf
components). Architecture can also help reuse on a larger scale. That is, the reuse of
the architecture itself in the context of a product line that addresses different
functionality in a common domain.
29
Iterative Development
Iterative Development
Iteration 1 Iteration 2 Iteration 3
R R R
D D D
C C C
I I I
T T T
T I ME
Review
Review
What is a model?
What are the viewpoints of MDA?
Describe each one.
What are the four principles of
modeling? Describe each one.
What is the UML? Describe each
of its four benefits.
What process characteristics best
fit the UML? Describe each
characteristic.
What is an iteration?
31