Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Background UML
Nineties: number of popular object-oriented methods Unified Modeling Language: proposal for set of standard notations wide attention
see www.rational.com
UML notations
Class diagram
static information structure (data) combined function/control view high level view of system services (functional) highly interactive control
Activity diagram
Use-case diagram
State diagram
UML notations
Activity diagram
Model control and information flow of a procedure or process Useful if control is mainly synchronous
Can also be used to model control flow within a task method (knowledge model)
UML notations
Action state
After termination the action state can lead to another action state
state transition
UML notations
data entry
processing
generate output
UML notations
Decision
Sate transition is deterministic If transition depends on outcome of the work, then introduce a decision
further processing
[data incorrect]
UML notations
Introducing concurrency
buy food and drinks
cook dinner
have dinner
UML notations
Swim lanes
Process can sometimes be distributed over several agents or organizational units Notation: use compartments In particular useful when modeling a business process (e.g. in organization model)
UML notations
design elevator
calculate cost
write tender
UML notations
10
Object flow
CUSTOMER SALES DEPARTMENT DESIGN DEPARTMENT
customer information
tender
write tender
custom design
standard design
cost calculation
elevator design
UML notations
11
Signals
receive request
archive (request)
archive (request)
archive
process request
UML notations
12
magazine production
application assessment
:residence assignments
statistical analysis
residence assignment
policy information
UML notations
13
no solution found
obtain
compare
UML notations
14
State diagrams
Synonyms: state chart, state-transition diagram Purpose: model of dynamic behavior Use if control is heavily influenced by external events Draw a state diagram for object classes with interesting behavior Activity diagram is alternative
UML notations
15
State
UML notations
16
State transition
airborne
do/fly
Event: comes from outside the object modeled Message: generates event for another object Guard: outcome of internal object computation
17
UML notations
on transition on state entry = action on all incoming transitions on state exit = action on all outgoing transitions on event
UML notations
18
inserting money timer balance insert(coin)/add to balance time out select(ticket) [balance < ticket price]
cancelling
do/compute change
UML notations
19
State concurrency
entering transaction data processing
cash taken
card taken
idle
UML notations
20
State generalization
playing chess
If Object A is in super-state S, then the object us in precisely one of the sub-states Cf. concurrency: and-states
UML notations
21
real-time applications
Control specification for the business process Overlap with activity diagrams
UML notations
22
application assessment
data needed/ask
UML notations
23
Class diagram
Generalization, inheritance & reuse are important issues Imported into CommonKADS domain- schema notation
UML notations
24
:airplane
UML notations
25
Object class
Terminology: object is often used in an ambiguous way, pointing to both objects (in the strict sense) and object classes.
UML notations
26
Attributes
An attribute describes a value held by objects belonging to the class. Attribute specification consists of:
Class it is defined on (student) Attribute name (name) Admissible values (string) Optional: default value
UML notations
27
Most O-O approaches distinguish between objects and values. Difference: a value does not have an identity
RULE 1: an object is not allowed as a possible value of an attribute! RULE 2: attribute names need only to be unique within a class.
UML notations
28
Values are the primitive things with no internal structure from the viewpoint of the application Admissible values are defined through a value set Typical predefined value-sets:
User-defined:
UML notations
29
Object Identifiers
In O-O modeling you assume that every object has an identity. Consequence: introduce only attributes that act as identifiers, iff the identifier is something that exists in the real world. Examples: student card number, social security number.
UML notations
30
Operations
Definition:
Objects in a class share the same operations. Method: implementation of an operation = functional view
UML notations
31
Class notation
class name attribute-1: value-set attribute-2: value-set operation-1(Par1:Type, Par2:Type): ReturnType
library book catalog#: string title: string author: string category: Category cover-type: {hard-cover, paperback} available(): Boolean
library book
UML notations
32
Associations
Ternary associations come up occasionally. Associations between more than three objects are rare.
UML notations
33
Association notation
General notation for association
husband
w ife
woman
husband
w ife
woman
UML notations
34
Multiplicity examples
person 0-1 married-to
major
UML notations
35
Multiplicity
Also called: "cardinality". Always connected to one of the classes involved. Typical types of multiplicity:
0-1 1 0+ 1+
UML notations
36
Association class
Modeling an association as a class if the association has an internal information structure Advantage: associations become first-class objects. Attributes and methods can be defined for the association class.
UML notations
37
husband
w ife
man
city
registered in >>
UML notations
38
if you want to model that a person can work for more than one company, then change to
company name
employer 1+
employee 1+
UML notations
39
Associations provide a general, "neutral", way of connecting object classes. Semantics of the association are defined through argument typing, multiplicity and (implicitly) the name of the association. Class diagrams provide specific types of associations, with predefined semantics:
UML notations
40
Generalization
Purpose: sharing similarities while preserving differences Is an association between a class that acts as superclass and one or more classes called the subclasses. Super-classes show the features that the sub-classes have in common. Each sub-class inherits the attributes and operations defined on its super-class(es).
UML notations
41
human
computer program
man
woman
UML notations
42
Aggregation
Aggregation denotes a binary association in which one side is an "assembly" and the other side a "part". "Assembly" and "part" act as predefined roles involved in the aggregation association. Cardinality of a part can be defined
UML notations
43
0-1
CD player
audio system
record player
amplifier
tape deck
speaker
UML notations
44
Composition
UML notations
45
Similarities:
Tree-like structure Transitive properties AND-tree (aggregation) vs. OR-tree (generalization) instance tree (aggregation) vs. class tree (generalization)
Differences:
UML notations
46
1+ input system
2,4 speaker
amplifier
CD player
tuner
UML notations
47
Use-case diagram
shows services that can be expected from a system provides outsider view (customer) terminology
use case actor service provided by system agent using a system service
used in early phases of system analysis use in CommonKADS: way to present possible solutions to customer
UML notations
48
library system
lend book
add book to catalog make book reservation lender search library catalog
librarian
UML notations
49
UML notations
50
Use cases
browse individual results browse course results
tutor
browse enrollments
administrative staff
UML notations
51
Class diagram
exam
requires
0+ course 0+
course-code: string year: integer trimester: 1-3 study-points: integer learning-goals: string description: text literature: text maximum-#students: integer
date: date
0+ university staff member title: string position: string 1+ department: string telephone: string room: string e-mail: string
tutor
UML notations
52
[above limit]
[preconditions OK]
register enrollment
UML notations
53
local processing
UML notations
54