Object-Oriented Analysis and Design



Similar documents
Object-oriented design methodologies

How To Design Software

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

Case studies: Outline. Requirement Engineering. Case Study: Automated Banking System. UML and Case Studies ITNP090 - Object Oriented Software Design

LECTURE 11: PROCESS MODELING

ATM Case Study Part 1

User Guide. Temperature and Humidity Datalogger. Model 42280

Announcements. SE 1: Software Requirements Specification and Analysis. Review: Use Case Descriptions

1. Process Modeling. Process Modeling (Cont.) Content. Chapter 7 Structuring System Process Requirements

A UML Introduction Tutorial

TRAFFIC LIGHT: A PEDAGOGICAL EXPLORATION

ROC Protocol Specifications Manual

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

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

For more detailed information, see your Vantage Vue Console manual.

Wait-Time Analysis Method: New Best Practice for Performance Management

1. Computer System Structure and Components

Web Portal Step by Step

DS1104 R&D Controller Board

AUTOMATIC NIGHT LAMP WITH MORNING ALARM USING MICROPROCESSOR

EXPLANATION OF WEATHER ELEMENTS AND VARIABLES FOR THE DAVIS VANTAGE PRO 2 MIDSTREAM WEATHER STATION

Object Instance Profiling

06MAR THU 12: User Manual

Chapter 8 Approaches to System Development

CHAPTER_3 SOFTWARE ENGINEERING (PROCESS MODELS)

Weather Capture Software Guide Version 1.4 Revision: June

User Manual. Humidity-Temperature Chart Recorder. Model RH520

QUALITY TOOLBOX. Understanding Processes with Hierarchical Process Mapping. Robert B. Pojasek. Why Process Mapping?

ATM Case Study OBJECTIVES Pearson Education, Inc. All rights reserved Pearson Education, Inc. All rights reserved.

2011, The McGraw-Hill Companies, Inc. Chapter 5

USING UML FOR OBJECT-RELATIONAL DATABASE SYSTEMS DEVELOPMENT: A FRAMEWORK

Chapter 1. Introduction to ios Development. Objectives: Touch on the history of ios and the devices that support this operating system.

Exercises on Use Cases

Automation Unit TM 1703 ACP Flexible automation and telecontrol

Quareo ICM Server Software

SAMPLE CHAPTERS UNESCO EOLSS DIGITAL INSTRUMENTS. García J. and García D.F. University of Oviedo, Spain

Massachusetts Institute of Technology

Chapter 2 System Basics

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

Development Methodologies. Types of Methodologies. Example Methodologies. Dr. James A. Bednar. Dr. David Robertson

CPS122 Lecture: State and Activity Diagrams in UML

Use Case Diagrams. Tutorial

Using Use Cases for requirements capture. Pete McBreen McBreen.Consulting

Microtronics technologies Mobile:

Input / Output and I/O Strategies

The I2C Bus. NXP Semiconductors: UM10204 I2C-bus specification and user manual HAW - Arduino 1

2 SYSTEM DESCRIPTION TECHNIQUES

Masters of Science in Software & Information Systems

Chapter 6. Data-Flow Diagrams

Let s put together a Manual Processor

Operating system Dr. Shroouq J.

Requirements Analysis Concepts & Principles. Instructor: Dr. Jerry Gao

Case Study: conceptual modeling of a helpdesk request manager

Introduction to Systems Analysis and Design

Case Study: ATM machine I. Amalia Foka CEID - University of Patras Object Oriented Programming II (C++) Fall

Take-Home Exercise. z y x. Erik Jonsson School of Engineering and Computer Science. The University of Texas at Dallas

Release Notes. Asset Control and Contract Management Solution 6.1. March 30, 2005

MAGICAR M871A. Car alarm with two-way remote User s guide

Reference Guide. Vantage PRO2 Quick

KWIC Exercise. 6/18/ , Spencer Rugaber 1

STEPPER MOTOR SPEED AND POSITION CONTROL

Object Oriented Design

Semantic Object Language Whitepaper Jason Wells Semantic Research Inc.

Solar energy e-learning laboratory - Remote experimentation over the Internet

What is a life cycle model?

LICENSING MANAGEMENT SERIES. A Guide to Assessing Windows Server Licensing

6-1. Process Modeling

LEVERAGING FPGA AND CPLD DIGITAL LOGIC TO IMPLEMENT ANALOG TO DIGITAL CONVERTERS

STSG Methodologies and Support Structure

Software INTERACT. MachineLogic. The Shortest Distance Between Man and Machine

Croatian Power Utility distribution level's UML model

Lab 3 - DC Circuits and Ohm s Law

Design and UML Class Diagrams. Suggested reading: Practical UML: A hands on introduction for developers

Lab 17: Building a 4-Digit 7-Segment LED Decoder

P3.8 INTEGRATING A DOPPLER SODAR WITH NUCLEAR POWER PLANT METEOROLOGICAL DATA. Thomas E. Bellinger

Types of UML Diagram. UML Diagrams OOAD. Computer Engineering Sem -IV

Scenario-based Requirements Engineering and User-Interface Design

Software Engineering. System Modeling

CHAPTER 14 Understanding an App s Architecture

Object Oriented Programming. Risk Management

Entity-Relationship Model. Purpose of E/R Model. Entity Sets

How to Develop Work Breakdown Structures

Application of UML in Real-Time Embedded Systems

Use Cases and Scenarios

Smart Thermostat page 1

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

PROJECT MANAGEMENT METHODOLOGY OF OBJECT- ORIENTED SOFTWARE DEVELOPMENT

DESIGN AND IMPLEMENTATION OF LOW COST HOME SECURITY SYSTEM USING PIC MICROCONTROLLER ANDGSM NETWORK

PRODUCTIVITY THROUGH INNOVATION 600 CONTROL DIRECT DRIVE TECHNICAL/OPERATION MANUAL

How To Develop Software

Computer Automation Techniques. Arthur Carroll

-Helping to make your life betterwww.person-to-person.net

Using Use Cases on Agile Projects

Relative Humidity Calibration Kit

II. Conceptual Modeling

USB-500/600 Series Low-Cost Data Loggers and Accessories

User's Guide. Integrating Sound Level Datalogger. Model Introduction

Rose/Architect: a tool to visualize architecture


Transcription:

CHAPTER 2 Object-Oriented Analysis and Design Objectives The objectives of this chapter are to identify the following: Define a weather monitoring station. Analyze the system to determine its key classes. Design those classes. Create basic UML diagrams used to represent class relationships. Software Development Methods 1

Problem Statement Grady Booch provides this example of a software system in need of analysis and design 1 : The system shall provide automatic monitoring of various weather conditions. Specifically, it must measure: Wind speed and direction Temperature Barometric pressure Humidity The system shall also provide the following derived measurements: Wind chill Dew point temperature Temperature trend Barometric pressure trend The system shall have a means of determining the current time and date, so that it can report the highest and lowest values of any of the four primary measurements during the previous 24 hour period. The system shall have a display that continuously indicates all eight primary and derived measurements, as well as the current time and date. Through the use of a keypad, the user may direct the system to display the 24-hour high or low value of any one primary measurement, together with the time of the reported value. The system shall allow the user to calibrate its sensors against known values, and to set the current time and date. Hardware Assumptions In addition, Booch also makes some basic hardware assumptions: We will use a single-board computer (SBC) with a 486-class processor. Time and date are supplied by an on-board clock, accessible via memorymapped I/O. Temperature, barometric pressure, and humidity are measure by on-board circuits (with remote sensors), also accessible via memory-mapped I/O. 1. Object-Oriented Analysis and Design with Applications, 2nd Edition, Grady Booch, The Benjamin/Cummings Publishing Company, 1994, pp. 294-295. 2 Software Development Methods

Wind direction and speed are measure from a boom encompassing a wind vane (capable of sensing wind from any of 16 directions) and cups (which advance a counter for each revolution). User input is provided through an off-the-shelf telephone keypad, managed by an on-board circuit supplying audible feedback for each key press. Last user input is accessible via memory mapped I/O. The display is an off-the-shelf LCD graphic device, managed by an on-board circuit capable of processing a simple set of graphics primitives, including messages for drawing lines and arcs, filling regions, and displaying text. An on-board timer interrupts the computer every 1/60 second. The kind of hardware is chosen to simplify the software development process and to alleviate much of the low-level coding that would otherwise be required. The Goals of Object- Oriented Analysis The analysis phase of an object-oriented system has several key objectives: Identify the key actors within the system. An actor is an element within the system that performs some task, either actively or passively. These actors will usually end up becoming the classes of the system. Segregate the roles and responsibilities of each actor. This helps us begin to see how the actors will inter-relate during system execution and to make sure all of our required functionality is accounted for. These roles and responsibilities generally end up becoming methods available on the classes representing the various actors. Determining the System Boundary Before embarking on the analysis and design phase, we must first analyze the system boundary to determine what we need to build versus what can be bought or what is already available to us in pre-written class libraries. Once the system boundary has been established, we can begin a class analysis. During a class analysis we seek to identify the important classes within the system. This need not be an exhaustive list (we will be identifying classes all the way through deployment), but it should serve to capture the essential elements of the system. We can find these classes in numerous locations: Tangible things People or roles Places or locations Interactions Software Development Methods 3

Organizations Events Concepts Useful Techniques for Class Analysis There are several useful techniques that can be employed to facilitate class analysis. Some of these include: Data dictionary Informal requirements CRC cards Use-Case Analysis Data Dictionary A data dictionary is generally maintained by a database administrator. It outlines, at a fairly detailed level, what the entities are that are being stored in the database, the attributes of those entities, and the relationships that the entities maintain to one another. Entities from this data dictionary may prove useful as classes. Another advantage to this technique is that many of the attributes and relationships have already been defined. Informal Requirements We can sometimes glean classes from informal specifications. For instance we might identify nouns as either classes or attributes and verbs as operations. This method is sometimes useful for a quick analysis, but for any in-depth analysis, I would recommend either CRC cards, or use-case analysis. CRC Cards Another way of keeping track of the actors, their responsibilities, and their interrelationships, is by using CRC cards. A CRC card is nothing more than an index card. It identifies a Class, that class Responsibilities, and the other classes with whom it Collaborates. While usually not suitable as aa final deliverable to a client, CRC cards can be a good first step in identifying the main components of the system. Use-Case One good method of doing systems analysis and design is called use-case analysis. Essentially this is nothing more than a story board of various scenarios that 4 Software Development Methods

the systems is meant to handle and the method in which it will handle those scenarios. The following is an example from the Booch text: Setting the time and date. 1. User presses the select key. 2. System displays selecting. 3. User presses any one of the keys time or date; any other key (except run, wind speed, temperature, pressure, or humidity) will be ignored. 4. System flashes the corresponding label; display also flashes the first field of the selected item (hours for time, and month for date). 5. User presses left or right keys to select another field. User presses the up or down keys to raise or lower the value of the selected field. 6. Control passes back to step 3 or 5. Time-Date Class The first class we ll look at is the TimeDate class. This class is responsible for acquiring, calibrating, and displaying the current time and date. While it is possible to capture this class using text, it will be much more efficient to document it using a simple UML class diagram. This diagram describes the class using some of its key properties and methods. It also allows the analyst the indicate class-level versus object-level properties and methods as well as the access (public, private, or protected) of each member. For the analysis phase we can dispense with much of this detail and make some preliminary assumptions. A class diagram consists of a box divided into three horizontal layers. In the first layer we write the class name. In the second we place the class attributes, and in the third layer we place the class methods. For example, the class diagram for the TimeDate class might appear as the one to the left. This diagram is an example of an analysis diagram; it doesn t contain too many details. However, for a design diagram we embellish this diagram a bit. Specifically we begin to add types and access specifiers. Software Development Methods 5

For instance, the time and date might be represented as long integers. Each of the class methods will have some set of parameters and return types. More importantly, we begin to identify the visibility of each class member by providing an indication of its access specifiers. An example of a design class diagram is seen to the right. Notice that to the right of each member a type is listed. This represents the type of data used to implement each of the attributes and the type of data returned by the methods. Also notice that next to each member is a symbol, either + or -. These are access specifiers. A minus sign (-) indicates that the member is private to the class. A plus sign (+) indicates that the member is public. A pound sign (#) would indicate that the member is protected. Note that these specifiers map to the corresponding specifiers in both C++ an Java. Temperature Sensor The next class describes the temperature sensor. This sensor should be able to report on: the current temperature the high and low temperatures for the prior 24 hour period any temperature trends Class: Temperature Sensor Attributes: temperature trend Operations: currenttemperature setlowtemperature sethightemperature gettrend 6 Software Development Methods

Pressure Sensor The next class describes the pressure sensor. This sensor should report on: the current pressure the high and low pressures for the prior 24 hour period any pressure trends Class: Pressure Sensor Attributes: pressure trend Operations: currentpressure setlowpressure sethighpressure gettrend Trend Sensor Notice that both of these classes must report on the trends of their various measurements. In this case we choose to pull out this common functionality into a separate class and use inheritance to make this functionality common to the two classes. Thus we end up with a new class, Trend Sensor, which is able to: report on trends Class: Trend Sensor Attributes: trend Operations: gettrend Since we have now pulled the common functionality of trend sensing from the other two classes, they become somewhat simplified: Class: Temperature Sensor Attributes: temperature Operations: currenttemperature setlowtemperature sethightemperature Class: Pressure Sensor Attributes: pressure Operations: currentpressure setlowpressure sethighpressure Software Development Methods 7

Humidity Sensor The humidity sensor is similar to the other sensors. This sensor should be able to report on: the current humidity the high and low humidities for the prior 24 hour period Class: Humidity Sensor Attributes: humidity Operations: currenthumidity setlowhumidity sethighhumidity History Sensor As before, we can see that the humidity sensor, like the temperature and pressure sensors exhibits the ability to report on the highest and lowest values of their respective measurements within the prior 24-hour period. This similarity prompts us to abstract the sensor classes still further. To do this we create the History Sensor. This sensor is able to report on: the low and high values encountered within a 24-hour period the date and time of those measurements Class: History Sensor Operations: lowvalue timeoflowvalue highvalue timeofhighvalue Notice that unlike the other classes, the History Sensor has no attributes: its only members are methods. This is a common phenomenon and allows us to observe the following best practice: Program to an interface, not an implementation. We will discuss this more later. 8 Software Development Methods

Wind Speed Sensor The wind speed sensor is similar to the other sensors. This sensor should be able to report on: the current wind speed the high and low wind speeds for the prior 24 hour period Class: Wind Speed Sensor Attributes: speed Operations: currentspeed setlowspeed sethighspeed Calibrating Sensor Reviewing the requirements, it appears that we have missed a key point, that is, that most of the sensors must be able to be calibrated to some known value. While this functionality is straightforward, we don t want to duplicate it if we can avoid it. The obvious solution is to place this functionality into another superclass called Calibrating Sensor. The calibrating sensor takes most of the common data from the other classes. Each calibrating sensor will be able to report on: the current value the high and low values for the prior 24 hour period Class: Calibrating Sensor Operations: currentvalue setlowvalue sethighvalue The Calibrating Sensor is an immediate superclass of the History Sensor. This makes sense since any History Sensor must be able to report on values that were tracked via the functionality provided by the Calibrating Sensor. Software Development Methods 9

Wind Direction Sensor The wind direction sensor is the last sensor. This sensor is different from the others in that it requires no history and needs to observe no trends. The Wind Direction Sensor will report on: the current wind direction Class: Wind Direction Sensor Attributes: direction Operations: currentdirection Sensor Hierarchy As a final unification for all of our sensors, we provide a single abstract class called Sensor. The final sensor Hierarchy appears as follows: Sensor / \ / \ Calibrating Wind Direction \ \ Historical / \ / \ / \ / \ Trend Humidity Wind Speed / \ / \ Temperature Pressure The display manager, keypad, and timer classes are not as interesting to our discussion, so we will not spend much time on them. Instead we ll take a look at some ways of performing analysis and design. 10 Software Development Methods

Starting the Course Project You now have enough information to begin analyzing and designing your own course project. For the next phase of your project you need to turn in several UML diagrams outlining some of the core functionality of your system. We will continue our discussion of UML next week. For this week you should plan on completing: Use-case analysis for one of the major functions of your system. The use case should outline, in detail, the steps that will be executed and the results that the system will return. Preliminary class analysis and diagrams. These should include the class names, attributes, and operations. It should also show any inheritance that is present. Next week we will see how to show relationships between the classes. Software Development Methods 11

12 Software Development Methods