Software Quality Factors OOA, OOD, and OOP Object-oriented techniques enhance key external and internal software quality factors, e.g., 1. External (v



Similar documents
Software Design Principles and Guidelines

Software Engineering

Glossary of Object Oriented Terms

Objectives. Chapter 2: Operating-System Structures. Operating System Services (Cont.) Operating System Services. Operating System Services (Cont.

Functional Decomposition Top-Down Development

Fourth generation techniques (4GT)

Johannes Sametinger. C. Doppler Laboratory for Software Engineering Johannes Kepler University of Linz A-4040 Linz, Austria

Quotes from Object-Oriented Software Construction

Object Oriented Design

Managing Variability in Software Architectures 1 Felix Bachmann*

Introduction to Embedded Systems. Software Update Problem

Chapter 3: Operating-System Structures. System Components Operating System Services System Calls System Programs System Structure Virtual Machines

Algorithms, Flowcharts & Program Design. ComPro

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

Chapter 8 Approaches to System Development

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

Software Paradigms (Lesson 1) Introduction & Procedural Programming Paradigm

Introduction to Object-Oriented Programming

Aerospace Software Engineering

Aspect-Oriented Programming

Construction Principles and Design Patterns. Flyweight, Bridge, Builder

Architecture. Reda Bendraou


Engineering Process Software Qualities Software Architectural Design

Real Time Programming: Concepts

A standards-based approach to application integration

How To Develop Software

SOFTWARE DESIGN TECHNIQUES. Nagalaxmi Telkar CSCI 5828 Presentation Slides

Chapter 13: Program Development and Programming Languages

An Introduction to Software Architecture

Chapter 1: Key Concepts of Programming and Software Engineering

Client/Server Computing Distributed Processing, Client/Server, and Clusters

Application Centric Infrastructure Object-Oriented Data Model: Gain Advanced Network Control and Programmability

System Structures. Services Interface Structure

Operating System Structures

Improved Software Testing Using McCabe IQ Coverage Analysis

Service Oriented Architecture 1 COMPILED BY BJ

Chapter 13: Program Development and Programming Languages

High-level Design. What is software architecture?

1 Organization of Operating Systems

Advanced Analysis and Design

Software Design Principles and Guidelines

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

How do Users and Processes interact with the Operating System? Services for Processes. OS Structure with Services. Services for the OS Itself


OOP? What is OOP? Why? OOP in a nutshell. Stéphane Ducasse 2.1

Vragen. Architecture presentations in practice. Some terms (from IEEE standard)

The Benefits of Component Object- Based SCADA and Supervisory System Application Development

Knowledge, Certification, Networking

Topics. Introduction. Java History CS 146. Introduction to Programming and Algorithms Module 1. Module Objectives

Computer Organization

Software Architecture. New wine in old bottles? (i.e., software architecture global design?, architect designer)

Chapter 4: Tools of Modern Systems Analysis

Component Based Software Engineering: A Broad Based Model is Needed

OKLAHOMA SUBJECT AREA TESTS (OSAT )

Options. Acquiring an application. Custom development. Off-the-shelf. Trade-off. Outsourcing development

What Is Software Configuration Management?

Java (12 Weeks) Introduction to Java Programming Language

MICHIGAN TEST FOR TEACHER CERTIFICATION (MTTC) TEST OBJECTIVES FIELD 050: COMPUTER SCIENCE

Software Testing Interview Questions

Service Oriented Architecture

Extend the value of your core business systems.

22C:22 (CS:2820) Object-Oriented Software Development

Kernel Types System Calls. Operating Systems. Autumn 2013 CS4023

OO Design Quality Metrics

Service-Oriented Architectures

Software Design. Design (I) Software Design Data Design. Relationships between the Analysis Model and the Design Model

Patterns in Software Engineering

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

Operating system Dr. Shroouq J.

The Service Revolution software engineering without programming languages

2. Analysis, Design and Implementation

Software Service Engineering Architect s Dream or Developer s Nightmare?


Example of Standard API

50 Computer Science MI-SG-FLD050-02

Data Abstraction and Hierarchy

Getting started with API testing

Chap 1. Introduction to Software Architecture

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

McGraw-Hill The McGraw-Hill Companies, Inc.,

Division of Mathematical Sciences

CS 451 Software Engineering Winter 2009


A Comparative Analysis of Structured and Object-Oriented Programming Methods ASAGBA, PRINCE OGHENEKARO; OGHENEOVO, EDWARD E. CPN, MNCS.

It is the thinnest layer in the OSI model. At the time the model was formulated, it was not clear that a session layer was needed.

SOACertifiedProfessional.Braindumps.S90-03A.v by.JANET.100q. Exam Code: S90-03A. Exam Name: SOA Design & Architecture

Managing a Fibre Channel Storage Area Network

Classnotes 5: 1. Design and Information Flow A data flow diagram (DFD) is a graphical technique that is used to depict information flow, i.e.

KITES TECHNOLOGY COURSE MODULE (C, C++, DS)

French Scheme CSPN to CC Evaluation

Architecture Example Point-to-point wire

KWIC Exercise. 6/18/ , Spencer Rugaber 1

Peter Mileff PhD SOFTWARE ENGINEERING. The Basics of Software Engineering. University of Miskolc Department of Information Technology

Introduction to Software Paradigms & Procedural Programming Paradigm

CS 3530 Operating Systems. L02 OS Intro Part 1 Dr. Ken Hoganson

IF The customer should receive priority service THEN Call within 4 hours PCAI 16.4

Intelligent Agents. Based on An Introduction to MultiAgent Systems and slides by Michael Wooldridge

The WLCG Messaging Service and its Future

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

Transcription:

Object-Oriented Design and Programming Deja Vu? In the past: Structured = Good Overview of Object-Oriented Design Principles and Techniques Today: Object-Oriented = Good e.g., Douglas C. Schmidt www.cs.wustl.edu/schmidt/ schmidt@cs.wustl.edu Washington University, St. Louis Object-oriented languages are good Ada is an object-oriented language ---------- Therefore, Ada is good Note, there is even an object-oriented COBOL! 1 2 Overview What are object-oriented (OO) methods? Goals Demystify the hype surrounding OOD and OOP { OO methods provide a set of techniques for analyzing, decomposing, and modularizing software system architectures { In general, OO methods are characterized by structuring the system architecture on the basis of its objects (and classes of objects) rather than the actions it performs Focus on OOD/OOP principles, methods, notations, and tools What are the benets of OO? Relate OOD/OOP to traditional development methods { OO enhances key software quality factors of a system and its constituent components What is the rationale for using OO? { In general, systems evolve and functionality changes, but objects and classes tend to remain stable over time 3 4

Software Quality Factors OOA, OOD, and OOP Object-oriented techniques enhance key external and internal software quality factors, e.g., 1. External (visible to end-users) (a) Correctness Object-oriented methods may be applied to dierent phases in the software lifecycle { e.g., analysis, design, implementation, etc. (b) Robustness and reliability (c) Performance 2. Internal (visible to developers) (a) Modularity (b) Flexibility/Extensibility (c) Reusability (d) Compatibility (via standard/uniform interfaces) OO analysis (OOA) is a process of discovery { Where a development team models and understands the requirements of the system OO design (OOD) is a process of invention and adaptation { Where the development team creates the abstractions and mechanisms necessary to meet the system's behavioral requirements determined during analysis 5 6 OOA, OOD, and OOP (cont'd) OOA, OOD, and OOP (cont'd) Is it also useful to distinguish between objectoriented design (OOD) and object-oriented programming (OOP) { OOD is relatively independent of the programming language used { OOP is primarily concerned with programming language and software implementation issues Basic Denitions 1. Object-Oriented Design { A method for decomposing software architectures based on the objects every system or subsystem manipulates Rather than \the" function it is meant to ensure 2. Object-Oriented Programming Obviously, the more consistent the OOD and OOP techniques, the easier they are to apply successfully in real-life: :: { The construction of software systems as structured collections of Abstract Data Type (ADT) implementations, plus inheritance and dynamic binding 7 8

Object-Oriented Design Topics Object-oriented design concepts include: { Decomposition/Composition { Abstraction Modularity Information Hiding Virtual Machine Hierarchies { Separating Policy and Mechanism { Subset Identication and Program Families { Reusability Object-Oriented Programming Topics Object-oriented programming features and techniques include { Data abstraction and information hiding { Active (rather than passive) types { Genericity { Inheritance and dynamic binding { Programming by contract { Assertions and exception handling Main purpose of these design concepts is to manage software system complexity by improving software quality factors 9 Throughout the course we'll discuss how these OOP features and techniques improve software quality { e.g., correctness, reusability, extensibility, reliability, etc. 10 Review: Goals of the Design Phase Decompose System into Modules { i.e., identify the software architecture via \clustering" In general, clusters should maximize cohesion and minimize coupling Review: Goals of the Design Phase (cont'd) Specify Module Interfaces { Interfaces should be well-dened facilitate independent module testing Determine Relations Between Modules { Identify and specify module dependencies e.g., inheritance, composition, uses, etc. { Determine the form of intermodule communication, e.g., global variables parameterized function calls shared memory RPC or message passing 11 improve group communication Describe Module Functionality { Informally e.g., comments or documentation { Formally e.g., via module interface specication languages 12

Decomposition/Composition Decomposition and composition are concepts common to all software life-cycle and design techniques The basic concepts are very simple: 1. Select a portion of the problem (initially, the whole problem) 2. Decompose the selected portion into one or more constitutent components using the design method of choice { e.g., functional vs. data structured vs. objectoriented 3. Determine and depict how the components interact (i.e., composition) 4. Repeat steps 1 through 3 until some termination criteria is met (e.g., customer is satised, run out of money, etc. ;-)) 13 Decomposition/Composition (cont'd) A major challenge of the design phase for a system is to determine what the primary units of decomposition and composition ought to be Another way of looking at this is to ask \at what level of abstraction should the modules be specied?" Typical units of decomposition and composition include: { Subsystems { Virtual machine levels { Classes { Functions 14 Abstraction Decomposition/Composition (cont'd) Some principles for guiding the decomposition and composition process { Since design decisions transcend execution time, modules often do not correspond to execution steps::: { Decompose so as to limit the eect of any one design decision on the rest of the system { Remember, anything that permeates the system will be expensive to change { Modules should be specied by all information needed to use the module and nothing more { Try to compose the system by reusing existing components if possible { Abstraction provides a way to manage complexity by emphasizing essential characteristics and suppressing implementation details Traditional abstraction mechanisms { Name abstraction { Expression abstraction { Procedural abstraction e.g., closed subroutines { Data abstraction e.g., ADTs { Control abstraction iterators, loops, multitasking, etc. 15 16

Modularity Criteria for Evaluating Design { Modularity is an essential characteristic of good designs since it: Enables developers to reduce overall system complexity via decentralized software architectures Methods Modular Decomposability { Does the method aid decomposing a new problem into several separate subproblems? e.g., top-down functional design i.e., divide and conquer Enhances scalability by supporting independent and concurrent development by multiple personnel i.e., Separation of concerns Modular Composability { Does the method aid constructing new systems from existing software components? e.g., bottom-up design To be both useful and reusable, modules should possess 1. Well-specied abstract interfaces 2. High cohesion and low coupling 17 Modular Understandability { Are modules separately understandable by a human reader e.g., how tightly coupled are they? 18 Criteria for Evaluating Design Methods (cont'd) Modular Continuity { Do small changes to the specication aect a localized and limited number of modules? Principles for Ensuring Modular Designs Language Support for Modular Units { Modules must correspond to syntactic units in the language used Modular Protection { Are the eects of run-time abnormalities con- ned to a small number of related modules? Few Interfaces { Every module should communicate with as few others as possible Modular Compatibility { Do the modules have well-dened, standard and/or uniform interfaces? e.g., \principle of least surprise" Small Interfaces (Weak Coupling) { If any two modules communicate at all, they should exchange as little information as possible 19 20

Information Hiding Principles for Ensuring Modular Designs (cont'd) Explicit Interfaces { Whenever two modules A and B communicate, this must be obvious from the text of A or B or both { Details of design decisions that are subject to change should be hidden behind abstract interfaces i.e., modules { Information hiding is one means to enhance abstraction Typical information to hide includes: Information Hiding { All information about a module should be private to the module unless it is specically declared public { Data representations { Algorithms { Input and Output Formats { Policies and/or mechanisms { Lower-level module interfaces 21 22 Virtual Machines { To reduce overall complexity, software system architectures may be decomposed into, more manageable \virtual machine" units Common examples of virtual machines include { Computer Architectures A virtual machine provides an extended \software instruction set" { Provides additional data types and associated \software instructions" that extend the underlying hardware instruction set { Virtual machines allow incremental extensions to existing \application programmatic interfaces" (APIs) e.g., compiler! assembler! object code! microcode! gates, transistors, signals, etc. { Communication protocol stacks e.g., ISO OSI reference model, Internet reference model 23 24

Several challenges must be overcome to eectively use virtual machines as an architectural structuring technique: { Ensuring Adequate Performance: It is dicult to obtain good performance at level N, if below N are not implemented ef- ciently This often requires implementing the virtual machine dierently than the design may dictate::: { Alleviating Inter-level Dependencies To maximize reuse, it is essential to eliminate/reduce dependencies \between" virtual machine levels::: Therefore, virtual machines are often organized into hierarchical layers or levels of abstraction 25 A \hierarchy" may be dened to reduce module interactions by restricting the topology of relationships between virtual machines A relation denes a hierarchy if it partitions units into levels { Level 0 is the set of all units that use no other units { Level i is the set of all units that use at least one unit at level < i and no unit at level > i Advantages of hierarchical structuring { Facilitates independent development of levels or layers { Isolates ramications of change { Enables rapid prototyping 26 Relations that dene hierarchies: { Uses { Is-Composed-Of { Is-A { Has-A The rst two are general to all design methods, the latter two are more particular to object-oriented design and programming The Uses Relation { X Uses Y if the correct functioning of X depends on the availability of a correct implementation of Y { Note, uses is not necessarily the same as invokes: Some invocations are not uses relations e.g., error logging Some uses relations don't involve direct invocations e.g., message passing, interrupts, shared memory access { A simple, but eect design heuristic is to design uses relations that yield a hierarchy i.e., avoid cycles in the \uses graph" 27 28

The Uses Relation (cont'd) { Allow X to use Y when: X is simpler because it uses Y e.g., standard C library routines, OSI layers Y is not substantially more complex because it is not allowed to use X i.e., hierarchies should be designed to be useful, and not just to blindly satisfy software engineering principles There is a useful subset containing Y and not X i.e., allows sharing and reuse of Y There is no conceivably useful subset containing X but not Y The Uses Relation (cont'd) { How should recursion be handled? Group X and Y as a single entity in the uses relation { A hierarchy in the uses relation is essential for designing non-trivial reusable software systems { Note that certain software systems require some form of controlled violation of a uses hierarchy e.g., asynchronous communication protocols, call-back schemes, signal handling, etc. Upcalls are one way to control these nonhierarchical dependencies i.e., Y is necessary for X to function correctly 29 30 The Is-Composed-Of Relation { The is-composed-of relationship illustrates how the system is statically decomposed into its constituent components { X is-composed-of fx i g if X is a group of units x i that share some common purpose { A graphical description of a system's architecture may be specied by the is-composed-of relation such that: Non-terminal are \virtual" code Terminals are the only units represented by \actual" code The Is-Composed-Of Relation (cont'd) { Many programming languages support the iscomposed-of relation via some higher-level module or record structuring technique { Note: the following are not equivalent: 1. Level (virtual machine) 2. Module (an entity that hides a secret) 3. A subprogram (a code unit) 4. A record (a passive data structure) { Modules and levels need not be identical, as a module may have several components on several levels of a uses hierarchy Likewise, a level may be implemented via several modules::: 31 32

The Is-A and Has-A Relations { These two relationships are associated with object-oriented design and programming languages that possess inheritance and class features { Is-A (descendant or inheritance) relationship class X possesses Is-A relationship with class Y if instances of class X are specialization of class Y e.g., a square is a specialization of a rectangle, which is a specialization of a shape::: { Has-A (client or composition) relationship class X possesses a Has-A relationship with class Y if instances of class X contain an instance(s) of class Y e.g., a car has an engine and four tires::: 33 Separate Policies and Mechanisms { Separate concerns between the what/when and the how at both the design and implementation phases Multiple policies may be implemented via a set of shared mechanisms { e.g., OS scheduling and virtual memory paging Same policy can be implemented by multiple mechanisms { e.g., reliable, non-duplicated, bytestream service can be provided by multiple communication protocols What is a policy and what is a mechanism is a matter of perspective: :: 34 Program Families and Subsets Program families are a collection of related modules or subsystems that form a reusable application framework, e.g., { UNIX System V STREAMS I/O subsystem { Graphical user interface frameworks such as InterViews, MFC, and Fresco Program Families and Subsets (cont'd) Identifying subsets: { Analyze requirements to identify minimally useful subsets The components in a program family are similar enough that it makes sense to emphasize their similarities before discussing their dierences { Program families are useful for implementing subsets { Also identify minimal increments to subsets Advantages of subsetting: { Facilitates software system extension and contraction { Promotes reusability { Anticipates potential changes { Reasons for providing subsets include cost, time, personnel resources, etc. 35 36

Program Families and Subsets (cont'd) Program families support: { Dierent services for dierent markets e.g., dierent alphabets, dierent vertical applications, dierent I/O formats { Dierent hardware or software platforms e.g., compilers or OSs { Dierent resource trade-os e.g., speed vs. space { Dierent internal resources e.g., shared data structures and library routines { Dierent external events e.g., UNIX I/O device interface { Backward compatibility e.g., sometimes it is important to retain bugs! 37