Object-Oriented Design Guidelines



Similar documents
Lecturer: Sebastian Coope Ashton Building, Room G.18 COMP 201 web-page:

Masters of Science in Software & Information Systems

Use Cases. Massimo Felici. Massimo Felici Use Cases c

(BA122) Software Engineer s Workshop (SEW)

Object-oriented design methodologies

Chapter 10 Practical Database Design Methodology and Use of UML Diagrams

Developing SOA solutions using IBM SOA Foundation

Software Engineering. System Models. Based on Software Engineering, 7 th Edition by Ian Sommerville

In this Lecture you will Learn: Systems Development Methodologies. Why Methodology? Why Methodology?

Chap 1. Introduction to Software Architecture

Contents. Introduction and System Engineering 1. Introduction 2. Software Process and Methodology 16. System Engineering 53

RUP Design. Purpose of Analysis & Design. Analysis & Design Workflow. Define Candidate Architecture. Create Initial Architecture Sketch

Course Registration Case Study

Object Oriented Programming. Risk Management

Scenario-based Requirements Engineering and User-Interface Design

Software Requirements Specification of A University Class Scheduler

UML Diagram Types. Use Cases do the Following. Use Case Diagram

To introduce software process models To describe three generic process models and when they may be used

SYSTEMS ANALYSIS DESIGN

Software Development in the Large!

Object-Oriented Systems Analysis and Design

How To Develop Software

Analysis and Design with UML

CompuScholar, Inc. Alignment to Utah's Computer Programming II Standards

Component Based Development Methods - comparison

Software Engineering. Software Processes. Based on Software Engineering, 7 th Edition by Ian Sommerville

Business Modeling with UML

Java Programming (10155)

Object Oriented Design

Basic Unified Process: A Process for Small and Agile Projects

How To Design Software

Applying Use Cases to Microcontroller Code Development. Chris Gilbert Cypress Semiconductor

Applying Agile Methods in Rapidly Changing Environments

Chapter 13: Program Development and Programming Languages

CS4507 Advanced Software Engineering

Unit I Page No. 1 System Development Object Basics Development Life Cycle Methodologies Patterns Frameworks Unified Approach UML

Designing Real-Time and Embedded Systems with the COMET/UML method

An Aspect-Oriented Product Line Framework to Support the Development of Software Product Lines of Web Applications

INFORMATION TECHNOLOGY

Questions? Assignment. Techniques for Gathering Requirements. Gathering and Analysing Requirements

2. Analysis, Design and Implementation

Applying 4+1 View Architecture with UML 2. White Paper

I219 Software Design Methodology

UML TUTORIALS THE USE CASE MODEL

A UML Introduction Tutorial

Chapter 10. Practical Database Design Methodology. The Role of Information Systems in Organizations. Practical Database Design Methodology

Software development life cycle. Software Engineering - II ITNP92 - Object Oriented Software Design. Requirements. Requirements. Dr Andrea Bracciali

Communication Diagrams

Chapter 8 Approaches to System Development

11 Tips to make the requirements definition process more effective and results more usable

2. Analysis, Design and Implementation

Use Case Diagrams. Tutorial

TOGAF usage in outsourcing of software development

New York University Computer Science Department Courant Institute of Mathematical Sciences

Evaluation of a Use-Case-Driven Requirements Analysis Tool Employing Web UI Prototype Generation

Use Case Modeling. Software Development Life Cycle Training. Use Case Modeling. Set A: Requirements Analysis Part 3: Use Case Modeling

Lecture Objectives. Software Life Cycle. Software Engineering Layers. Software Process. Common Process Framework. Umbrella Activities

CS 389 Software Engineering. Lecture 2 Chapter 2 Software Processes. Adapted from: Chap 1. Sommerville 9 th ed. Chap 1. Pressman 6 th ed.

Software Architecture. Schahram Dustdar Distributed Systems Group TU Wien

Data Modeling Basics

What CMMI Cannot Give You: Good Software

4.4 What is a Requirement? 4.5 Types of Requirements. Functional Requirements

Decomposition into Parts. Software Engineering, Lecture 4. Data and Function Cohesion. Allocation of Functions and Data. Component Interfaces

Software Engineering Reference Framework

Information systems modelling UML and service description languages

CHAPTER 11 REQUIREMENTS

Analysis of the Specifics for a Business Rules Engine Based Projects

CS 6361, SPRING 2010 Advanced Requirements Engineering Web Based Meeting Scheduler- Project Plan

Execution of A Requirement Model in Software Development

Software Engineering G

Sofware Requirements Engineeing

Chapter 4 Software Lifecycle and Performance Analysis

Java Project Management: Agenda

Use Cases and Scenarios

Systematization of Requirements Definition for Software Development Processes with a Business Modeling Architecture

Java Project Management. Java Project Management: Agenda. Extreme Java G

Chapter 13: Program Development and Programming Languages

4. Multiagent Sys stems Design. Part 2: The PROMETHEUS methodology.

Engineering Design. Software. Theory and Practice. Carlos E. Otero. CRC Press. Taylor & Francis Croup. Taylor St Francis Croup, an Informa business

Requirements Engineering Process

The Role of the Software Architect

Use Cases. Reference: Craig Larman, Applying UML and Patterns, Ch. 6

The Tropos and MaSE Agent-Oriented Software Engineering Methodologies. Msury Mahunnah, Tallinn University of Technology

The Unified Software Development Process

Engineering Process Software Qualities Software Architectural Design

Software Project Management and UML

Adapted for a textbook by Blaha M. and Rumbaugh J. Object Oriented Modeling and Design Pearson Prentice Hall, 2005.

10.1 Determining What the Client Needs. Determining What the Client Needs (contd) Determining What the Client Needs (contd)

Unit 1 Learning Objectives

Requirements / Use Case Specification

Software Development Methodologies

Overview. System Definition Webster s Dictionary. System Engineering Hierarchy. System Engineering. Computer-Based Systems [PRE2005]

User experience storyboards: Building better UIs with RUP, UML, and use cases

Canadian Technology Accreditation Criteria (CTAC) INFORMATION TECHNOLOGY - TECHNOLOGIST Technology Accreditation Canada (TAC)

Transcription:

Adaptive Software Engineering G22.3033-007 Session 8 Sub-Topic 3 Presentation Object-Oriented Design Guidelines Dr. Jean-Claude Franchitti New York University Computer Science Department Courant Institute of Mathematical Sciences 1 Part I Object-Oriented Design Guidelines 2

Object-oriented design Goal: Want to express a design in terms of interacting objects What are classes and objects? How are classes used to formulate designs How is UML used in this process? 3 Object oriented programming principles Encapsulation Inheritance Abstract data types Polymorphism 4

Two object oriented design processes Both: build the design first in UML diagrams Top-down (Sommerville) Start at architecturecomponent level, refine down to objects Use-case driven (Unified Process) Start with realworld entities that realize the use case, refine these to software objects 5 Good object-oriented design Goals: Code should be easy to understand and easy to maintain A class has a simple, easily-stated purpose Class design should facilitate reuse Minimize interdependencies between different parts of the program Two important metrics: coupling should be low and cohesion should be high 6

UML diagrams in the design process Use cases (not use-case diagrams!) drive the process Class diagrams: Identify the classes and how they are related Interaction diagrams (sequence and collaboration): Show how different objects interact (dynamically) to do the tasks needed. 7 Other UML diagrams State and activity diagrams are helpful in understanding the changing state of the system and its subsystems at various points during execution UML component, package, collaboration, deployment help us understand how large systems are assembled from constituent software and hardware pieces 8

Object-oriented analysis and design See short summary on class website at: http://www.nyu.edu/classes/jcf/g22.3033-007/handouts/g22_3033_007_h52.htm 9 Overview of object-oriented analysis and design An iterative process (not necessarily in the following sequence): Develop requirements (in use-cases) Identify classes from real-world entities participating in use cases Draw interaction diagrams for the use cases, identifying responsibilities to be performed Draw class diagrams identifying the functions that will be performed in each class Use other diagrams to help understand and document the design 10

Sample Requirement statement When an appointment is to be made which involves a number of people, the system finds a common slot in each of their diaries and arranges the appointment for that time. If no common slots are available, it interacts with the users to rearrange their personal diaries to make room for the appointment. 11 Use case: Schedule a meeting Precondition: A user has connected to the system, with info about a meeting to be scheduled Actors: Initial user (who wants to schedule a meeting) Workers (other users) who are invited to attend E-mail system (to communicate with users) 12

Primary success scenario 1. User specifies proposed meeting (attendees, allowable days & times, duration, name & subject of meeting) 2. System finds earliest time slot that is available in all attendees diaries. 3. System inserts appointment in each diary 4. System sends e-mail to all attendees notifying them that they are scheduled to attend 13 Alternate scenario If in step 2., no time slot is found: 3. System finds best time slot, i.e., least number of attendee conflicts 4. System sends e-mail to all users who have a conflict with that time, asking them to reschedule their other meeting (if possible). 5. After a reasonable wait for responses, if conflict remains, repeat from step 3 with next best slot etc. 6. Schedule meeting when time conflicts are resolved. 14

Initial conceptual classes (real-world entities) Drawn from application domain, or interfaces to secondary actors Worker Worker s diary Meeting Appointment E-mail system interface 15 Other (software) classes Computer-world entities that one reasonably can expect to need (others may still be added later) UI (needed to interact with the users) Scheduler (needed to perform the logic of the use case(s). 16

Interaction diagram: show all the interactions between classes Choose a level of detail appropriate for your level of understanding of the design More detail is added as the design becomes finalized Many choices, no one best answer 17 Sequence diagram 18

Design classes to perform the functions needed in use case Can start with use cases, look for attributes, operations, and associations UI: provide panels to user Scheduler Association to meeting schedulemeeting(meeting properties) Meeting Attributes: meeting properties Associated with worker Create (meeting properties) getnexttimeslot(1..number of slots) getattendee(1..number of attendees) 19 More classes Worker Attribute: diary isavailable(timeslot) bookmeeting (meeting attributes) Diary Associated with 1 worker, any number of appointments istimeslotopen(timeslot) scheduleappt(meeting attributes) Appointment operations create(), add(attributes) Attributes: time, date, name, subject, etc. 20

Construct Class Diagram May need to add more information based on new awareness of functionality Also will need to augment class diagram to consider all other use cases and alternate scenarios 21 Class Diagram 22

Improve the object-oriented design Look at coupling and cohesion: Do classes need to know too much about the internals of other classes? Are the operations and attributes of a class all closely related? Is the design easily maintainable? What changes are likely to happen as the product evolves? 23 Likely changes in product Different kinds of meetings: recurring, call-in, video Different worker types/preferences: onvacation, offsite, unschedulable Worker teams Different scheduling methods: Invitees opt-in, or opt-out Just insert into everyone s diary Mandatory Different e-mail systems (some may have better interface to diary) 24

Object-oriented design for expected changes Inheritance for different kinds of similar classes (e.g. meetings) Polymorphism for a method that acts differently in different situations (different scheduling algorithms) Different implementations can be hidden by highlevel virtual methods (e-mail systems) Child classes can be aware of other child-classes (worker teams) 25 Improved class design using inheritance, polymorphism 26

Iterate Keep adding detail until you are convinced you can perform all the use cases with the UML diagrams. 27 Convert to code Class definitions are derived directly from class diagrams If you are doing your diagrams in Rational Rose, the tool will generate your class definitions (header files) and initial code for your methods Your method implementations come from your understanding of the functionality associated with each step of the use case. 28