Vector Application : A UML Example © Dr. David A. Workman School of EE and CS University of Central Florida Feb. 8, 2001.

Slides:



Advertisements
Similar presentations
Software Architecture Design Chapter 12 Part of Design Analysis Designing Concurrent, Distributed, and Real-Time Applications with UML Hassan Gomaa (2001)
Advertisements

Construction process lasts until coding and testing is completed consists of design and implementation reasons for this phase –analysis model is not sufficiently.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12Slide 1 Software Design l Objectives To explain how a software design may be represented.
Composition CMSC 202. Code Reuse Effective software development relies on reusing existing code. Code reuse must be more than just copying code and changing.
OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 1/18 Use Case Analysis – continued Control Classes.
© Janice Regan, CMPT 102, Sept CMPT 102 Introduction to Scientific Computer Programming The software development method algorithms.
© 2005 Prentice Hall7-1 Stumpf and Teague Object-Oriented Systems Analysis and Design with UML.
1 SWE Introduction to Software Engineering Lecture 23 – Architectural Design (Chapter 13)
Chapter 3 Data Abstraction: The Walls. © 2005 Pearson Addison-Wesley. All rights reserved3-2 Abstract Data Types Modularity –Keeps the complexity of a.
Satzinger, Jackson, and Burd Object-Orieneted Analysis & Design
Chapter 7 Improving the User Interface
9 1 Chapter 9 Database Design Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Use Case Analysis – continued
Software Issues Derived from Dr. Fawcett’s Slides Phil Pratt-Szeliga Fall 2009.
Course Instructor: Aisha Azeem
C++ fundamentals.
The chapter will address the following questions:
C o n f i d e n t i a l Developed By Nitendra NextHome Subject Name: Data Structure Using C Title: Overview of Data Structure.
Introduction To System Analysis and design
The Software Development Life Cycle: An Overview
An Object-Oriented Approach to Programming Logic and Design
1 CS 456 Software Engineering. 2 Contents 3 Chapter 1: Introduction.
An Introduction to Software Architecture
OOD Case Study (For parallel treatment, see Chapter 2 of the text)
Ch:10 Component Level Design Unit 4. What is Component? A component is a modular building block for computer software Because components reside within.
SWE © Solomon Seifu ELABORATION. SWE © Solomon Seifu Lesson 11 Subsystem Design.
SAMANVITHA RAMAYANAM 18 TH FEBRUARY 2010 CPE 691 LAYERED APPLICATION.
Software Life Cycle Requirements and problem analysis. –What exactly is this system supposed to do? Design –How will the system solve the problem? Coding.
The Generic Gaming Engine Andrew Burke Advisor: Prof. Aaron Cass Abstract Games have long been a source of fascination. Their inherent complexity has challenged.
Mathematics. Session Three Dimensional Geometry–1(Straight Line)
5.6 Equations of Equilibrium
Chapter 17 GRASP: Designing Objects with Responsibilities. 1CS6359 Fall 2011 John Cole.
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
Systems Analysis and Design in a Changing World, 3rd Edition
CSC480 Software Engineering Lecture 11 September 30, 2002.
Lab2 C++ Warmup: Pet Applicatioin Cop 4331 and EEL4884 © Dr. David A. Workman School of EE and Computer Science University of Central Florida February.
ANALYSIS - II REQUIREMENT ANALYSIS DESIGN IMPLEMENTATION TEST.
Data Structures Using C++ 2E1 Inheritance An “is-a” relationship –Example: “every employee is a person” Allows new class creation from existing classes.
Comparison of Design Styles (Part I) Case Study: 2D Geometry Solver COP 4331 OO Processes for Software Development © Dr. David A. Workman School of Computer.
Chapter 6 Introduction to Defining Classes. Objectives: Design and implement a simple class from user requirements. Organize a program in terms of a view.
Chapter 36 More Object Design with GoF Patterns 1CS6359 Fall 2011 John Cole.
CSCI 1100/1202 April 1-3, Program Development The creation of software involves four basic activities: –establishing the requirements –creating.
Domain Classes – Part 1.  Analyze Requirements as per Use Case Model  Domain Model (Conceptual Class Diagram)  Interaction (Sequence) Diagrams  System.
Midterm Study Guide COP 4331 and EEL4884 OO Processes for Software Development © Dr. David A. Workman School of EE and Computer Science University of Central.
Chapter 10: Classes and Data Abstraction. Objectives In this chapter, you will: Learn about classes Learn about private, protected, and public members.
Architecture View Models A model is a complete, simplified description of a system from a particular perspective or viewpoint. There is no single view.
Slide 1 Service-centric Software Engineering. Slide 2 Objectives To explain the notion of a reusable service, based on web service standards, that provides.
Software Design Concepts and Principles COP 4331 and EEL4884 OO Processes for Software Development © Dr. David A. Workman School of EE and Computer Science.
Data Design and Implementation. Definitions Atomic or primitive type A data type whose elements are single, non-decomposable data items Composite type.
I/O Basics 26 January Aside from print( ) and println( ), none of the I/O methods have been used significantly. The reason is simple: most real.
Introduction to the Object-oriented Data Protocol © Dr. David Workman COP4331 School of EE and CS February 4, 2010.
Chapter 10: Classes and Data Abstraction. Classes Object-oriented design (OOD): a problem solving methodology Objects: components of a solution Class:
Object and Class Structuring Chapter 9 Part of Analysis Modeling Designing Concurrent, Distributed, and Real-Time Applications with UML Hassan Gomaa (2001)
Design Example: Discrete Event Simulator ©Dr. David A. Workman School of EE and Computer Science University of Central Florida February 15, 2008 Revised:
Comparison of Design Styles (Part II) Case Study: 2D Geometry Solver COP4331 OO Processes for Software Development © Dr. David A. Workman March 17, 2009.
OBJECT-ORIENTED TESTING. TESTING OOA AND OOD MODELS Analysis and design models cannot be tested in the conventional sense. However, formal technical reviews.
1 Software Requirements Descriptions and specifications of a system.
Object Oriented Programming Some Interesting Genes.
Design Engineering 1. Analysis  Design 2 Characteristics of good design 3 The design must implement all of the explicit requirements contained in the.
Logical Architecture and UML Package Diagrams. The logical architecture is the large-scale organization of the software classes into packages, subsystems,
Microsoft Foundation Classes MFC
INF230 Basics in C# Programming
SOFTWARE DESIGN AND ARCHITECTURE
Chapter 4: Writing Classes
Service-centric Software Engineering
C H A P T E R 3 Vectors in 2-Space and 3-Space
An Introduction to Software Architecture
SAMANVITHA RAMAYANAM 18TH FEBRUARY 2010 CPE 691
Software Requirements Specification (SRS) Template.
Software Development Process Using UML Recap
Presentation transcript:

Vector Application : A UML Example © Dr. David A. Workman School of EE and CS University of Central Florida Feb. 8, 2001

February 8, 2001(c) Dr. David A. Workman2 Problem Statement Vector Application The system shall provide the capability to: 1.Read one or more instances of the problem data from an external ascii file specified by the user at runtime. An instance of the problem data shall include the description of two lines and a point in Real 2D space. Each line shall be composed of two cartesian vectors defining respectively, a point on the line, and the positive direction of the line. The single point shall be defined by a cartesian vector. It is assumed that a vector is a mathematical object with origin at (0,0) and terminus at some point (x,y) in the Real cartesian plane. Each line and the point shall have alphanumeric identifiers that will be used primarily for output purposes. 2. For each problem instance in the input file, compute the following: (a) The point of intersection of the two lines, if the lines are not parallel. (b) Alternatively, output a message stating that the given lines are “parallel” and non-intersecting, or “co-linear” and intersecting at every point on both lines. (c) For each line, compute the distance of the given point from that line. 3.For each problem instance in the input file, write to an ascii output file, also specified by the user at runtime, the following information: (a) An echo of the problem data with both lines and point properly identified. (b) The point of intersection of the two lines, or an appropriate message. (c) For each line (identified properly) output the distance of the given point. The system shall correctly process test input files provided by the client. The developer shall use a specification of the vector abstraction provided by the client, and shall deliver a reusable implementation of this abstraction.

February 8, 2001(c) Dr. David A. Workman3 Vector Abstraction Specification Requirements 1.The name shall be Vector. 2.A vector shall have a representation using Cartesian coordinates and using Polar coordinates. 3.The following operations shall be supported: –A constructor using Cartesian coordinates –A conversion to Polar coordinates –Projection functions for each Cartesian axis. –A Magnitude function –A Unitization function (computes a unit vector in the same direction) –A Negation funtion –A Dot product function –A Cross product function –A Add and Difference function –A Scalar product function –An Insertion operation for writing an vector image to an ascii file –An Extraction operation for parsing a vector image input from an ascii file. –A conversion to an ascii string (same format as Insertion and Extraction). 4.The vector abstraction shall raise a VectorException error for any illegal or undefined vector operations. Such an exception shall identify the operation and the reason for the error.

February 8, 2001(c) Dr. David A. Workman4 Use Case Diagram Vector Application System Specify Input File Specify Output File Read Problem Instance Write Problem Instance & Solution Compute Problem Solution * Application User « initiates » « uses » « includes » Ascii Input File Ascii Output File

February 8, 2001(c) Dr. David A. Workman5 Collaboration Diagram InputPrepMgr OutputPrepMgr App Control SystemIO ProblemMgr Problem Input File Output File Line Vector

February 8, 2001(c) Dr. David A. Workman6 Class Diagram: Ideal Design VectorApp ProblemMgr SysINSysOUT Fin: BufferedReader Problem 1 Fout: PrintStream opens  reads instances from  creates & manages   (3) 2 ProblemError (4)   writes solution to 1..* filehandling InputError InputPrepMgr OutputError OutputPrepMgr creates  vectorspace VectorException Line 2 acquires and provides files to  (1)throws exception (2)implements (3)writes to (4)reads from (1) (2) Vector CartImp PolarImp (1) (2) creates (3)   (3) (3)  (4)  2

February 8, 2001(c) Dr. David A. Workman7 Design Rationale Package Definition Packages should be defined to encapsulate potentially autonomous subsystems or reusable components. In this problem there are four packages: a)vectorapplication: this package encapsulates the following application classes: VectorApp, ProblemMgr, Problem, Line, ProblemError. VectorApp is the main control class, ProblemMgr is a control class, Problem and Line are Entity classes, and ProblemError is an exception class. b)vectorspace: this package encapsulates the abstraction for 2D vectors and consists of the following classes: CartImp, PolarImp, and VectorException; the package has a generic interface unit called Vector. CartImp is an Entity class implementing Vector using Cartesian coordinates of 2D vectors, while PolarImp is an Entity class implementing Vector using polar coordinates. VectorException is an exception class. c)filehandling: this package encapsulates the user interface classes necessary to create or initialize ascii input and output files used by an application. It consists of the following classes: InputPrepMgr, OutputPrepMgr, InputError, OutputError. InputPrepMgr and OutputPrepMgr are Control classes, while InputError and OutputError are Exception classes. d)java.io: this is a library package provided access to boundary class System and boundary objects System.in(SysIN) and System.out (SysOUT). It also encapsulates ascii file boundary classes: BufferedReader, PrintStream, File, InputStreamReader, FileOutputStream.

February 8, 2001(c) Dr. David A. Workman8 Design Rationale filehandling was defined as a package for two reasons: (a)Many applications use ascii file IO. Such applications frequently require use cases for interacting with the user to obtain file names. InputPrepMgr encapsulates the use case for obtaining and opening an ascii input file – if this is not possible, InputError exception is thrown to the client code. Similarly, OutputPrepMgr encapsulates the use case for obtaining and creating an ascii output file. Again, if this is not possible, an OutputError exception is thrown to the client. Two independent classes are defined to give the client the flexibility of invoking one or both of these use cases in a particular order. (b)The current application only calls for ascii file IO. However, other applications may require these same use cases implemented using GUI dialogue window. By packaging these use cases, the developer can either add new classes to support GUI interaction or modifying the existing classes to change the style of interface – the former approach would be the preferred design choice.

February 8, 2001(c) Dr. David A. Workman9 Design Rationale vectorspace was defined as a package for one primary reason: Many applications may require a 2D vector abstraction. Thus the reason was for future reusability. An abstract interface was defined because at least two obvious implementations of 2D vectors should be provided to any application: one using cartesian coordinates and one using polar coordinates. vectorapplication This package is the default package and contains all the classes that are necessary to satisfy the application-specific requirements. VectorApp: this is the main class and defines the primary execution entry point and control thread. Its primary responsibility is to acquire and distribute necessary application resources (two file objects) to the ProblemMgr – the control object responsible for managing the processing steps necessary to fulfill application requirements. ProblemMgr: this is a control object that manages the computation necessary to parse each problem instance in the input file, to solve each problem instance, and to produce the required application output to the output file. see notes

February 8, 2001(c) Dr. David A. Workman10 Design Rationale vectorapplication (continued) Line: this entity class is an abstraction of a line in 2D space. It is designed as a composition of 2 vectors (points), and therefore its implementation reuses the vector abstraction. –Line also encapsulates the two methods necessary to solve each problem instance, that is, find the intersection of two lines and the distance of a vector (point) to a given line. These are natural and logical operations for line objects. –The line abstraction also encapsulates the knowledge about how a line object is to be represented on ascii file objects. –Line also hides the knowledge about its representation as two vector components (two views: point + direction OR two points. Problem: this is an entity class that encapsulates the data for a single problem instance. –Problem is composed of 2 lines and 1 vector. –Problem encapsulates how the problem components are arranged on the input file. –Problem encapsulates how the problem solution is to be presented on the output file. –Problem manages the computation necessary to produce the solution and to handle errors that might arise in reading problem data and computing the solution. ProblemError: this is an exception class providing data about the causes of exceptional conditions arising during problem IO and problem solving.