Software Design. The Software Challenge In industry, a software product is expected to be used for an extended period of time by someone who did not write.

Slides:



Advertisements
Similar presentations
10 Software Engineering Foundations of Computer Science ã Cengage Learning.
Advertisements

Cmp Sci 187: Introduction to Software Design Following Chapter 1 of text (Koffmann and Wolfgang)
1 The Software Challenge People may come and go, but software may remain A software product is often expected to be used for an extended period of time.
1 Information Systems Development (ISD) Systems Development Life Cycle Overview of Analysis Phase Overview of Design Phase CP2236: Information Systems.
MCS 231: Concepts of Data Structure Class Hour: Section 1: MW 2:15PM - 3:30PM. Hyland 2306.
© 2006 ITT Educational Services Inc. SE350 System Analysis for Software Engineers: Unit 9 Slide 1 Appendix 3 Object-Oriented Analysis and Design.
Ch 12: Object-Oriented Analysis
ITEC200 Week01 Introduction to Software Design.
Introduction To System Analysis and Design
7M701 1 Software Engineering Object-oriented Design Sommerville, Ian (2001) Software Engineering, 6 th edition: Chapter 12 )
Fall 2007CS 225 Introduction to Software Design Chapter 1.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Software Development Software Life Cycle UML Diagrams.
Chapter 14: Object-Oriented Design
© 2006 Pearson Addison-Wesley. All rights reserved4-1 Chapter 4 Data Abstraction: The Walls.
Introduction to Software Design Chapter 1. Chapter 1: Introduction to Software Design2 Chapter Objectives To become familiar with the software challenge.
Fall 2007CS 2251 Software Engineering Intro. Fall 2007CS 2252 Topics Software challenge Life-cycle models Design Issues Documentation Abstraction.
1 CMSC 132: Object-Oriented Programming II Nelson Padua-Perez William Pugh Department of Computer Science University of Maryland, College Park.
Chapter 1 Principles of Programming and Software Engineering.
Software Engineering Principles and C++ Classes
Objectives Explain the purpose and objectives of object- oriented design Develop design class diagrams Develop interaction diagrams based on the principles.
Chapter 1 Program Design
Data Structures Using C++1 Chapter 1 Software Engineering Principles and C++ Classes.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
Spring 2009CS 225 Introduction to Software Design Chapter 1.
Introduction to Software Design Chapter 1. Chapter 1: Introduction to Software Design2 Chapter Objectives To become familiar with the software challenge.
Introduction To System Analysis and design
Copyright © 2002, Systems and Computer Engineering, Carleton University Intro.ppt * Object-Oriented Software Development Unit 1 Course.
CIS 321—IS Analysis & Design
Chapter 2: Approaches to System Development
Design Patterns OOD. Course topics Design Principles UML –Class Diagrams –Sequence Diagrams Design Patterns C#,.NET (all the course examples) Design Principles.
Chapter 1: Introduction to Systems Analysis and Design
1 SYS366 Lecture 1: Introduction to Systems. 2 What is Software Development? Software Development implies developing some software – but it does not involve.
Case Study: Designing A Telephone Directory Program Ellen Walker CPSC 201 Data Structures Hiram College Includes figures from Objects, Abstraction & Data.
An Introduction to Design Patterns. Introduction Promote reuse. Use the experiences of software developers. A shared library/lingo used by developers.
Copyright 2001 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Appendix A Object-Oriented.
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.
Unified Modeling Language, Version 2.0
Introduction to Software Design Chapter 1. Chapter Objectives  To become familiar with the software challenge and the software life cycle  To understand.
Introduction To System Analysis and Design
1 Systems Analysis and Design in a Changing World, Thursday, January 18, 2007.
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
The Systems Development Life Cycle
Data Structures Using C++1 Chapter 1 -Software Engineering Principles -ADT and Classes.
Notes of Rational Related cyt. 2 Outline 3 Capturing business requirements using use cases Practical principles  Find the right boundaries for your.
Programming Life Cycle Problem analysisunderstand the problem Requirements definition specify what program will do High- and low-level designhow it meets.
Data Structures Using C++1 Chapter 1 Software Engineering Principles and C++ Classes.
Object-Oriented Analysis and Design. Lesson 1: Introduction to Software Engineering.
Slide 1 Systems Analysis and Design With UML 2.0 An Object-Oriented Approach, Second Edition Chapter 2: Introduction to Object-Oriented Systems Analysis.
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
Slide 1 Systems Analysis and Design With UML 2.0 An Object-Oriented Approach, Second Edition Chapter 2: Introduction to Object-Oriented Systems Analysis.
Software Engineering and Object-Oriented Design Topics: Solutions Modules Key Programming Issues Development Methods Object-Oriented Principles.
1 Unified Modeling Language, Version 2.0 Chapter 2.
Chapter 1 Data Abstraction: The Walls CS Data Structures Mehmet H Gunes Modified from authors’ slides.
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 4 Slide 1 Software Processes.
1 SYS366 Week 1 - Lecture 1 Introduction to Systems.
Software Development Process CS 360 Lecture 3. Software Process The software process is a structured set of activities required to develop a software.
Program Design. Simple Program Design, Fourth Edition Chapter 1 2 Objectives In this chapter you will be able to: Describe the steps in the program development.
Basic Characteristics of Object-Oriented Systems
Software Design and Development Development Methodoligies Computing Science.
Engineering Quality Software Week02 J.N.Kotuba1 SYST Engineering Quality Software.
Chapter 1: Introduction to Systems Analysis and Design
Systems Analysis and Design With UML 2
About the Presentations
Chapter 20 Object-Oriented Analysis and Design
Chapter 1: Introduction to Systems Analysis and Design
Chapter 1: Introduction to Systems Analysis and Design
Presentation transcript:

Software Design

The Software Challenge In industry, a software product is expected to be used for an extended period of time by someone who did not write the program and who is not intimately familiar with its internal design The person who maintains the software is not necessarily the person who writes it It is important to design and document software in an organized way so that it can be easily understood and maintained after the initial release

The Software Challenge Initial specification for a software product may be incomplete. Specification is clarified through extensive interaction between users of the software and the system analyst. To avoid a communication gap, a requirements specification should be generated at the beginning of any software project. Designers and users should both approve the document

The Software Life Cycle Software products go through several stages as they mature from initial concept to finished product The sequence of stages is called a life cycle

Software Life Cycle Models Waterfall model: simplest way of organizing activities that transform software from one stage to another Activities are performed in sequence and the results of one flows into the next

Waterfall Model

Waterfall Model (continued)

Software Life Cycle Models Waterfall model is simple but unworkable Fundamental flaw is assumption that each stage can and must be completed before the next one occurs Sometimes, it is not until the product is finished that the user can fully express his or her requirements

Software Life Cycle Models (continued) Common themes among alternative models is to develop software product in stages or cycles Each stage could be a mini waterfall with varying emphasis on activities Unified Model: the cycles are called phases and iterations and the activities are called workflows Four phases Inception Elaboration Construction Transition At the end of each phase, there is a review with users

Software Life Cycle Models (continued)

Software Life Cycle Activities (continued) Independently of how they are organized, certain activities are essential for software development Requirements specification Architectural, component, and detailed designs Implementation Unit, integration, and acceptance tests Installation and maintenance

Software Life Cycle Activities (continued) Requirements Specification System analyst works with software users to clarify the detailed system requirements Questions include format of input data, desired form of any output screens, and data validation/potential errors E.g. incomplete specification: design and implement a telephone directory program that will contain a collection of names and numbers. We should be able to insert/delete/search What questions would you ask the user?

Requirements Inputs: Initial phone directory: each name/number pair will be read from separate lines of text file Additional entries: each entry is typed by the user at the keyboard when requested Outputs: Name and number of each person selected by the user are displayed on separate lines Updated phone directory: each name/number pair on separate line

Software Life Cycle Activities (continued) Analysis Make sure you completely understand the problem before starting the design or program a solution Evaluate different approaches to the design Commercial software/ in-house? New hardware? Cost/feasibility

Software Life Cycle Activities (continued) Design Top-down approach: breaking a system into a set of smaller subsystems Subproblems could be further refined and divided into still smaller problems.

Software Life Cycle Activities (continued)

Design Top-down design focuses on actions rather than data structures Object-oriented approach: focuses on data elements and operations to be performed on those data elements. View software as a collection of objects (entities). In OOD, you identify a set of objects and specify their interactions Looking at nouns in the problem specification can help you identify objects, and looking at verbs can point to their actions.

Software Life Cycle Activities (continued) Design UML diagrams are a design tool to illustrate the interactions between Classes Classes and external entities

Software Life Cycle Activities (continued) Actor/User: is an external entity to the program Open diamond: “aggregation” Entry is contained in a Directory, but it is an independent entity.

OOD OOD takes advantage of two techniques Abstraction Encapsulation

Techniques: Abstraction Provides high-level model of a physical entity or activity Procedural abstraction: Specify what is to be achieved by a procedure Hide algorithms Data abstraction: specify the data objects for a problem without concern for their representation in memory The designer can focus on how to use the data objects and their actions rather than low-level details of their implementation.

Techniques: Encapsulation Combine data elements and methods in a class and confine information so that it is only visible/accessible through an associated external interface (public methods in Java) Information hiding: Concealing the details of a class implementation from users of the class If a higher-level class references a data object only through its methods, the higher-level class will not have to be rewritten, even if the data representation or method implementation changes. e.g. myEntry.name myEntry.firstName + myEntry.lastName; MyEnrty.getFullName();

Java language constructs support OOP Interface: supports procedural abstraction Class: supports encapsulation

Abstract Data Types Abstract data type (ADT): The combination of data together with its methods “what” of the data structure, NOT “how” of the data structure E.g. Stack ADT? –Data? –Operations? The primary goal of this class is to teach you how to use ADTs and how to create their implementations. Also, you will be introduced to Java API’s ADTs.

Interfaces A Java interface is a way to specify an ADT The interface specifies the names, parameters, and return values of the ADT methods without specifying how the methods perform their operations and without specifying how the data is internally represented May also contain constant definitions public interface Comparable { public int compareTo(Object o); }

Interfaces A Java interface is a contract between the interface designer and the programmer who codes a class that implements the interface Each class that implements an interface must provide the definitions of all methods declared in the interface public class SomeClass implements Comparable {…}

Interfaces public interface PDUserInterface { /** method that processes user thePhoneDirectory The PhoneDirectory object that contains the data to be displayed and/or changed. */ void processCommands(PhoneDirectory thePhoneDirectory); } Note the Javadoc comments!

> PDUserInterface PDConsoleIO processCommands() PDGUIO processCommands()

Analysis (continued) Refinement of class diagram Refinement of phone Directory Application Class Diagram: revision 1 Components of PDApplication At this point, two abstract data types are identified PDUserInterface PhoneDirectory Closed diamond: “composition” The component does not have independent existence.

Design of an Array-Based Phone Directory Next, we identify all major classes and interfaces that will be part of the problem solution and describe their interaction. PDApplication: Contains the main method. Instantiates a PhoneDirectory object and loads the initial directory. Creates a new PDUserInterface object PDUserInterface (and classes that implement this interface) Accepts command from the user and calls appropriate methods from the PhoneDirectory. PhoneDirectory (and classes that implement this interface) Will need a DirectoryEntry class We also need classes from Java API to perform I/O

Design of an Array-Based Phone Directory Identify data fields for classes and design algorithms for their methods In UML class diagrams + sign next to a method or attribute means it is public - sign next to a method or attribute means it is private Classes to design include: PDApplication class PDConsoleIO class (or PDGUIO class): implements the PDUserInterface interface. ArrayBasedPD class: implements the PhoneDirectory interface. Will contain an array of DirectoryEntrys. DirectoryEntry class: contains a name/number pair.

Design of an Array-Based Phone Directory (continued) Open diamond “aggregation” means DirectoryEntry is a component of ArrayBasedPD but can be associated with other objects as well.

Design of an Array-Based Phone Directory (continued)

Designing the Array-Based Phone Directory (continued) Provide algorithms (in pseudocode) for all the methods Algorithm for addOrChangeEntry Input: name and number 1.Call internal method find to see whether the name is in the directory 2.if the name is in the directory 3. Change the number using the setNumber method of the DirectoryEntry else 4. Add a new entry (name, number) using internal method add 5. Return null.

Designing the Array-Based Phone Directory (continued) Algorithm for lookUpEntry Input: name 1.The PhoneDirectory object uses its internal find method to locate the entry 2.if the entry is found 3. DirectoryEntry ’s getNumber method retrieves the number, which is returned to the caller. else 4. Return null.

Designing the Array-Based Phone Directory (continued) Algorithm for find Input: name 1.for ( i=0; i< size; i++ ) 2. if theDirectory[i].getName() is equal to name 3. Return i else 4. Return -1

Designing the Array-Based Phone Directory (continued) Algorithm for add Input: name, number 1.if ( size >= capacity ) 2. allocate a new array whose capacity is twice the current array using the internal reallocate method. 3.Create a new DirectoryEntry object with the given name and number, and place it at index size of the array (first empty location). 4.Increment size

Implementing and Testing the Array-Based Phone Directory

Design of an Array-Based Phone Directory (continued) These are private methods used to help the public methods.

Homework Carefully study section 1.6 and 1.7 (Implementation of Array-Based PhoneDirectory and GUIs)