You are on page 1of 36

Software Engineering

Fundamentals
CSC-2073
Lecture No. 35
Dr. Muhammad Adeel
Department of Computer Science
National Textile University

dr.muhammad.adeel.ntu@gmail.com
Last Lecture Review

 Function Oriented vs. OO Design


 OO Design Components
‒ Class vs. Object
‒ Abstract Classes
‒ Interfaces

2 Software Engineering - CSC2073


Agenda – What will you Learn Today?

Object Oriented Design

3 Software Engineering - CSC2073


Relationship Among Classes

4 Software Engineering - CSC2073


Relationships Among Classes

 Association
 Aggregation
 Composition
 Inheritance

5 Software Engineering - CSC2073


Association

 It represents a linkage between two classes

 Associations are bi-directional i.e. both


classes are involved in a relationship

 The line is drawn from the containing to the


contained class

6 Software Engineering - CSC2073


Association - Example

Teacher Course
teaches
+ Salary():int * * + Salary():int
+ Leaves():int + Leaves():int
+ Medical():int + Medical():int

7 Software Engineering - CSC2073


Aggregation

 The relationship between the container and


the contained object is called aggregation

 Aggregation is “has - a” relationship

 A weak Association

 Aggregate object can exist independently

8 Software Engineering - CSC2073


Aggregation - Example

Car Wheel
4

9 Software Engineering - CSC2073


Aggregation - Example
Word
Processing
Document

* * Picture

*
Folder

10 Software Engineering - CSC2073


Aggregation - Example
Tables

1..6 White Board


Chair * Class

1
Multimedia

11 Software Engineering - CSC2073


Composition

 The relationship between the “part” objects


and the “whole” object is known as
Composition

 It’s a strong association

 It contains Objects that live and die together

 It is represented by a filled diamond shape


from child to parent class with association
12 Software Engineering - CSC2073
Composition

 The child class's instance lifecycle is


dependent on the parent class's instance
lifecycle

 The part class can only be related to one


instance of the parent class

13 Software Engineering - CSC2073


Composition - Example

Company Department
1 ..
*

14 Software Engineering - CSC2073


Composition - Example

Building

Room

15 Software Engineering - CSC2073


Composition - Example
Head

2 Person 2 Leg
Arm

1
Body

16 Software Engineering - CSC2073


Inheritance

 It implies the functionality of data sharing


between Base and Derived class

 All the data members and methods of base


class are available for use in derived class but
not vice-versa

 Derive class extends the functionality of super


class to use the base class methods

17 Software Engineering - CSC2073


Inheritance - Example
Person
- Name
- Age
- Gender
+ EatFood()
+ Walk()

Student Teacher
- Program - Designation
- StudyYear - Salary
+ Study() + TakeClasses()
+ HeldExam() + takeExam

18 Software Engineering - CSC2073


Inheritance - Example
Person
- Name
- Age
- Gender
+ EatFood()
+ Walk()

Student Teacher
- Program - Designation
- StudyYear - Salary
+ Study() + TakeClasses()
+ HeldExam() + takeExam

19 Software Engineering - CSC2073


Inheritance - Example
Person Doctor
- Name - Designation
- Age - Salary
- Gender
+ CheckUp()
+ EatFood()
+ Prescribe()
+ Walk()

Student Teacher
- Program - Designation
- StudyYear - Salary
+ Study() + TakeClasses()
+ HeldExam() + takeExam

20 Software Engineering - CSC2073


Inheritance - Example
Person
- Name
- Age
- Gender
+ EatFood()
+ Walk()

Student Doctor Teacher


- Program - Designation - Designation
- StudyYear - Salary - Salary
+ Study() + CheckUp() + TakeClasses()
+ HeldExam() + Prescribe() + takeExam

21 Software Engineering - CSC2073


Recap

 Relationship among Classes


1) Association
2) Aggregation
3) Composition
4) Inheritance

22 Software Engineering - CSC2073


Questions

23 Software Engineering - CSC2073


Last Lecture Review

 Relationship among Classes


1) Association
2) Aggregation
3) Composition
4) Inheritance

24 Software Engineering - CSC2073


Agenda – What will you Learn Today?

Abbot’s Textual Analysis Sequence Diagrams

25 Software Engineering - CSC2073


Announcement

 7th July 2021 (SRS)


 14th July 2021
(Design Document)
 28st July 2021
(Test Document)

Course Project Submission


26 Software Engineering - CSC2073
Abbot’s Textual Analysis

27 Software Engineering - CSC2073


Abbot’s Textual Analysis

 “Textual Analysis” is a working technique used


to extract model element information from
unstructured information systematically.”
 It was initially developed by Abbot and then
extended by Graham and others

 In this technique different parts of speech are


identified within the text of the specification
and these parts are modeled using different
components
28 Software Engineering - CSC2073
Abbot’s Textual Analysis

1) A common noun in the informal strategy


suggests a data type

2) A proper noun suggests an object

3) A verb, attribute, predicate, or descriptive


expression suggests an operator

4) The control structures are implied in a


straightforward way by the English
29 Software Engineering - CSC2073
Abbot’s Textual Analysis
Part of Speech Model Component Example
Proper Noun Instance, Object Ahmad
Common Noun Class, Type, Role Student, Teacher
Doing Verb Operation buy
Being Verb Classification is a horse, is a book
Having Verb Composition Fan has wings
Adjective Phrase Association, The customer with
Operation children.
The customer who
bought the Kite.
Intransitive Verb Exception or Event depend

30 Software Engineering - CSC2073


Abbot’s Textual Analysis - Example

 The customer enters the store to buy a toy. He


has to be a toy that his daughter likes and it
must cost less than 50 Euros. He tries a video
game, which uses a data glove and a head-
mounted display. He likes it. An assistant helps
him. The suitability of the game depends on the
age of the child. His daughter is only 3 years
old. The assistant recommends another type of
toy, namely the board game “Monopoly".

31 Software Engineering - CSC2073


Abbot’s Textual Analysis - Example

Example Part Of Speech UML Model


Component
“Monopoly” proper noun object
toy improper noun class
buy doing verb operation
recommend doing verb operation
is-a being verb inheritance
has-a having verb aggregation
must be modal verb constraint
dangerous adjective attribute
enter transitive verb operation
depends on intransitive verb constraint,
association

32 Software Engineering - CSC2073


Abbot’s Textual Analysis - Example
Customer Store

+ enter()

Daughter
- age

Videogame
suitable

Toy
- price
Boardgame +buy()
+ like()

33 Software Engineering - CSC2073


Interaction Diagrams

34 Software Engineering - CSC2073


Interaction Diagrams

 Interaction Diagrams depict the dynamic


behavior of the system

 A set of messages exchanged among a set of


objects

 Often used to model the way a use case is


realized through a sequence of messages
between objects

35 Software Engineering - CSC2073


Purpose of Interaction Diagrams

 Model interactions between objects

 Assist in understanding how a system (a use


case) actually works

 Verify that a use case description can be


supported by the existing classes

 Identify responsibilities/operations and assign


them to classes
36 Software Engineering - CSC2073

You might also like