Software Engineering Design & UML.

Slides:



Advertisements
Similar presentations
Object-Oriented Software Development CS 3331 Fall 2009.
Advertisements

Recursion, pt. 2: Thinking it Through. What is Recursion? Recursion is the idea of solving a problem in terms of solving a smaller instance of the same.
IEC Substation Configuration Language and Its Impact on the Engineering of Distribution Substation Systems Notes Dr. Alexander Apostolov.
CSE 1302 Lecture 8 Inheritance Richard Gesick Figures from Deitel, “Visual C#”, Pearson.
Inheritance Inheritance Reserved word protected Reserved word super
Ch 12: Object-Oriented Analysis
Object-Oriented Analysis and Design
ITEC200 Week01 Introduction to Software Design.
1 Inheritance Reserved word protected Reserved word super Overriding methods Class Hierarchies Reading for this lecture: L&L 8.1 – 8.5.
1 Programming for Engineers in Python Autumn Lecture 5: Object Oriented Programming.
Fall 2007CS 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.
Chapter 1 Software Development. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. 1-2 Chapter Objectives Discuss the goals of software development.
Essentials of interaction diagrams Lecture Outline Collaborations Interaction on collaboration diagrams Sequence diagrams Messages from an object.
Lecture 1 CS171: Game Design Studio 1I UC Santa Cruz School of Engineering 5 January 2010.
Aalborg Media Lab 23-Jun-15 Inheritance Lecture 10 Chapter 8.
1 Lecture 5 Introduction to Software Engineering Overview  What is Software Engineering  Software Engineering Issues  Waterfall Model  Waterfall Model.
Chapter 1 Principles of Programming and Software Engineering.
1 CS1001 Lecture Overview Object Oriented Design Object Oriented Design.
Software Engineering Principles and C++ Classes
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.
ECE122 L17: Method Development and Testing April 5, 2007 ECE 122 Engineering Problem Solving with Java Lecture 17 Method Development and Testing.
Inheritance and Polymorphism CS351 – Programming Paradigms.
Unit 221 UML Back Ground Class Diagrams Inheritance Hierarchy UML Patterns.
Introduction to Software Design Chapter 1. Chapter 1: Introduction to Software Design2 Chapter Objectives To become familiar with the software challenge.
C++ fundamentals.
Distribution of Marks Internal Sessional Evaluation Assignments – 10 Quizzes – 10 Class Participation Attendence – 5 Mid – Term Test – 25 External Evaluation.
Abstraction: Polymorphism, pt. 1 Abstracting Objects.
DCT 1123 PROBLEM SOLVING & ALGORITHMS INTRODUCTION TO PROGRAMMING.
Comp 245 Data Structures Software Engineering. What is Software Engineering? Most students obtain the problem and immediately start coding the solution.
Introduction to Object-oriented programming and software development Lecture 1.
Java Class Syntax CSIS 3701: Advanced Object Oriented Programming.
CS 360 Lecture 3.  The software process is a structured set of activities required to develop a software system.  Fundamental Assumption:  Good software.
OOD Case Study (For parallel treatment, see Chapter 2 of the text)
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.
Introduction to Software Design Chapter 1. Chapter Objectives  To become familiar with the software challenge and the software life cycle  To understand.
Chapter 06 (Part I) Functions and an Introduction to Recursion.
CSE 219 Computer Science III Program Design Principles.
Software Development Cycle What is Software? Instructions (computer programs) that when executed provide desired function and performance Data structures.
Data Structures Using C++1 Chapter 1 -Software Engineering Principles -ADT and Classes.
An Object-Oriented Approach to Programming Logic and Design Fourth Edition Chapter 6 Using Methods.
Data Structures Using C++1 Chapter 1 Software Engineering Principles and C++ Classes.
1 Introduction to Classes and Objects Chapter 3 Introduction to Classes and Objects Chapter 3.
Designing Classes Chapter 3. 2 Chapter Contents Encapsulation Specifying Methods Java Interfaces Writing an Interface Implementing an Interface An Interface.
Linked List. Iterators Operation to find a link, deleting, and inserting before or after a specified link, also involve searching through the list to.
Connecting with Computer Science2 Objectives Learn how software engineering is used to create applications Learn some of the different software engineering.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
Copyright ©2004 Virtusa Corporation | CONFIDENTIAL Requirement Engineering Virtusa Training Group 2004 Trainer: Ojitha Kumanayaka Duration : 1 hour.
Software Engineering Requirements + Specifications.
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
Chapter 10: Classes and Data Abstraction. Objectives In this chapter, you will: Learn about classes Learn about private, protected, and public members.
Software Engineering and Object-Oriented Design Topics: Solutions Modules Key Programming Issues Development Methods Object-Oriented Principles.
8.1 8 Algorithms Foundations of Computer Science  Cengage Learning.
Functions Functions, locals, parameters, and separate compilation.
Software Development Process CS 360 Lecture 3. Software Process The software process is a structured set of activities required to develop a software.
CLASSES AND OBJECTS Chapter 3 : constructor, Separate files, validating data.
 Description of Inheritance  Base Class Object  Subclass, Subtype, and Substitutability  Forms of Inheritance  Modifiers and Inheritance  The Benefits.
CMSC 104, Section 301, Fall Lecture 18, 11/11/02 Functions, Part 1 of 3 Topics Using Predefined Functions Programmer-Defined Functions Using Input.
Web Routing Designing an Interface
Object-Oriented Analysis and Design
Modern Systems Analysis and Design Third Edition
Principles of Programming and Software Engineering
Unit# 9: Computer Program Development
Chapter 4 void Functions
Lecture 22 Inheritance Richard Gesick.
MSIS 655 Advanced Business Applications Programming
Introduction to Systems Analysis and Design Stefano Moshi Memorial University College System Analysis & Design BIT
Teaching slides Chapter 6.
Modern Systems Analysis and Design Third Edition
Presentation transcript:

Software Engineering Design & UML

The Waterfall Model Marketing Analysis Design Implementation Testing Requirements Analysis Specifications Design Architecture Untested Software Implementation Testing Program Maintenance

Design Once the specification is completed, the next step is to determine the design for the desired system. That is, once we know “what” sort of system is both possible and acceptable to both parties, we may then turn to the question of “how” to make that system.

Design The goal of the design process is to develop the potential structure for a codified system which would fulfill the determined specification for the desired program. Basically, we want to figure out how we would ideally code up the program before actually writing a line of code.

Design This process will often involve splitting the underlying problem into multiple pieces that are simpler to solve. This is then done, repeatedly, until these smaller problems are reduced to the object level. One early potential split of the problem…

Ideal Program Division Control, UI Data Algorithms

Ideal Program Division The manner by which the different data elements will be represented internally does not have to be tied to its representation for input or output. At the same time, we should design objects to make the task of input and output easier.

Ideal Program Division As noted when discussing “use cases”, sometimes not all users of system should have access to the same user interface. (UI) Each type of “actor” should only be able to use program features it needs. As such, the true, core functionality of a program should not be linked directly to any single UI within the system.

Ideal Program Division Polymorphism is often useful for allowing storage structures or general-purpose algorithms to be reusable for multiple types of data. In essence, good use of polymorphism can often simplify the design or implementation effort of a program and enable “plug-and-play” code reuse.

Ideal Program Division At other times, polymorphism can be used to allow smaller parts of functionality to be variable within a large method. Function pointers are useful, but there are complications and aren’t always directly available in some programming languages.

Ideal Program Division 1111 This is actually done in Paint.NET, a freely-downloadable image editor – unfortunately, the source is no longer available, but I downloaded it once before it became restricted and looked at its architecture. Ideal Program Division Polymorphism can be quite useful for abstracting elements of the UI to work in multiple manners. In photo-editing software, each “tool” that can be used to edit an image can be a separate interface. Changing the active “interface” changes how mouse-clicks and such are interpreted, based upon the interface’s implementation of appropriate methods.

Class Hierarchy As with the process of determining requirements and the specification of a program, it is often helpful to have visual diagrams to aid in the design process as well. For design, we now wish to capture the relationships among individual classes.

Class Hierarchy How can we represent these design ideas for a given programming project effectively and efficiently? One super-common visualization tool for the design process is known as UML: the Unified Modeling Language. Not to be confused with HTML, XML, …

Class Hierarchy In UML, each class and interface gets specified, along with arrows to show the relationships among them. Furthermore, the methods (and fields, for classes) of each are also specified. This establishes a standardized, known interface that other coders on the team may then use for each object type.

UML Standard structure of a UML diagram element for a class: MyClass ---------------------------------------------- - int integer_field - string string_field + int get_Integer_Field() + void set_Integer_Field(int) + void doSomething(String, int) Class Name -------------------------- fields methods

UML A ‘-’ indicates the private modifier, and ‘+’ the public modifier. MyClass ---------------------------------------------- - int integer_field - string string_field + int get_Integer_Field() + void set_Integer_Field(int) + void doSomething(String, int) Class Name -------------------------- fields methods

UML Let’s examine how this can be useful for a program’s design through some example code: a Tic-Tac-Toe program.

UML <<type>> Participant ---------------------------------------------- + Position getMove(char, TicTacToeBoard &) <<type>> indicates that Participant is a “pure” abstract class, with no fields or definitions. Human ---------------------- Computer ---------------------------------------------- - MoveEvaluation getMoveInternal(char, TicTacToeBoard &) + Player getOtherPlayer(Player) Denotes that the Computer class utilizes the other. MoveEvaluation ---------------------- + Position bestPos + Player winner_when_minimize_opponent

UML TicTacToeGame has fields of the types pointed to by solid, open-ended arrows: Participant and TicTacToeBoard. TicTacToeGame ----------------------------------- - Participant* player1 - Participant* player 2 - TicTacToeBoard board TicTacToeBoard ----------------------------------- … A lot of stuff. I’ll spare that for now. Participant (abstract) ---------------------------------------------- + Position getMove(char, TicTacToeBoard &) Participant uses the TicTacToeBoard type as a parameter for (at least) one of its methods.

UML UML thus allows us to visually model the conceptual (and eventually-to-be codified) relationships among the elements of a program. It visually represents the polymorphic nature of the different types which will be implemented. It also models the general dependencies across types.

2121 Self-reminder – show that there code! Questions?

Design Referencing back to our work in last lecture, note how we made use of some of the ideas of UML.

Design

Design C++ header files are somewhat like a text-based form of UML for the objects they declare. UML additionally aims to visually show the relationships between objects in a graphical manner. For header files, you’d have to manually look across them to determine relationships.

Design

Design While not quite using the same visual syntax as UML, we clearly established the relationships among the declared types of our program.

Design Note how in an earlier lecture, we worked out the core design for the important objects in our shapes program. BoundingBox Shape

Design Note how we never got to actually implement Shape, but we knew how to use it to implement BoundingBox. We never actually even wrote Shape.h properly, due to time constraints.

Design With UML, we clearly define the important types within the program and what would be necessary methods for them to provide As a result, we could implement what we did, how we did, without needing to see the unimplemented parts

Design In terms of a large project, those other parts could easily have been left to someone else to implement The interfaces entirely define the interactions Ah, the joys of abstract data types and information hiding!