Docsity

**Title: Data Flow Exercises – Complete Data Flow Diagram (DFD) Practice Questions, System, Study notes of Software Engineering

Partial preview of the text

Download **Title: Data Flow Exercises – Complete Data Flow Diagram (DFD) Practice Questions, System and more Study notes Software Engineering in PDF only on Docsity!

OBJECTS

INTRODUCTION

 What is an Object?

 (^) How to Describe an Object

 (^) The components of an object

 Finding Objects - Scenario’s

 Object classification

OBJECT DATA

 Objects contain data like any other data record.

 (^) Data can be of many different types – characters,

strings, integers, booleans, dates etc.

 1 or several data items will identify the data

object;

 Often in object oriented development you will

need to identify objects from scenarios.

 (^) A scenarios is an outline of events which happen

at different times during system execution.

5

THE NEED FOR A CLASS

Class

Object 1 Object 2^ Object 3 Object 4

A ‘class’ is a software

design which

describes the general

properties of

something which the

software is modelling.

Individual

‘objects’ are

created from

the class

design for

each actual

thing

REPRESENTING UML CLASSES

Class Name

Attributes

Operations

EXAMPLE UML CLASS

Car

startEngine()

stopEngine()

changeGear()

EngineStatus

Gear

Speed

Remember that

the class is a

template for creating

objects

CLASS ASSOCIATION CONTN’D

 Association has two possible roles

 Each a direction on the association

 car to person (driven_by) & person to car (drives)

 A role can be labeled

 You can name the role after the target class

 Symbols used in multiplicity include the following

 1 (exactly one)

 n (where n is a single number)

  • (the range 0 to infinity)

 1 .. * (the range 1 to infinity)

 n1 .. n2 (where n1 and n2 are single numbers forming a

range)

 0 .. 1 (zero or one)

MULTIPLICITY EXAMPLE

Car

startEngine()

stopEngine()

changeGear()

EngineStatus

Gear

Speed

Person

driveCar()

Age

Height

1 Driver

One Person associates with one car

NEW CLASS EXAMPLE

Student Module 1..*

studentModuleDetails

studentId, moduleId

attendance, marks

register(),marking()

studentId moduleId

NEW CLASS EXAMPLE

Student Module

studentModuleDetails

moduleId, studentId

attendance, marks

register(),marking()

studentId moduleId

COMPOSITE OBJECTS

 Objects which contain other objects are called composite

objects.

Motorcycle

Frame

Engine

Fuel Tank

Wheels

COMPOSITE OBJECTS

Motorcycle

Frame Wheels Fuel Tank Engine

AGGREGATION CONTN’D

Car Engine

Aggregation

1

Person

Drives

COMPOSITION

 There is a stronger variety of aggregation called

composition

 (^) The part object(s) have no meaning when the

relationship is broken.

 Part object(s) live and die with the whole

 (^) If the COMPONENT OBJECT is detached from

its composite object and can sensibly exist apart

from the Composite Object then the relationship

is aggregation, otherwise it is composition.