thanh uml tutorial - queen's university · thanh h. d. nguyen ([email protected])...

20
CICS322 FALL 2009 CICS322 FALL 2009 Wednesday, October1409 Thanh Nguyen Ph.D. Candidate

Upload: others

Post on 11-Oct-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Thanh UML Tutorial - Queen's University · Thanh H. D. Nguyen (thanhnguyen@cs.queensu.ca) Modelling langgguage A modelling language is any artificial language that can be used to

CICS322 FALL 2009CICS322 FALL 2009Wednesday, October‐14‐09

Thanh NguyenPh.D. Candidate

Page 2: Thanh UML Tutorial - Queen's University · Thanh H. D. Nguyen (thanhnguyen@cs.queensu.ca) Modelling langgguage A modelling language is any artificial language that can be used to

ModelA  d l i   i  i     h i l   th ti l    l i l A model in science is a physical, mathematical, or logical 

representation of a system of entities, phenomena, or processes. A model is a simplified abstract view of the complex reality. It may focus on particular views, enforcing p y y p , gthe "divide and conquer" principle for a compound problem.Formally a model is an interpretation which deals with empirical entities, phenomena, and physical processes in a mathematical  or logical way  For the scientist  a model is also mathematical, or logical way. For the scientist, a model is also a way in which the human thought processes can be amplified.Models that are rendered in software allow scientists to leverage computational power to simulate, i li   i l t   d  i  i t iti   b t th   tit  visualize, manipulate and gain intuition about the entity, phenomenon or process being represented. 

‐‐Wikipedia

2Thanh H. D. Nguyen ([email protected])

Page 3: Thanh UML Tutorial - Queen's University · Thanh H. D. Nguyen (thanhnguyen@cs.queensu.ca) Modelling langgguage A modelling language is any artificial language that can be used to

Modelling languageg g gA modelling language is any artificial language that can be used to express information or knowledge or systems in a structure that is defined by a systems in a structure that is defined by a consistent set of rules. The rules are used for interpretation of the meaning of components in the 

 structure. ‐‐Wikipedia

3Thanh H. D. Nguyen ([email protected])

Page 4: Thanh UML Tutorial - Queen's University · Thanh H. D. Nguyen (thanhnguyen@cs.queensu.ca) Modelling langgguage A modelling language is any artificial language that can be used to

Unified Modeling Language (UML)g g gA standardized general‐purpose modeling language in the field of software engineering.

Wiki di‐‐Wikipedia You should learn UML  jobs

4Thanh H. D. Nguyen ([email protected])

Page 5: Thanh UML Tutorial - Queen's University · Thanh H. D. Nguyen (thanhnguyen@cs.queensu.ca) Modelling langgguage A modelling language is any artificial language that can be used to

5Thanh H. D. Nguyen ([email protected])

Page 6: Thanh UML Tutorial - Queen's University · Thanh H. D. Nguyen (thanhnguyen@cs.queensu.ca) Modelling langgguage A modelling language is any artificial language that can be used to

Purpose:  to present a graphical overview of the functionality provided by a system in terms of actors, their goals (represented as use cases)  and any dependencies (represented as use cases), and any dependencies between those use cases.

Contains: Actors Use cases

6Thanh H. D. Nguyen ([email protected])

Page 7: Thanh UML Tutorial - Queen's University · Thanh H. D. Nguyen (thanhnguyen@cs.queensu.ca) Modelling langgguage A modelling language is any artificial language that can be used to

7Thanh H. D. Nguyen ([email protected])

Page 8: Thanh UML Tutorial - Queen's University · Thanh H. D. Nguyen (thanhnguyen@cs.queensu.ca) Modelling langgguage A modelling language is any artificial language that can be used to

8Thanh H. D. Nguyen ([email protected])

Page 9: Thanh UML Tutorial - Queen's University · Thanh H. D. Nguyen (thanhnguyen@cs.queensu.ca) Modelling langgguage A modelling language is any artificial language that can be used to

9Thanh H. D. Nguyen ([email protected])

Page 10: Thanh UML Tutorial - Queen's University · Thanh H. D. Nguyen (thanhnguyen@cs.queensu.ca) Modelling langgguage A modelling language is any artificial language that can be used to

Story: Over beer (or martini) on a Friday night, you and your friends decided to build the next generation of web browser called Web Diving  Web Diving will totally browser called Web Diving. Web Diving will totally change the way people surf the web. It will allow friends and family view website simultaneously while doing id   d  di   h  video and audio chat. 

Tasks: Identify actors Identify actors Identify the use cases Draw a use case diagramg

10Thanh H. D. Nguyen ([email protected])

Page 11: Thanh UML Tutorial - Queen's University · Thanh H. D. Nguyen (thanhnguyen@cs.queensu.ca) Modelling langgguage A modelling language is any artificial language that can be used to

Further reading:g http://www.methodsandtools.com/archive/archive.php?id=24

“Chapter 4  UML Use Case Diagrams”  The Elements  Chapter 4 ‐ UML Use‐Case Diagrams  ‐ The Elements of UML 2.0 Style by Scott W. Ambler

11Thanh H. D. Nguyen ([email protected])

Page 12: Thanh UML Tutorial - Queen's University · Thanh H. D. Nguyen (thanhnguyen@cs.queensu.ca) Modelling langgguage A modelling language is any artificial language that can be used to

Purpose:  depict a high‐level overview of your requirements, depict a high‐level overview of your design,C i Contains: Packages

12Thanh H. D. Nguyen ([email protected])

Page 13: Thanh UML Tutorial - Queen's University · Thanh H. D. Nguyen (thanhnguyen@cs.queensu.ca) Modelling langgguage A modelling language is any artificial language that can be used to

13Thanh H. D. Nguyen ([email protected])

Page 14: Thanh UML Tutorial - Queen's University · Thanh H. D. Nguyen (thanhnguyen@cs.queensu.ca) Modelling langgguage A modelling language is any artificial language that can be used to

14Thanh H. D. Nguyen ([email protected])

Page 15: Thanh UML Tutorial - Queen's University · Thanh H. D. Nguyen (thanhnguyen@cs.queensu.ca) Modelling langgguage A modelling language is any artificial language that can be used to

Story: Turns out that Web Dive will have 5 components. Each 

component is a package as followed: Network: to fetch pages, send authentication packages, …A di   id   h t  i   d   d d d   id   d  di   i l Audio video chat engine: encode and decode video and audio signal

Audio/Video session control engine: manage audio and video chat session, authentication, …

Rendering engine: to render the web pagesRendering engine: to render the web pages Browser control engine: manage the browser session, issue network requests, handle user controls

User interface: to house all the required interface elements

Task: Draw a package diagram with all the possible «call» 

relationshipp

15Thanh H. D. Nguyen ([email protected])

Page 16: Thanh UML Tutorial - Queen's University · Thanh H. D. Nguyen (thanhnguyen@cs.queensu.ca) Modelling langgguage A modelling language is any artificial language that can be used to

Purpose:  shows how processes operate with one another and in what order. 

C t i Contains: Component/Packages/Object Activation boxesActivation boxes Messages

16Thanh H. D. Nguyen ([email protected])

Page 17: Thanh UML Tutorial - Queen's University · Thanh H. D. Nguyen (thanhnguyen@cs.queensu.ca) Modelling langgguage A modelling language is any artificial language that can be used to

17Thanh H. D. Nguyen ([email protected])

Page 18: Thanh UML Tutorial - Queen's University · Thanh H. D. Nguyen (thanhnguyen@cs.queensu.ca) Modelling langgguage A modelling language is any artificial language that can be used to

18Thanh H. D. Nguyen ([email protected])

Page 19: Thanh UML Tutorial - Queen's University · Thanh H. D. Nguyen (thanhnguyen@cs.queensu.ca) Modelling langgguage A modelling language is any artificial language that can be used to

Story:A  i   i   l   h  t i  W b Di  i     As in previous example, each component in Web Dive is a package as followed: Network: to fetch pages, send authentication packages, … Audio video chat engine: encode and decode video and audio signalg g Audio/Video session control engine: manage audio and video chat session, authentication, …

Rendering engine: to render the web pages Browser control engine: manage the browser session  issue network  Browser control engine: manage the browser session, issue network requests, handle user controls

User interface: to house all the required interface elements Task:

Draw a sequence diagram when: The user wants to display a web page The user wants to see the same page with another user

19Thanh H. D. Nguyen ([email protected])

Page 20: Thanh UML Tutorial - Queen's University · Thanh H. D. Nguyen (thanhnguyen@cs.queensu.ca) Modelling langgguage A modelling language is any artificial language that can be used to

Further Readings:g Wikipedia of course UML 2 for Dummies by Michael Jesse Chonoles and James A  Schardt John Wiley & Sons © Chonoles and James A. Schardt, John Wiley & Sons © 2004 (Available online on books 24x7 through the library access)

The Elements of UML 2.0 Style by Scott W. Ambler, Cambridge University Press © 2005 (Available online on books 24x7 through the library access)online on books 24x7 through the library access)

20Thanh H. D. Nguyen ([email protected])