0% found this document useful (0 votes)
39 views44 pages

System Modelling II

The document discusses various structural modeling techniques used in software engineering including class diagrams, associations, generalization, aggregation, composition, and architectural patterns like entity-control-boundary and hexagonal architecture which divide a system into core entities, controlling logic, and external interfaces. Class diagrams show the structure of object-oriented systems while associations define relationships between classes.

Uploaded by

Bebo Akram
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views44 pages

System Modelling II

The document discusses various structural modeling techniques used in software engineering including class diagrams, associations, generalization, aggregation, composition, and architectural patterns like entity-control-boundary and hexagonal architecture which divide a system into core entities, controlling logic, and external interfaces. Class diagrams show the structure of object-oriented systems while associations define relationships between classes.

Uploaded by

Bebo Akram
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 44

Software Engineering I

Lecture 4

Dr. Yasmine Afify


[email protected]
Structural models

Chapter 5 System Modeling


Structural models

 Structural models of software display the organization


of a system in terms of the components that make up
that system and their relationships.
 Structural models may be static models, which show
the structure of the system design.
 You create structural models of a system when you
are discussing and designing the system architecture.

Chapter 5 System Modeling 3


Class diagrams

 Class diagrams are used when developing an object-


oriented system model to show the classes in a system
and the associations between these classes.
 An object class can be thought of as a general
definition of one kind of system object.
 An association is a link between classes that indicates
that there is some relationship between these classes.
 When you are developing models during the early stages
of the software engineering process, objects represent
something in the real world, such as a patient, a
prescription, doctor, etc.
Chapter 5 System Modeling 4
Class

 Each class has a class name, a set of attributes


(optional), and a set of methods (optional).
 The scope of the attributes and methods can be
specified (Private, Package, Protected, Public).

Chapter 5 System Modeling 5


Class

Chapter 5 System Modeling 6


Association

 The association relationship describes a relationship


between two classes where one class can use another
class in some way.
 Multiplicity property of the classes must be specified.
 Relationship can be bidirectional (zero or two arrowheads)
or unidirectional relationship (one arrow head).
 It can optionally be assigned a meaningful name to
describe how the two classes are associated.
 A reflexive relationship describes relationship between
one class and itself.

Chapter 5 System Modeling 7


UML classes and association

Chapter 5 System Modeling 8


Classes and associations in the MHC-PMS

9
Exercise: Multiplicity?

 Flight and passenger

 Course and student

 Citizen and national ID

 Customer and reservation

10
Multiplicity Types

Symbol Meaning

0 None
1 One
m An integer value
m, n m or n
0..1 Zero or one
m..n At least m, but not more than n
* Any nonnegative integer (zero or more)
0..* Zero or more (identical to *)
1..* One or more
Reflexive association

A staff member working in an airport may be a pilot,


aviation engineer, a ticket dispatcher, a guard, or a
maintenance crew member. If the maintenance crew
member is supervised by the aviation engineer, there
could be a “supervise” relationship in two instances of
the same class.

Chapter 5 System Modeling 12


Reflexive association

Chapter 5 System Modeling 13


Generalization

 In modeling systems, it is often useful to examine the classes in


a system to see if there is scope for generalization.
 In object-oriented languages, such as Java, generalization is
implemented using the class inheritance mechanisms built into
the language.
 The lower-level classes are subclasses inherit the attributes and
operations from their super classes. These lower-level classes
then add more specific attributes and operations.
 This type of relationship is said to be a “IS-A” relationship.

Chapter 5 System Modeling 14


Generalization hierarchy

Chapter 5 System Modeling 15


Generalization hierarchy with added detail

Chapter 5 System Modeling 16


Generalization hierarchy

Library item

Catalo gue n umber


Acquisition date
Cost
Type
Status
Number of copies
Acquire ()
Catalo gue ()
Dispose ()
Issue ()
Return ()

Pub lished item Recorded item


Title Title
Pub lisher Medium

Book Magazine Film Computer


pro gram
Author Year Director
Edition Date of release Version
Issue
Pub lication da te Distributor Pla tfor m
ISBN
Object class aggregation models

 An aggregation model shows how classes that are


collections are composed of other classes.
 Aggregation and composition associations.

Chapter 5 System Modeling 18


Aggregation association

 The aggregation association is said to be a “HAS-A”


relationship where the owner class owns the owned
class
 Aggregation implies a relationship where the child
can exist independently of the parent.
 The life time of the owned class is independent of the
owner class.
 The whole and the part are created and destroyed at
different times.

Chapter 5 System Modeling 19


Aggregation association

Chapter 5 System Modeling 20


Composition association

 The composition association is said to be a


“WHOLE-PART” relationship where the owner class
owns the owned class
 Composition implies a relationship where the child
cannot exist independent of the parent.
 The life time of the owned class is dependent on the
owner class.
 The whole and the part are created and destroyed at
the same time.

Chapter 5 System Modeling 21


Composition association

Chapter 5 System Modeling 22


Aggregation and composition associations

23
Exercise: Association Type?

24
Entity-Control-Boundary pattern

 When identifying the elements for some scenario of


system behavior, align each element with one of three
key stereotypes: Entity, Control, or Boundary.
 One can walk through a scenario initiated by an external
actor and distribute the responsibility to perform
behavior supporting the scenario to the elements
identified of each type. 

Chapter 5 System Modeling 25


Entity-Control-Boundary pattern

 Entity: Objects representing system data. Entities perform


behavior organized around an amount of data.
 An entity class may need to be created for a table. While the
table holds a record's information permanently, the entity
class will hold the information in memory while the system is
running.

Chapter 5 System Modeling 26


Entity-Control-Boundary pattern

 Boundary: Objects that interface with system actors. Either


"front-end" elements that accept input from outside the area
under design or "back-end" managing communication to
supporting elements outside the area under design.
 Boundary classes lie on the boundary between your system
and the rest of the world.
 These would include all of your forms, reports, interfaces to
hardware such as printers/sensors/cameras/scanners, and
interfaces to other systems.
 At a minimum, there must be one boundary class for every
actor–use case interaction.

Chapter 5 System Modeling 27


Entity-Control-Boundary pattern

 Control: Objects that mediate between boundaries and


entities. It manages interactions between subset of the
elements. 
 Behavior and business rules relating to the information
relevant to the scenario should be assigned to the entities; the
control elements are just responsible for controlling the flow of
the scenario.
 It sends out a lot of messages to delegate responsibility to
the other classes.
 They are sometimes called manager classes.

Chapter 5 System Modeling 28


Appropriate Links

 Control elements can communicate with each of the


other two types.
 Entities and boundary elements should not directly
communicate. 

Chapter 5 System Modeling 29


Hexagonal Architecture Pattern

 The Hexagonal Architecture


partitions objects into one of three
nested hexagons:
Entities in the inner hexagon,
controllers in the middle hexagon,
boundaries in the outer hexagon,
and actors outside of the outer
hexagon.

30
Hexagonal Architecture Pattern

 Actors interact with boundary objects.


 Boundary objects issue commands to controller objects.
 Controller objects may send queries back to the
boundary objects to get more information from the
actors.
 Controllers then update entities.
 Boundaries refresh themselves as needed to reflect
changes among the entities.

31
Entity-Control-Boundary pattern

Chapter 5 System Modeling 32


GUI Class Diagram

Chapter 5 System Modeling 33


Exercise: Class Stereotype?

 userInterface
 securityManager
 patient
 gateway
 customer
 proxy
 transaction
 loginForm
 order
34
Enumeration

 Represents named values.


 Every enumeration literal in an enumeration must have
a unique name that describes the value that it
represents.

Chapter 5 System Modeling 35


Enumeration

Chapter 5 System Modeling 36


Exercise: Specify Enumeration

Chapter 5 System Modeling 37


Research Paper Search Engine

 The goal is to facilitate the steps involved in literature


research. The main objective is to support a
researcher find relevant papers.
 The researcher has to register first, then search using
keywords.
 Moreover, he can upload a paper and receive a
feedback on it.
Example: Google Scholar

Source
Mastering UML with Rational Rose 2002
Source
Mastering UML with Rational Rose 2002
Graduation Projects Tracker

 The goal of this system is to help senior students


manage their graduation project.
 The main services are submission of project
deliverables, grading, evaluation, announcements, and
supplementary course material.
 Moreover, facilitate efficient communication between the
many participants in the graduation project course
including students, supervisors, mentors, examiners and
graduation project committee members.
 Students can organize their deadline submissions with
less effort, supervisors and graduation project committee
can track and monitor students’ transactions instantly.

Source
Mastering UML with Rational Rose 2002
Source
Mastering UML with Rational Rose 2002
Exercises

1. Why do we use class diagrams?


2. What is meant by the hexagonal architecture pattern?
3. What is an enumeration?
4. Differentiate
 Reflexive and generalization associations
 Class multiplicity and stereotype
 Aggregation and composition associations
 Control and boundary classes

43
Thank You

You might also like