Software Engineering Zhang Shuang

Slides:



Advertisements
Similar presentations
Introduction to Object Orientation System Analysis and Design
Advertisements

Slide 12.1 © The McGraw-Hill Companies, 2002 Object-Oriented and Classical Software Engineering Fifth Edition, WCB/McGraw-Hill, 2002 Stephen R. Schach.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 8 Slide 1 System modeling 2.
Introduction To System Analysis and Design
Slide 1 Chapter 7 Structural Modeling. Slide 2 Key Ideas A structural or conceptual model describes the structure of the data that supports the business.
Modified from Sommerville’s originalsSoftware Engineering, 7th edition. Chapter 8 Slide 1 System models.
Lecture 4 Class Responsibility Collaboration Cards
Modified from Sommerville’s originalsSoftware Engineering, 7th edition. Chapter 8 Slide 1 System models.
1 CS1001 Lecture Overview Object Oriented Design Object Oriented Design.
Lecture 13: Object- Oriented Concepts Anita S. Malik Adapted from Schach (2004) Chapter 7.
Domain Modeling (with Objects). Motivation Programming classes teach – What an object is – How to create objects What is missing – Finding/determining.
Chapter 3 Object-Oriented Analysis of Library Management System(LMS)
Introduction To System Analysis and design
Systems Analysis and Design in a Changing World, Fifth Edition
OBJECT-ORIENTED ANALYSIS PHASE
Slide 12.1 © The McGraw-Hill Companies, CS 4310: Software Engineering Lecture 7 Systems Analysis Object-Oriented Design.
From Problem Statement to Design
CSC 213 – Large Scale Programming Lecture 3: Object-Oriented Analysis.
PowerPoint Presentation for Dennis, Wixom, & Tegarden Systems Analysis and Design with UML, 4th Edition Copyright © 2012 John Wiley & Sons, Inc. All rights.
Introduction To System Analysis and Design
CS3320::CH111 OBJECT-ORIENTED ANALYSIS Chapter 11.
1 Analysis Extracting from Use Cases to Create Diagrams.
Copyright 2002 Prentice-Hall, Inc. Chapter 2 Object-Oriented Analysis and Design Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey.
CSC 395 – Software Engineering Lecture 13: Object-Oriented Analysis –or– Let the Pain Begin (At Least I’m Honest!)
Lecture 14 & 15: Object- Oriented Analysis Anita S. Malik Adapted from Schach (2004) Chapter 12.
CSC 213 – Large Scale Programming. Today’s Goal  Improve design skills to make usable designs  Noun extraction & UML class diagram reviewed  Connections.
Lab 04.
Slide 1 Structural Modeling Chapter 7. Slide 2 Key Ideas A structural or conceptual model describes the structure of the data that supports the business.
Lecture 3 Uses Cases Topics UML Use Cases pop quiz Readings: Chapter 3 January 24, 2008 CSCE 492 Software Engineering.
Structural Modeling. Objectives O Understand the rules and style guidelines for creating CRC cards, class diagrams, and object diagrams. O Understand.
Systems Analysis and Design in a Changing World, 3rd Edition
Sommerville 2004,Mejia-Alvarez 2009Software Engineering, 7th edition. Chapter 8 Slide 1 System models.
Slide 13B.22 © The McGraw-Hill Companies, 2005 Object-Oriented and Classical Software Engineering Sixth Edition, WCB/McGraw-Hill, 2005 Stephen R. Schach.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 14 Slide 1 Object-oriented Design.
UML Use Case Diagramming Guidelines. What is UML? The Unified Modeling Language (UML) is a standard language for specifying, visualizing, constructing,
UML Class Diagram Trisha Cummings. What we will be covering What is a Class Diagram? Essential Elements of a UML Class Diagram UML Packages Logical Distribution.
Lecture 6: Structural Modeling
Slide 12A.1 © The McGraw-Hill Companies, 2005 Object-Oriented and Classical Software Engineering Sixth Edition, WCB/McGraw-Hill, 2005 Stephen R. Schach.
Structural Modeling Chapter 7. Key Ideas A structural or conceptual model describes the structure of the data that supports the business processes in.
Software Engineering Zhang Shuang
Design Model Lecture p6 T120B pavasario sem.
Repetition af Domæne model. Artifact influence emphasizing the Domain Model.
Petri Nets Invented by Carl Adam Petri in 1962 Concurrent systems with timing problems  Synchronization, race problem, deadlock A petri net consists of.
THE ANALYSIS WORKFLOW  The specification document  Informal specifications  The analysis workflow  Extracting the entity classes  Functional modeling:
CHAPTER 13 OBJECT-ORIENTED ANALYSIS. Overview l The analysis workflow l Extracting the entity classes l The elevator problem case study l The test workflow:
CS212: Object Oriented Analysis and Design Lecture 32: Use case and Class diagrams.
Chapter 5 System Modeling. What is System modeling? System modeling is the process of developing abstract models of a system, with each model presenting.
1 Foundations of Software Design Fall 2002 Marti Hearst Lecture 7: Object-Oriented Design.
Larman chapter 101 Domain Model: Visualizing concepts Larman chapter 10.
ITEC0724 Modern Related Technology on Mobile Devices Lecture Notes #2 1.
Object-Oriented Software Engineering Practical Software Development using UML and Java Modelling with Classes.
CSCI 383 Object-Oriented Programming & Design Lecture 7 Martin van Bommel.
Slide 1 Systems Analysis and Design with UML Version 2.0, Second Edition Alan Dennis, Barbara Haley Wixom, and David Tegarden Chapter 7: Structural Modeling.
Identification of Classes. Object Oriented Analysis (OOA) OOA is process by which we identify classes that play role in achieving system goals & requirements.
11 Systems Analysis and Design in a Changing World, Fifth Edition.
Modeling with UML – Class Diagrams
UNIT-IV Designing Classes – Access Layer ‐ Object Storage ‐ Object Interoperability.
Cmpe 589 Spring 2006.
Object-Oriented Software Engineering WCB/McGraw-Hill, 2008 Stephen R
The Movement To Objects
Object-Oriented Analysis (OOA)
Chapter 5: Structural Modeling
Introduction to Unified Modeling Language (UML)
Advanced Java Programming
Object-Oriented Analysis
Object-Oriented and Classical Software Engineering Sixth Edition, WCB/McGraw-Hill, 2005 Stephen R. Schach
Software Design Lecture : 14.
Copyright 2007 Oxford Consulting, Ltd
Software Engineering System Modeling Chapter 5 (Part 1) Dr.Doaa Sami
Presentation transcript:

Software Engineering Zhang Shuang

Objects  First refinement  Product is designed in terms of abstract data types  Variables (“objects”) are instantiations of abstract data types  Second refinement  Class: abstract data type that supports inheritance  Objects are instantiations of classes Zhang Shuang,

Inheritance  Define H umanBeing to be a class  A humanBeing has attributes, such as age, height, gender  Assign values to attributes when describing object  Define Parent to be a subclass of HumanBeing  A Parent has all attributes of a HumanBeing, plus attributes of his/her own (name of oldest child, number of children)  A Parent inherits all attributes of humanBeing  The property of inheritance is an essential feature of object- oriented languages such as Smalltalk, C++, Ada 95, Java (but not C, FORTRAN) Zhang Shuang,

Inheritance (contd)  UML notation  Inheritance is represented by a large open triangle

Java Implementation

Aggregation

Composition Zhang Shuang,

Association Zhang Shuang,

2. Class Modeling  What is a class diagram?  A class diagram shows the existence of classes and their relationships in the logical design of a system. A class diagram may represent all or part of the class structure of a system.  Class diagrams show the static structure of the model, in particular, the things that exist such as classes, their internal structure, and their relationships to other classes.  It is the static view of a system, primarily supports the functional requirements of a system. Zhang Shuang,

2. Class Modeling  Class Diagram Usage  When modeling the static view of a system, class diagrams are typically used in one three ways, to model: The vocabulary of a system Collaborations A logical database schema Zhang Shuang,

Class Modeling  Extract classes and their attributes  Represent them using an entity-relationship-like diagram  Deduce the classes from use cases and their scenarios  Often there are many scenarios  Possible danger: too many candidate classes Zhang Shuang,

Two Approaches to Class Modeling  Noun extraction  Always works  CRC cards, Class-Responsibility-Collaboration  Need to have domain expertise  For testing class diagram Zhang Shuang,

Noun Extraction  Stage 1. Concise Problem Definition  Define product briefly and concisely. Buttons in elevators and on the floors control the motion of n elevators in a building with m floors. Zhang Shuang,

Noun Extraction (contd)  Stage 2. Informal Strategy  Incorporate constraints, express result in a single paragraph Buttons in elevators and on the floors control movement of n elevators in a building with m floors. Buttons illuminate when pressed to request the elevator to stop at a specific floor; illumination is canceled when the request has been satisfied. When an elevator has no requests, it remains at its current floor with its doors closed. Zhang Shuang,

Noun Extraction (contd)  Stage 3. Formalize the Strategy  Identify nouns in informal strategy. Use nouns as candidate classes.  Nouns  button, elevator, floor, movement, building, illumination, door Zhang Shuang,

Noun Extraction (contd)  movement, illumination are abstract nouns — exclude (may become attributes)  floor, building, door are outside problem boundary — exclude  Candidate classes: Elevator and Button  Subclasses: Elevator Button and Floor Button Zhang Shuang,

First Iteration of Class Diagram Problem  Buttons do not communicate directly with elevators  We need an additional class: Elevator Controller

Second Iteration of Class Diagram  All relationships are now 1-to-n  Makes design and implementation easier

Class Design Considerations Multiplicity  Every class engaged in a relationship should have a multiplicity.  If the multiplicity is 1, indicate that it is 1; in order that reader know that multiplicity has been considered.  UML multiplicity indicator UML multiplicity indicator Zhang Shuang,

Exercise 1 Assembly Line Control System Assembly Line Control System Use the technique of noun extraction to identify the possible classes in the following use case scenario for a software system that controls an assembly line: The sensor sends a STOP message to the control software if a widget reaches the end of the conveyor belt without being lifted by the robot arm. The software sends a signal to the motor controller to stop the assembly line. Which of the candidate classes should not be added to the preliminary class list? Refer explicitly to the refinement principle you used in each case. Zhang Shuang,

Exercise 1 Assembly Line Control System  The possible classes :  sensor  control software  widget  motor controller  assembly line  Class diagram Class diagram Zhang Shuang,

Exercise 2  OOA: get class diagram for University System. Zhang Shuang,

Exercise 3  OOA: get class diagram for Bank System. A bank system has customers who open account. A customer can hold accounts in a bank. He can deposit funds to accounts, can withdraw funds from accounts, and can also transfer funds from an account to another. A customer can check balance of his own accounts, and transaction records including depositing, withdrawing and transferring. The customer has rights to close his own account. Zhang Shuang,

Exercise 4  OOA: get class diagram for on-line musical instrument shop. Zhang Shuang,

2. Class Modeling  Is there a better way to organize class diagrams? Zhang Shuang,

2. Class Modeling  Package?  A general purpose mechanism for organizing elements into groups.  A model element that can contain other model elements.  Rules:  Classes with aggregation or composition belong to the same package  Classes with a lot of association belong to the same package Zhang Shuang,

2. Class Modeling  Package can include other packages.  e.g. : Java class library  Class File is in package io,  Package io is in package java.  The full name of File is java.io.File  Avoid too deep nested package  Normally 2~3 layers Zhang Shuang,

2. Class Modeling Zhang Shuang,

CRC Cards  CRC Class-Responsibility-Collaboration Zhang Shuang,

CRC Cards  Used since 1989 for OOA  For each class, fill in card showing  Name of class  Functionality (responsibility)  List of classes it invokes (collaboration)  Now automated (CASE tool component)  Strength  When acted out by team members, powerful tool for highlighting missing or incorrect items  Weakness  Domain expertise is needed