SWE © Solomon Seifu 2010 1 Lesson 3 Fundamentals of OO & UML.

Slides:



Advertisements
Similar presentations
Use Case Diagrams.
Advertisements

CPSC 333: Foundations of Software EngineeringJ. Denzinger 2.2. Use Cases: Scenario based requirements modeling Recommended: Booch, Rumbaugh, Jacobson:
Chapter 22 Object-Oriented Systems Analysis and Design and UML Systems Analysis and Design Kendall and Kendall Fifth Edition.
Unified Modeling Language
Use Case Diagram © copyright 2001 SNU OOPSLA Lab..
Object-Oriented Analysis and Design
2-1 © Prentice Hall, 2007 Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph.
Introduction To System Analysis and Design
Use-case Modeling.
1 Software Testing and Quality Assurance Lecture 12 - The Testing Perspective (Chapter 2, A Practical Guide to Testing Object-Oriented Software)
The Unified Software Development Process - Workflows Ivar Jacobson, Grady Booch, James Rumbaugh Addison Wesley, 1999.
Irwin/McGraw-Hill Copyright © 2004 The McGraw-Hill Companies. All Rights reserved Whitten Bentley DittmanSYSTEMS ANALYSIS AND DESIGN METHODS6th Edition.
Documenting Requirements using Use Case Diagrams
C++ Training Datascope Lawrence D’Antonio Lecture 11 UML.
© Copyright Eliyahu Brutman Programming Techniques Course.
Unified Modeling Language 7/12/2015B.Ramamurthy1 The Unified Modeling Language™ (UML) was developed jointly by Grady Booch, Ivar Jacobson, and Jim Rumbaugh.
Developed by Reneta Barneva, SUNY Fredonia Component Level Design.
Sharif University of Technology Session # 7.  Contents  Systems Analysis and Design  Planning the approach  Asking questions and collecting data 
Introduction to Software Design Chapter 1. Chapter 1: Introduction to Software Design2 Chapter Objectives To become familiar with the software challenge.
Use Case Diagram.
Basic Concepts The Unified Modeling Language (UML) SYSC System Analysis and Design.
Introduction To System Analysis and design
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 20 Object-Oriented.
SWE © Solomon Seifu ELABORATION. SWE © Solomon Seifu Lesson 11 Subsystem Design.
1 Object orientation. 2 What benefits does OO give? Primarily –Encapsulation (Associates data & operations) –Types & specialisation –Software re-use.
Introduction To System Analysis and Design
Requirements Analysis Visual Modeling] Lab 02 Visual Modeling (from Visual Modeling with Rational Rose and UML) A way of thinking about problems using.
SWE © Solomon Seifu ELABORATION. SWE © Solomon Seifu Lesson 10 Use Case Design.
Copyright 2002 Prentice-Hall, Inc. Chapter 2 Object-Oriented Analysis and Design Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey.
Programming Logic and Design Fourth Edition, Comprehensive Chapter 15 System Modeling with the UML.
Kyung Hee University System Functional Model OOSD 담당조교 석사과정 이정환.
UML diagrams What is UML UML diagrams –Static modeoing –Dynamic modeling 1.
UML Use Case Diagramming Guidelines. What is UML? The Unified Modeling Language (UML) is a standard language for specifying, visualizing, constructing,
® IBM Software Group © 2006 IBM Corporation Writing Good Use Cases Module 1: Introduction to Use-Case Modeling.
Faculty of Applied Engineering and Urban Planning Software Engineering Department Software Engineering Lab Use Cases Faculty of Information system Technology.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 4 Slide 1 Slide 1 Use Case Diagrams.
1 System Analysis and Design Using UML INSTRUCTOR: Jesmin Akhter Lecturer, IIT, JU.
Discovering object interaction. Use case realisation The USE CASE diagram presents an outside view of the system. The functionality of the use case is.
Use Case Diagram The purpose is to communicate the system’s functionality and behaviour to the customer or end user. Mainly used for capturing user requirements.
CIS 112 Exam Review. Exam Content 100 questions valued at 1 point each 100 questions valued at 1 point each 100 points total 100 points total 10 each.
UML as a Specification Language for Embedded Systems. By, Mir Ahmed Ali, Asst. Professor, ECM department, SNIST. By, Prof. Narsiah sir, Director of School.
Design Model Lecture p6 T120B pavasario sem.
Introduction to UML CS A470. What is UML? Unified Modeling Language –OMG Standard, Object Management Group –Based on work from Booch, Rumbaugh, Jacobson.
1 Class Diagrams. 2 Overview Class diagrams are the most commonly used diagrams in UML. Class diagrams are for visualizing, specifying and documenting.
Chapter 5 System Modeling. What is System modeling? System modeling is the process of developing abstract models of a system, with each model presenting.
Lecture 14 22/10/15. The Object-Oriented Analysis and Design  Process of progressively developing representation of a system component (or object) through.
CHAPTER 3 MODELING COMPONENT-LEVEL DESIGN.
UML (Unified Modeling Language)
Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey A.
UML Review of Use case diagrams. 2 Unified Modeling Language The Unified Modeling Language™ (UML) was developed jointly by Grady Booch, Ivar Jacobson,
UML - Development Process 1 Software Development Process Using UML.
UML Course Instructor: Rizwana Noor. Overview  Modeling  What is UML?  Why UML?  UML Diagrams  Use Case  Components  Relationships  Notations.
 What to do if you want to build a new house? › Buy a bunch of wood and nails and start immediately. › Or, put some blueprints to follow, and plan of.
1 BTS330 Visual Modeling. What is Visual Modeling? 2 Copyright © 1997 by Rational Software Corporation Computer System Business Process Order Item Ship.
UML Fundamental Elements. Structural Elements Represent abstractions in our system. Elements that encapsulate the system's set of behaviors. Structural.
Ondřej Přibyl Faculty of Transportation Sciences, CTU DESIGN OF ITS SYSTEMS Project support 1 3 PROJECT SUPPORT Use cases.
Systems Analysis and Design in a Changing World, Fourth Edition
UML Diagrams By Daniel Damaris Novarianto S..
Lec-5 : Use Case Diagrams
Course Outcomes of Object Oriented Modeling Design (17630,C604)
Object-Oriented Analysis and Design
Unified Modeling Language
UML Diagrams Jung Woo.
Use Cases CS/SWE 421 Introduction to Software Engineering Dan Fleck
Software Design Lecture : 15.
Software Design Lecture : 14.
Use Case Model Use case diagram – Part 2.
Software Engineering System Modeling Chapter 5 (Part 1) Dr.Doaa Sami
Chapter 22 Object-Oriented Systems Analysis and Design and UML
Presentation transcript:

SWE © Solomon Seifu Lesson 3 Fundamentals of OO & UML

SWE © Solomon Seifu SWE: Principles of OO Encapsulation  The implementation is hidden behind an interface, and clients only depend on the interface Inheritance/Hierarchy  Different levels of abstraction that can be used to factor out common functionality Polymorphism  The ability of an object to respond appropriately to the same message based on what kind of an object it is

SWE © Solomon Seifu SWE: Principles of OO (Cont.) Open/Closed principle says the code should be closed for modification but open for extension Liskov substitution principle says wherever you use the parent class you can use the child class Programming to the interface means declaring your variables, parameters, and return types to be of the interface type, rather than of any specific implementation type

SWE © Solomon Seifu SWE: Principles of OO - Encapsulation Implementation Interface Client Implementation is hidden from client via the interface

SWE © Solomon Seifu 2010 SWE: Principles of OO - Inheritance or Hierarchy Person StudentFaculty Part-time StudentFull-time StudentInstructorProfessor Is there really an IS-A relationship or a role play?

SWE © Solomon Seifu SWE: Principles of OO - Polymorphism Shape computeArea() Circle computeArea() Square computeArea() Rectangle computeArea() Area = PI * r * r Area = s * s Area = w * l

SWE © Solomon Seifu Fundamentals Of OO Exercise

SWE © Solomon Seifu Fundamentals of OO Exercise Answer

SWE © Solomon Seifu The Unified Modeling Language (UML)

SWE © Solomon Seifu SWE: Unified Modeling Language (UML ) Almost all successful software systems are built from models A model is a simple representation of something complex A model makes it possible for those who want to build a system to visualize it It is a way to specify what the system is to do and to guide the construction of the system A model creates a common language, or a common way of understanding

SWE © Solomon Seifu SWE: UML (Cont.) The UML provides a set of elements that allow you to model software systems It is a general-purpose modeling language It offers a set of diagrams, views, and modeling elements that help you do the following:  Analyze the requirements you have gathered  Design software using your requirements  Document the software you have developed  Develop test cases  Plan product releases  Discuss and conceptualize software

SWE © Solomon Seifu SWE: UML - Diagrams Types Use Case Activity Class Object State Chart Sequence Collaboration Component Deployment Package Communication Use caseActivity ObjectDeployment StateSequence Component Class Models Package Behavior diagram InteractionTiming Interaction diagrams Are of type behavior diagrams Structure diagram

SWE © Solomon Seifu Use Cases: A use case is a sequence of actions a system performs that yields an observable result of value to a particular actor.

SWE © Solomon Seifu SWE: UML - Use Cases Requirements come in all shapes and forms and from a variety of sources Projects often fail because the requirements were not accurately understood The first thing to do is to make sure the basic requirements are understood This is where use cases come in. You can apply use case modeling to develop a precise model of what is required of the system

SWE © Solomon Seifu SWE: UML - Use Cases (Cont.) Ivar Jacobson et.al., popularized the application of use cases for understanding the functional requirements of a system in the early 1990s Use Cases are a widely used technique for requirements specification as part of the Unified Modeling Language (UML) A use case describes things actors want the system to do

SWE © Solomon Seifu SWE: UML - Use Cases (Cont.) According to RUP, a Use Case "…fully describes a sequence of actions performed by a system to provide an observable result of value to a person or another system using the product under development." Use cases tell the customer what to expect, the developer what to code, the technical writer what to document, and the tester what to test

SWE © Solomon Seifu SWE: UML - Use Cases (Cont.) There are two fundamental concepts in use case modeling:  Actor – An actor represents something (or someone) outside the system, typically a user of the system. Actors interact with the system, which results in some action by the system. Each distinct role is represented by an actor  Use case – A use case encapsulates a sequence of steps performed by the system on behalf of an actor. Use cases provide something of value to the actor. A use case consists of primary sequence of events and may have one or more alternate sequence of events

SWE © Solomon Seifu SWE: UML - Use Cases (Cont.) Use cases reside inside the system A use case describes the actions the system takes to deliver to the actor Taken together, all use cases constitute all ways of using the system Is an abstraction of a set of sequences that yield some functionality

SWE © Solomon Seifu SWE: UML - Use Cases (Cont.) Represents some user-visible function Is always initiated by an “actor” Describes the interaction between the actors and the system for a system function Achieves a discrete goal for the actor

SWE © Solomon Seifu SWE: UML - Purpose of Use Cases To capture functional requirements of a system To communicate with end users and domain experts To design test cases for validating system functionality To provide traceability from requirements into actual classes and operations To drive the development process To plan iterations and releases

SWE © Solomon Seifu SWE: UML - Use Cases (Identifying the Actors) As you read the description or gather requirements for a project, ask yourself a few important questions:  Who will use this functionality?  Who is supplying or obtaining information?  Who can change the information?  Are there any other systems that interact with the system being developed?

SWE © Solomon Seifu SWE: UML - Use Cases (Identifying the Actors) (Cont.) An actor can be a person; but it may also be another system, or perhaps a device such as a printer An actor may even be a signal or event to which you must respond. From a component design perspective, you might model the clients of your component as actors, even though those are “the system” from the perspective of the designers of those components. (And conversely, of course, your component is an actor from their perspectives.)

SWE © Solomon Seifu SWE: UML - Use Cases (Identifying the Actors) (Cont.) Who uses the main functionality of the system? Which hardware devices the system needs to handle? Which other systems does the system need to interact with? What nouns/subjects are used to describe the system? For example:  The Reservation Clerk makes a booking using the system, based on the...  A user must login in order to save his itinerary

SWE © Solomon Seifu SWE: UML - Use Cases (Finding Use Cases) What functions does the system perform? What functions do the “actors” require? What input/output does the system need? What verbs are used to describe the system? For example:  The Reservation Clerk makes a booking using the system, based on the...  The Airport Manager can make an entry for a new flight. He can also modify flight details, provided...

SWE © Solomon Seifu SWE: UML - Use Cases (Finding Use Cases) (Cont.) Use cases are always expressed from the perspective of the actor (that is, the user of the system) The idea is to capture the sequence of events performed by the system at the requests of the actor, such that they yield some observable, valuable results to the actors

SWE © Solomon Seifu Use Case Diagram

SWE © Solomon Seifu SWE: UML - Use Case Diagram In the UML, actors are represented by a stick figure, and use cases are shown as ellipses A use case diagram simply shows the structural relationships between the actors and the use cases, not the dynamic relationships The relationship between actors and use cases is shown via a non-directional association even though indicating source of invocation is always the actor

SWE © Solomon Seifu SWE: UML - Use Case Diagram (Cont.) Use Case 1 Use Case 2 Actor System Boundary Invoking a use case

SWE © Solomon Seifu SWE: UML - Use Case Diagram (Inheritance Between Actors) An actor in a use case diagram can inherit another actor The standard UML notation for inheritance, the open- headed arrow, is used and the advice presented about the appropriate use of inheritance still applies:  it should make sense to say the inheriting actor is or is like the inherited actor User Super User Regular User

SWE © Solomon Seifu SWE: UML - Use Case Organization Organize Related Use Cases in Packages  Semantically related groups  Development groups etc.

SWE © Solomon Seifu SWE: UML - Use Case Relationship The UML notation provides the following relationships, which can be used to model reuse within use cases They are:  Include  Extend  Inherits

SWE © Solomon Seifu SWE: UML - Use Case (Include or Uses) An include relationship allows you to capture a common piece of functionality in a separate use case, and then “include” the use case in another use case via the include relationship The include relationship is shown as a dependency relationship stereotyped as > Base Use Case Inclusion Use Case >

SWE © Solomon Seifu SWE: UML - Use Case (Include Example) Borrow copy of book Extend loan Check for reservation Book Borrower >

SWE © Solomon Seifu SWE: UML - Use Case (Include yet Another Example) LogIn CheckOrderStatus > The following figure illustrates an e- commerce application that provides customers with the option of checking the status of their orders. This behavior is modeled with a base use case called CheckOrderStatus that has an inclusion use case called LogIn. The LogIn use case is a separate inclusion use case because it contains behaviors that several other use cases in the system use. An include relationship points from the CheckOrderStatus use case to the LogIn use case to indicate that the CheckOrderStatus use case always includes the behaviors in the LogIn use case.

SWE © Solomon Seifu SWE: UML - Use Case (Extend) An extend relationship allows you to model optional behavior for a use case. That is, you can capture some behavior in a separate use case and, within another use case, indicate the exact points (called extension points) where the separate use case may optionally be invoked as part of the use case An extend relationship is modeled as a dependency and stereotyped as > Base Use Case Extension Use Case >

SWE © Solomon Seifu SWE: UML - Use Case (Extend Example) Take Customer Order Sales Assistant Sell Customer-Specific Product >

SWE © Solomon Seifu SWE: UML - Use Case (Extend yet Another Example) Place Online Order Specify Shipping Instructions > You are developing an e-commerce system in which you have a base use case called Place Online Order that has an extending use case called Specify Shipping Instructions. An extend relationship points from the Specify Shipping Instructions use case to the Place Online Order use case to indicate that the behaviors in the Specify Shipping Instructions use case are optional and only occur in certain circumstances.

SWE © Solomon Seifu SWE: UML - Inheritance Between Use Cases Use cases can inherit from other use cases A generalization/specialization relationship exists The inheriting use case would completely replace one or more of the courses of action of the inherited use case

SWE © Solomon Seifu SWE: UML - Use Case (Generalization Example) In the example shown, we would be indicating that there are some common steps for all Use Cases that handle customer transactions and that the child Use Cases “Return Faulty Goods” and “Take Customer Order” have additional steps that fit into or around them Return Faulty Goods Take Customer Order Handle Customer Transaction Sales Assistant

SWE © Solomon Seifu Use Case Diagram Exercise

SWE © Solomon Seifu Use Case Diagram Exercise Answer

SWE © Solomon Seifu 2010 SWE: Fundamentals of OO & UML - Wholeness Encapsulation, Inheritance and Polymorphism are the three corner stones of OOP The saying “A picture speaks a thousand words” implies that images, figures & models are powerful concepts that enable the conveyance of a complex idea. UML does just that Use Case modeling is widely used to capture and articulate requirements specifications