SlideShare a Scribd company logo
1 of 27
Download to read offline
Software Engineering Principles
Ajit K Nayak, Ph.D.
ajitnayak@soauniversity.ac.in
Domain & Behavioural Modelling
Acknowledgements
• Slides of Prof. Rajib Mall, IIT, KGP
Domain Modelling
• Represents concepts or objects appearing in the
problem domain.
• Also captures relationships among objects.
• Three types of objects are identified
– Boundary objects
– Entity objects
– Controller objects
• Three different stereotypes on classes are used:
– <<boundary>>
– <<entity>>
– <<control>>
Cashier Interface
Withdrawal
Account
Object Types
• Boundary Objects are objects that Interact with actors:
– User interface objects like screens, menus, forms, dialogs etc.
– Do not perform processing but validates, formats etc.
• Entity Objects are objects that Hold information:
– Such as data tables & files, e.g. Book, BookRegister
– Normally are dumb servers responsible for storing data,
fetching data etc.
– Elementary operations on data such as searching, sorting, etc.
– Entity Objects are identified by examining nouns in problem
description
• Controller Objects Coordinate the activities of a set of entity
objects
– Interface with the boundary objects
– Realizes use case behaviour
– Embody most of the logic involved with the use case
realization
– There can be more than one controller to realize a single use
case
Modelling Behaviours
• A behavioural model
shows the interactions
between objects to
produce some
particular system
behaviour that is
specified as a use-case.
• Sequence diagrams,
Activity diagrams, state
diagrams,
collaboration diagrams
are used to model
interaction between
objects.
• Where are people coming
from?
• Where are they going?
• How do they move from
one space to the other?
Modelling Behaviour
• How do we use the SMS Server interface?
• What is the order of executing the operations?
– sendMessage, getStatus, Resend?
– getStatus, sendMessage, checkForMessages?
• When do we use resend?
• We use Interaction diagrams to model this
Phone
handleMessage(text, reciepient)
SMS Server
sendMessage(sender, text, reciepient):msgID
getStatus(msgID): status
resend(msgID)
checkForMessages(receipient):msgID[]
Sequence Diagrams
• A sequence diagram is an interaction diagram that
shows how objects send messages with one another
and in what order?
Object Control
Corresponding Class Diagram
Message types
• Synchronous message
– Used when the sender waits until
the receiver has finished
processing the message, only
then does the caller continue (i.e.
a blocking call).
• Asynchronous message
– the sender does not wait for the
receiver to finish processing the
message.
– An open arrowhead is used to
indicate that a message is sent
asynchronously.
• Return message
If-Else (Alternatives)
Loops - Iteration
Example 1: Tic-Tac-Toe Computer Game
• A human player and the computer make alternate moves on a
33 square.
• A move consists of marking a previously unmarked square.
• The user inputs a number between 1 and 9 to mark a square
• Whoever is first to place three consecutive marks along a
straight line (i.e., along a row, column, or diagonal) on the
square wins.
• As soon as either of the human player or the computer wins,
– A message announcing the winner should be displayed.
• If neither player manages to get three consecutive marks along
a straight line,
– All the squares on the board are filled up,
– Then the game is drawn.
• The computer always tries to win a game.
Domain Modelling
• Use Case Model
Tic-tac-toe game
Play Move
Player
• Initial and Refined Domain Model
Board
Initial domain model
PlayMoveBoundary PlayMoveController Board
Refined domain model
Sequence Diagram
:playMove
Boundary
:playMove
Controller
:board
move acceptMove checkMoveValidity
[invalidMove]
announceInvalidMove
[invalidMove]
announceInvalidMove
[game over]
announceResult
announceResult
[game over]
checkWinner
playMove
checkWinner
[game over]
announceResult
[game over]
announceResult
getBoardPositionsdisplayBoardPositions
[game not over]
promptNextMove
Class Diagram
Board
int position[9]
checkMove Validity
checkResult
playMove
Controller
announceInvalidMove
announceResult
PlayMoveBoundary
announceInvalidMove
announceResult
displayBoard
Supermarket Prize Scheme - I
• Supermarket needs to develop software to encourage
regular customers.
• Customer needs to supply his:
– Residence address, telephone number, and the
driving licence number.
• Each customer who registers is:
– Assigned a unique customer number (CN) by the
computer.
• A customer can present his CN to the staff when he
makes any purchase.
– The value of his purchase is credited against his CN.
Supermarket Prize Scheme - II
• At the end of each year:
– The supermarket awards surprise gifts to ten
customers who make highest purchase.
• Also, it awards a 22 carat gold coin to every customer:
– Whose purchases exceed Rs. 10,000.
• The entries against the CN are reset:
– On the last day of every year after the prize winner’s
lists are generated.
Use Case Model
Supermarket
Prize scheme
register
customer
register
sales
select
winners
Customer
Sales Clerk
Manager
Clerk
Initial Domain Model
SalesHistory
SalesRecords
1
*
CustomerRecord
CustomerRegister
1
*
Refined Domain Model
SalesHistory
SalesRecords
1
*
CustomerRecord
CustomerRegister
1
*
RegisterCustomerBoundary
RegisterSalesBoundary
SelectWinnersBoundary
RegisterCustomerController
RegisterSalesController
SelectWinnersControllers
Sequence Diagram:Select Winners
Use Case
:SelectWinner
Boundary
:SelectWinner
Controller
:Sales
History
:Sales
Record
:Customer
Register
:Customer
Record
Select
Winners
SelectWinners
announces
SelectWinners
*computeSales
*browse
[for each winner]
find WinnerDetails [for each winner]
browse
Sequence Diagram: Register Customer
Use Case
:RegisterCustomer
Boundary
:RegisterCustomer
Controller
:Customer
Register
:Customer
Record
register
register
*match
displayCIN
create
:Customer
Record
checkDuplicate
[duplicate]
showError
generateCIN
register
showError
Sequence Diagram: Register Sales
Use Case
:Sales
Record
create
RegisterSales
:Register
Sales
Boundary
:Sales
History
:Register
Sales
Controller
registerSales
confirm
registerSales
confirm
Sequence Diagram: Refined Register
Sales Use Case
:Register
Sales
Boundary
:Sales
History
registerSales
confirm
:Sales
Record
create
RegisterSales
Class Diagram
SalesHistory
selectWinners
registerSales
CustomerRegister
findWinnerDetails
register
SalesRecords
computerSales
browse
create
salesDetails
CustomerRecord
browse
checkDuplicate
create
name
address
1
*
1
*
Thank You

More Related Content

What's hot

Prototype model
Prototype modelPrototype model
Prototype model
sadhana8
 
Uml Presentation
Uml PresentationUml Presentation
Uml Presentation
mewaseem
 

What's hot (20)

Interaction Modeling
Interaction ModelingInteraction Modeling
Interaction Modeling
 
Chapter 4 software project planning
Chapter 4 software project planningChapter 4 software project planning
Chapter 4 software project planning
 
Unified process Model
Unified process ModelUnified process Model
Unified process Model
 
Taxonomy for bugs
Taxonomy for bugsTaxonomy for bugs
Taxonomy for bugs
 
UML
UMLUML
UML
 
COCOMO model
COCOMO modelCOCOMO model
COCOMO model
 
Context model
Context modelContext model
Context model
 
Relational algebra ppt
Relational algebra pptRelational algebra ppt
Relational algebra ppt
 
Evolving role of Software,Legacy software,CASE tools,Process Models,CMMI
Evolving role of Software,Legacy software,CASE tools,Process Models,CMMIEvolving role of Software,Legacy software,CASE tools,Process Models,CMMI
Evolving role of Software,Legacy software,CASE tools,Process Models,CMMI
 
Sequence diagram
Sequence diagramSequence diagram
Sequence diagram
 
15 puzzle problem using branch and bound
15 puzzle problem using branch and bound15 puzzle problem using branch and bound
15 puzzle problem using branch and bound
 
Software design, software engineering
Software design, software engineeringSoftware design, software engineering
Software design, software engineering
 
Prototype model
Prototype modelPrototype model
Prototype model
 
Object Oriented Modeling and Design with UML
Object Oriented Modeling and Design with UMLObject Oriented Modeling and Design with UML
Object Oriented Modeling and Design with UML
 
Spiral Model
Spiral ModelSpiral Model
Spiral Model
 
Uml diagrams
Uml diagramsUml diagrams
Uml diagrams
 
Uml Presentation
Uml PresentationUml Presentation
Uml Presentation
 
Object Oriented Technologies
Object Oriented TechnologiesObject Oriented Technologies
Object Oriented Technologies
 
Object Oriented Analysis Design using UML
Object Oriented Analysis Design using UMLObject Oriented Analysis Design using UML
Object Oriented Analysis Design using UML
 
Software Process Models
Software Process ModelsSoftware Process Models
Software Process Models
 

Viewers also liked

Viewers also liked (11)

UML Part1-Introduction Mansouri
UML Part1-Introduction MansouriUML Part1-Introduction Mansouri
UML Part1-Introduction Mansouri
 
Software Engineering an Introduction
Software Engineering an IntroductionSoftware Engineering an Introduction
Software Engineering an Introduction
 
Software Engineering :UML class diagrams
Software Engineering :UML class diagramsSoftware Engineering :UML class diagrams
Software Engineering :UML class diagrams
 
Software Engineering : Requirement Analysis & Specification
Software Engineering : Requirement Analysis & SpecificationSoftware Engineering : Requirement Analysis & Specification
Software Engineering : Requirement Analysis & Specification
 
Types of UML diagrams
Types of UML diagramsTypes of UML diagrams
Types of UML diagrams
 
Software Engineering : OOAD using UML
Software Engineering : OOAD using UMLSoftware Engineering : OOAD using UML
Software Engineering : OOAD using UML
 
Lecture04- Use Case Diagrams
Lecture04- Use Case DiagramsLecture04- Use Case Diagrams
Lecture04- Use Case Diagrams
 
Software Engineering :Behavioral Modelling - II State diagram
Software Engineering :Behavioral Modelling - II State diagramSoftware Engineering :Behavioral Modelling - II State diagram
Software Engineering :Behavioral Modelling - II State diagram
 
Introduction to UML
Introduction to UMLIntroduction to UML
Introduction to UML
 
Uml - An Overview
Uml - An OverviewUml - An Overview
Uml - An Overview
 
Use Case Diagram
Use Case DiagramUse Case Diagram
Use Case Diagram
 

Similar to Software Engineering :Behavioral Modelling - I Sequence diagram

Android webinar class_4
Android webinar class_4Android webinar class_4
Android webinar class_4
Edureka!
 
Intro to javascript (5:2)
Intro to javascript (5:2)Intro to javascript (5:2)
Intro to javascript (5:2)
Thinkful
 
Intro to javascript (6:19)
Intro to javascript (6:19)Intro to javascript (6:19)
Intro to javascript (6:19)
Thinkful
 

Similar to Software Engineering :Behavioral Modelling - I Sequence diagram (20)

Monitoring Complex Systems: Keeping Your Head on Straight in a Hard World
Monitoring Complex Systems: Keeping Your Head on Straight in a Hard WorldMonitoring Complex Systems: Keeping Your Head on Straight in a Hard World
Monitoring Complex Systems: Keeping Your Head on Straight in a Hard World
 
FFW Gabrovo PMG - JavaScript 1
FFW Gabrovo PMG - JavaScript 1FFW Gabrovo PMG - JavaScript 1
FFW Gabrovo PMG - JavaScript 1
 
Lecture 2 role of algorithms in computing
Lecture 2   role of algorithms in computingLecture 2   role of algorithms in computing
Lecture 2 role of algorithms in computing
 
Qtp - Introduction to synchronization
Qtp -  Introduction to synchronizationQtp -  Introduction to synchronization
Qtp - Introduction to synchronization
 
Android webinar class_4
Android webinar class_4Android webinar class_4
Android webinar class_4
 
Enterprise Application Architectures by Dr. Indika Kumara
Enterprise Application Architectures by Dr. Indika KumaraEnterprise Application Architectures by Dr. Indika Kumara
Enterprise Application Architectures by Dr. Indika Kumara
 
Алексей Ященко и Ярослав Волощук "False simplicity of front-end applications"
Алексей Ященко и Ярослав Волощук "False simplicity of front-end applications"Алексей Ященко и Ярослав Волощук "False simplicity of front-end applications"
Алексей Ященко и Ярослав Волощук "False simplicity of front-end applications"
 
SBJUG - Building Beautiful Batch Jobs
SBJUG - Building Beautiful Batch JobsSBJUG - Building Beautiful Batch Jobs
SBJUG - Building Beautiful Batch Jobs
 
MobX: the way to simplicity
MobX: the way to simplicityMobX: the way to simplicity
MobX: the way to simplicity
 
Intro to javascript (5:2)
Intro to javascript (5:2)Intro to javascript (5:2)
Intro to javascript (5:2)
 
MATLAB & Image Processing
MATLAB & Image ProcessingMATLAB & Image Processing
MATLAB & Image Processing
 
Intro to javascript (6:19)
Intro to javascript (6:19)Intro to javascript (6:19)
Intro to javascript (6:19)
 
Introduction to C ++.pptx
Introduction to C ++.pptxIntroduction to C ++.pptx
Introduction to C ++.pptx
 
Metric and Dashboard
Metric and DashboardMetric and Dashboard
Metric and Dashboard
 
Intro To C++ - Cass 11 - Converting between types, formatting floating point,...
Intro To C++ - Cass 11 - Converting between types, formatting floating point,...Intro To C++ - Cass 11 - Converting between types, formatting floating point,...
Intro To C++ - Cass 11 - Converting between types, formatting floating point,...
 
Intro To C++ - Class 11 - Converting between types, formatting floating point...
Intro To C++ - Class 11 - Converting between types, formatting floating point...Intro To C++ - Class 11 - Converting between types, formatting floating point...
Intro To C++ - Class 11 - Converting between types, formatting floating point...
 
Xamarin 9/10 San Diego Meetup
Xamarin 9/10 San Diego MeetupXamarin 9/10 San Diego Meetup
Xamarin 9/10 San Diego Meetup
 
98 374 Lesson 04-slides
98 374 Lesson 04-slides98 374 Lesson 04-slides
98 374 Lesson 04-slides
 
Intro to javascript (6:27)
Intro to javascript (6:27)Intro to javascript (6:27)
Intro to javascript (6:27)
 
AWS re:Invent 2016: How Fulfillment by Amazon (FBA) and Scopely Improved Resu...
AWS re:Invent 2016: How Fulfillment by Amazon (FBA) and Scopely Improved Resu...AWS re:Invent 2016: How Fulfillment by Amazon (FBA) and Scopely Improved Resu...
AWS re:Invent 2016: How Fulfillment by Amazon (FBA) and Scopely Improved Resu...
 

More from Ajit Nayak

More from Ajit Nayak (20)

Software Engineering : Software testing
Software Engineering : Software testingSoftware Engineering : Software testing
Software Engineering : Software testing
 
Software Engineering : Process Models
Software Engineering : Process ModelsSoftware Engineering : Process Models
Software Engineering : Process Models
 
Database Programming using SQL
Database Programming using SQLDatabase Programming using SQL
Database Programming using SQL
 
Ns2: Introduction - Part I
Ns2: Introduction - Part INs2: Introduction - Part I
Ns2: Introduction - Part I
 
Ns2: OTCL - PArt II
Ns2: OTCL - PArt IINs2: OTCL - PArt II
Ns2: OTCL - PArt II
 
NS2: AWK and GNUplot - PArt III
NS2: AWK and GNUplot - PArt IIINS2: AWK and GNUplot - PArt III
NS2: AWK and GNUplot - PArt III
 
Socket programming using C
Socket programming using CSocket programming using C
Socket programming using C
 
Parallel programming using MPI
Parallel programming using MPIParallel programming using MPI
Parallel programming using MPI
 
Operating Systems Part III-Memory Management
Operating Systems Part III-Memory ManagementOperating Systems Part III-Memory Management
Operating Systems Part III-Memory Management
 
Operating Systems Part I-Basics
Operating Systems Part I-BasicsOperating Systems Part I-Basics
Operating Systems Part I-Basics
 
Operating Systems Part II-Process Scheduling, Synchronisation & Deadlock
Operating Systems Part II-Process Scheduling, Synchronisation & DeadlockOperating Systems Part II-Process Scheduling, Synchronisation & Deadlock
Operating Systems Part II-Process Scheduling, Synchronisation & Deadlock
 
Introduction to database-Transaction Concurrency and Recovery
Introduction to database-Transaction Concurrency and RecoveryIntroduction to database-Transaction Concurrency and Recovery
Introduction to database-Transaction Concurrency and Recovery
 
Introduction to database-Formal Query language and Relational calculus
Introduction to database-Formal Query language and Relational calculusIntroduction to database-Formal Query language and Relational calculus
Introduction to database-Formal Query language and Relational calculus
 
Introduction to database-Normalisation
Introduction to database-NormalisationIntroduction to database-Normalisation
Introduction to database-Normalisation
 
Introduction to database-ER Model
Introduction to database-ER ModelIntroduction to database-ER Model
Introduction to database-ER Model
 
Computer Networks Module III
Computer Networks Module IIIComputer Networks Module III
Computer Networks Module III
 
Computer Networks Module II
Computer Networks Module IIComputer Networks Module II
Computer Networks Module II
 
Computer Networks Module I
Computer Networks Module IComputer Networks Module I
Computer Networks Module I
 
Object Oriented Programming using C++ Part III
Object Oriented Programming using C++ Part IIIObject Oriented Programming using C++ Part III
Object Oriented Programming using C++ Part III
 
Object Oriented Programming using C++ Part I
Object Oriented Programming using C++ Part IObject Oriented Programming using C++ Part I
Object Oriented Programming using C++ Part I
 

Recently uploaded

Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
Kamal Acharya
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
Epec Engineered Technologies
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
HenryBriggs2
 

Recently uploaded (20)

AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech students
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Moment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilMoment Distribution Method For Btech Civil
Moment Distribution Method For Btech Civil
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
Introduction to Data Visualization,Matplotlib.pdf
Introduction to Data Visualization,Matplotlib.pdfIntroduction to Data Visualization,Matplotlib.pdf
Introduction to Data Visualization,Matplotlib.pdf
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptxOrlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdf
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
 

Software Engineering :Behavioral Modelling - I Sequence diagram

  • 1. Software Engineering Principles Ajit K Nayak, Ph.D. ajitnayak@soauniversity.ac.in Domain & Behavioural Modelling
  • 2. Acknowledgements • Slides of Prof. Rajib Mall, IIT, KGP
  • 3. Domain Modelling • Represents concepts or objects appearing in the problem domain. • Also captures relationships among objects. • Three types of objects are identified – Boundary objects – Entity objects – Controller objects • Three different stereotypes on classes are used: – <<boundary>> – <<entity>> – <<control>> Cashier Interface Withdrawal Account
  • 4. Object Types • Boundary Objects are objects that Interact with actors: – User interface objects like screens, menus, forms, dialogs etc. – Do not perform processing but validates, formats etc. • Entity Objects are objects that Hold information: – Such as data tables & files, e.g. Book, BookRegister – Normally are dumb servers responsible for storing data, fetching data etc. – Elementary operations on data such as searching, sorting, etc. – Entity Objects are identified by examining nouns in problem description • Controller Objects Coordinate the activities of a set of entity objects – Interface with the boundary objects – Realizes use case behaviour – Embody most of the logic involved with the use case realization – There can be more than one controller to realize a single use case
  • 5. Modelling Behaviours • A behavioural model shows the interactions between objects to produce some particular system behaviour that is specified as a use-case. • Sequence diagrams, Activity diagrams, state diagrams, collaboration diagrams are used to model interaction between objects. • Where are people coming from? • Where are they going? • How do they move from one space to the other?
  • 6. Modelling Behaviour • How do we use the SMS Server interface? • What is the order of executing the operations? – sendMessage, getStatus, Resend? – getStatus, sendMessage, checkForMessages? • When do we use resend? • We use Interaction diagrams to model this Phone handleMessage(text, reciepient) SMS Server sendMessage(sender, text, reciepient):msgID getStatus(msgID): status resend(msgID) checkForMessages(receipient):msgID[]
  • 7. Sequence Diagrams • A sequence diagram is an interaction diagram that shows how objects send messages with one another and in what order?
  • 10. Message types • Synchronous message – Used when the sender waits until the receiver has finished processing the message, only then does the caller continue (i.e. a blocking call). • Asynchronous message – the sender does not wait for the receiver to finish processing the message. – An open arrowhead is used to indicate that a message is sent asynchronously. • Return message
  • 13. Example 1: Tic-Tac-Toe Computer Game • A human player and the computer make alternate moves on a 33 square. • A move consists of marking a previously unmarked square. • The user inputs a number between 1 and 9 to mark a square • Whoever is first to place three consecutive marks along a straight line (i.e., along a row, column, or diagonal) on the square wins. • As soon as either of the human player or the computer wins, – A message announcing the winner should be displayed. • If neither player manages to get three consecutive marks along a straight line, – All the squares on the board are filled up, – Then the game is drawn. • The computer always tries to win a game.
  • 14. Domain Modelling • Use Case Model Tic-tac-toe game Play Move Player • Initial and Refined Domain Model Board Initial domain model PlayMoveBoundary PlayMoveController Board Refined domain model
  • 15. Sequence Diagram :playMove Boundary :playMove Controller :board move acceptMove checkMoveValidity [invalidMove] announceInvalidMove [invalidMove] announceInvalidMove [game over] announceResult announceResult [game over] checkWinner playMove checkWinner [game over] announceResult [game over] announceResult getBoardPositionsdisplayBoardPositions [game not over] promptNextMove
  • 16. Class Diagram Board int position[9] checkMove Validity checkResult playMove Controller announceInvalidMove announceResult PlayMoveBoundary announceInvalidMove announceResult displayBoard
  • 17. Supermarket Prize Scheme - I • Supermarket needs to develop software to encourage regular customers. • Customer needs to supply his: – Residence address, telephone number, and the driving licence number. • Each customer who registers is: – Assigned a unique customer number (CN) by the computer. • A customer can present his CN to the staff when he makes any purchase. – The value of his purchase is credited against his CN.
  • 18. Supermarket Prize Scheme - II • At the end of each year: – The supermarket awards surprise gifts to ten customers who make highest purchase. • Also, it awards a 22 carat gold coin to every customer: – Whose purchases exceed Rs. 10,000. • The entries against the CN are reset: – On the last day of every year after the prize winner’s lists are generated.
  • 19. Use Case Model Supermarket Prize scheme register customer register sales select winners Customer Sales Clerk Manager Clerk
  • 22. Sequence Diagram:Select Winners Use Case :SelectWinner Boundary :SelectWinner Controller :Sales History :Sales Record :Customer Register :Customer Record Select Winners SelectWinners announces SelectWinners *computeSales *browse [for each winner] find WinnerDetails [for each winner] browse
  • 23. Sequence Diagram: Register Customer Use Case :RegisterCustomer Boundary :RegisterCustomer Controller :Customer Register :Customer Record register register *match displayCIN create :Customer Record checkDuplicate [duplicate] showError generateCIN register showError
  • 24. Sequence Diagram: Register Sales Use Case :Sales Record create RegisterSales :Register Sales Boundary :Sales History :Register Sales Controller registerSales confirm registerSales confirm
  • 25. Sequence Diagram: Refined Register Sales Use Case :Register Sales Boundary :Sales History registerSales confirm :Sales Record create RegisterSales