Abstraction. Design fundamentals in OO Systems. Fundamental Software Development Principles

Size: px
Start display at page:

Download "Abstraction. Design fundamentals in OO Systems. Fundamental Software Development Principles"

Transcription

1 Abstraction Design fundamentals in OO Systems Tool for abstraction: object Object structure: properties and values for those properties operations to query and update those properties We refer to the collection of values of all properties of an object as the state of the object. System structure: network of collaborating objects which together solves problem. Fundamental Software Development Principles Cohesion: A module should model one well defined concept; its functionality must only deal with supporting the concept being modeled. Coupling : a module s collaborators should be small in number and it should interact through a well defined interface. Tools for Design: Inheritance and Composition Inheritance strong coupling between components allows modification of components being reused Making a new class involves programming static relationship Composition powerful reuse technique, difficult to understand by examining static program text. Composition can be changed at run-time 1

2 Delegation Composed object uses its components to implement its interface. Sometimes a composed object receives a messages which it forwards to one of its components for execution. This is called delegation. It is a misused term, it should be called forwarding or consulting Uses of inheritance Identifying common functionality among a collection of classes providing an implementation of a method in an abstract class providing an alternative implementation refining the implementation of a method extending functionality of an existing class Concrete classes, abstract classes, interfaces When should we subclass, when should we compose? When to use an abstract class, when to use an interface? Abstract classes To model a generalized object Specification of an abstract class ought to be stable Should factor out common implementation details of its subclasses Mechanism used to exploit polymorphism Abstract classes can be extended without breaking running code. 2

3 Interfaces Model to generalize functionality they are by definition abstract, no aspects of its implementation is fixed. A way to multiple inheritance: A class can implement one or more interfaces Allows for a more generalized used of polymorphism Interfaces cannot be modified They are the key to pluggability Interfaces and the software lifecycle Design: serve as a stabilizing element in the specification and implementation of classes Implementation: compiler checks that class implementing interface fullfills contract Integration: well-established interfaces are glue for composed classes and subsystems Testing: logical errors are limited to a subset of methods Inheritance and composition Advantages of inheritance: code reuse polymorphism extension of an existing class dis-advantages of inheritance superclass and subclass are strongly coupled; changes to superclass affect suclass, and subclass cannot change specification of superclass methods It s a static feature Inheritance and composition Advantages of composition code reuse as black box reuse can change composed object s core class at runtime; ie, it s a dynamic property of object Supports stronger encapsulation than inheritance. Changes to core class does not affect specification of composed class. And vice-versa, changes to composed class do not affect core class. 3

4 Inheritance and composition Dis-advantages of composition lose polymorphism!!! Can gain it back: compose with interfaces and have core classes implement those interfaces Mis-uses of inheritance To model roles To provide implementation alternatives to a given abstraction Consequences: class explosion Inheritance and composition Favor composition over inheritance Inheritance should not be used for code reuse or to take advantage of polymorphism It is harder to maintain inheritance based code than composition based code. Inheritance and composition Use inheritance when the complete interface of the superclass applies to the subclass candidate there is a permanent is-a relationship superclass is stable. For specialization 4

5 Inheritance and composition Composition can be used some features of core class are irrelevant, ie, new class is not a true functional subtype to provide implementation to some specific functionality. high proportion of code of base class need to be rewritten Use composition to extend functionality by delegating to more appropriate objects. Inheritance and composition Interfaces can be used to maintain separation of between specification and implementation to provide reuse and polymorphism across hierarquies Clients/Servers v.s. Abstraction/Implementation Servers present abstractions in its highest form to the client: interfaces Reduces coupling of clients to implementation choices. It raises clients code reuse. Hence: clients use interfaces to declare objects Servers specify parameters via interfaces Update of object s class Example: modeling with inheritance Worker Fixed Sales Hourly 5

6 Update of object s class transmute problem: How to update an object from one type of subclass to another? In business terms: how to promote a worker? via copying & delete Update of object s class What changes among the workers is the method used to compute salary. Define class Salary with 3 subclasses Define class Worker with salary() query. Worker s implementation uses private Salary component initialized in the constructor and used to compute salary() With composition: use simple assignment to component being updated. Worker Improved design Example Need to model student implements Worker Has-a Salary Later on need to model PT, FT student Student Fixed Sales Hourly PT FT 6

7 Example Later own, need to consider graduate student Student Later on...add student worker Student PT FT Grad PT FT Grad PTGrad FTGrad PTGrad FTGrad AGGGGHHHHHHHHHHHHHHHHH!! Alternative Example: Account class Define : Student with subclasses undergrad, GradStudent Define: Status with subclasses PT, FT Define: Worker with subclasses FTW, PTW Now based on student we compose to get a student who is part-time and ft worker a grad student full time and part time worker Designed to include customer information: name address account identification number 7

8 Example: Account class Design not cohesive: two abstractions customer information account Cohesion Limitations introduced due to the one-toone correspondence of the two abstractions one customer with several accounts join accounts Class specialization Composition Account Account * 1..* owner Customer Cash Acc Porfolio Ac Individual Institution Composing on the two dimensions: class explosion. One possible solution: multiple inheritance. More trouble that what solves. Problem: inheritance diamond. Cash Acc Porfolio Ac Individual Institutional 8

9 Inheritance vs composition Examples: Sensor, remote Sensor Subclasses of Thread, not a good choice Subclasses of Observable Rules to achieve cohesion An attribute should have a single value and not have structure (repeating groups) Account with many different currencies balance has as value list of <currency,balance> An attribute should describe an instance of its containing class customer name, address, etc do not describe an Account instance An example First solution Design a Button class to control a lightbulb software to reside on table lamp Somehow fact that user has pressed button is communicated to software Button contains LightBulb Not reusable Reusable 9

10 Second solution Third solution Button Button contains ButtonServer LightBulbButton contains LightBulb PumpButton LightBulb Reusable Not so Reusable Forth solution Trade-off Evaluation Second Solution : less code but Button contains ButtonServer locks the relationship between a Button object and object it controls Fourth solution : more flexible. Reusable LightServer contains LightBulb Reusable Any Button object can be used to control any derivative of ButtonServer. allows many different objects to be controlled by the same Button at different times. 10

11 Engineering Tradeoff Choice of solution to use involves an engineering tradeoff. Fourth solution: flexibility V.S. speed and complexity overhead Second solution resource frugal V.S. much less flexibility Design 1 is the simplest; simplicity of design does not necessarily relate simplicity of maintenance, possibility or simplicity of reuse. in order to create a design that is maintainable and reusable, some conceptual effort must be applied. Artifacts for abstraction Cost to apply object-oriented design. Good object-oriented design will generally be more complex than procedural design Extra complexity: infrastructure to manage dependencies Don t begrudge extra complexity. Payoff maintainance reuse At syntactic and semantic level: classes, objects At design level: Patterns Reusable tried-and-true design there is a well-defined context for problem, some variences may occur there have been several occurrences of it possibly under different guises (>= 3) presented in a strict codify form 11

12 Cohesion Abstraction unit model one concept functionality to support concept only Design goal: minimize features A class with high cohesion : maintains localizes protects features necessary to perform primary role Cohesion Provide enough features to support role This implies: not adding derived functionality that can be perform with them This enables superimposed layers to control components in different ways Goal: high cohesion of components Coupling module s collaborators should be small in number should interact through well defined interface Unit minimizes demands on environment Goal: low coupling and type of coupling Representational coupling Should not depend on representation or computational detail of another one Addresses: interchangeable parts multiple representations prototype evolution system evolution performance tuning Extensibility External components Standarization Testability Frameworks 12

13 Value coupling Classes should be written so that operations are independent of particular values when special values occur, use classes to classify and manipulate them(state pattern) Subclass coupling Client refers to a subclass object through subclass reference rather than superclass reference. In Java use of abstract classes and interfaces to raise reuse opportunity Code coupling (Control?) The definition of concrete operations should be decoupled from the context in which they are employed Sequential vs. concurrent execution Example: how to get an item to a list vs when to get it. Should be possible to define how to get it for either situation Inheritance Coupling this is a compile-time binding cannot be discarted at execution time This is the old problem: inheritance vs. composition if you compose: may design zero or more instances of the object can set/change its value at run-time. 13

14 Rise of Coupling in OO An OO system is a network of interactive objects interaction between objects creates the coupling (dependence) the interaction results due to implementation of relations among the objects Thus coupling in OO system is necessary, but it creates dependencies among classes, components, subsystems activity of good analysis and design: management of dependencies What s wrong with dependencies? End result due to lack of management of these dependencies: Brittle software: changes propagate beyond expected boundaries OR Hard software: it does not respond to changes Opposite this state of affairs: units of abstraction localize possible changes and abstraction units are change-responsive: flexible How to get flexible abstractions? Actively design for that characteristic Start with cohesion & coupling of abstractions look for : high cohesion, low / kind of coupling identify and abstract/encapsulate what varies Test flexibility of your abstractions produce an active list of possible changes to measure flexibility against. NNB Static coupling Binding of Coupling established at compilation time need definitions of dependents for compilation Dynamic coupling two classes are dynamically coupled if their instances call methods of one or the other at run-time 14

15 Transitivity in Dependencies If A depends on B, B depends on C, hence A depends on C Coupling Best practices Identify subsystems closed for changes reused as a whole well-defined purpose Reduce static coupling between different subsystems classes. Pay special attention to transitive coupling Reduce dynamic coupling Software Principles Information Hiding principle:.a client does not need to know how a module (system) work to use it..a client should not be allowed to extend the system knowing how the system works. Software Continuity principle: small changes in the specification should produce small changes in the implementation of the module (system) Software Principles. Cont... The OCP (Open-Closed Principle), The LSP (Liskov substitution Principle), The DIP (Dependency Inversion Princ), The ISP (Interface Segregation Principle), The RREP (Reuse/Release Equivalency principle), The CCP (Common Closure Principle), 15

16 Software Principles. Cont... The CRP (Common Reuse Principle) The ADP (Acyclic Dependencies Principle), The SDP (Stable Dependencies Principle) The SAP (Stable Abstractions Principle) The LoD (Law of Demeter) 16

Software Engineering

Software Engineering Software Engineering CSC 331/631 - Spring 2018 Object-Oriented Design Principles Paul Pauca April 10 Design Principles DP1. Identify aspects of the application that vary and separate them from what stays

More information

COURSE 2 DESIGN PATTERNS

COURSE 2 DESIGN PATTERNS COURSE 2 DESIGN PATTERNS CONTENT Fundamental principles of OOP Encapsulation Inheritance Abstractisation Polymorphism [Exception Handling] Fundamental Patterns Inheritance Delegation Interface Abstract

More information

Index. Index. More information. block statements 66 y 107 Boolean 107 break 55, 68 built-in types 107

Index. Index. More information. block statements 66 y 107 Boolean 107 break 55, 68 built-in types 107 A abbreviations 17 abstract class 105 abstract data types 105 abstract method 105 abstract types 105 abstraction 92, 105 access level 37 package 114 private 115 protected 115 public 115 accessors 24, 105

More information

Chapter 8: Class and Method Design

Chapter 8: Class and Method Design Chapter 8: Class and Method Design Objectives Become familiar with coupling, cohesion, and connascence. Be able to specify, restructure, and optimize object designs. Be able to identify the reuse of predefined

More information

Object-Oriented Concepts and Design Principles

Object-Oriented Concepts and Design Principles Object-Oriented Concepts and Design Principles Signature Specifying an object operation or method involves declaring its name, the objects it takes as parameters and its return value. Known as an operation

More information

Object-Oriented Design

Object-Oriented Design Object-Oriented Design Department of Computer Engineering Lecture 12: Object-Oriented Principles Sharif University of Technology 1 Open Closed Principle (OCP) Classes should be open for extension but closed

More information

Object-Oriented Design

Object-Oriented Design Object-Oriented Design Lecturer: Raman Ramsin Lecture 15: Object-Oriented Principles 1 Open Closed Principle (OCP) Classes should be open for extension but closed for modification. OCP states that we should

More information

CSC207H: Software Design SOLID. CSC207 Winter 2018

CSC207H: Software Design SOLID. CSC207 Winter 2018 SOLID CSC207 Winter 2018 1 SOLID Principles of Object-Oriented Design How do we make decisions about what is better and what is worse design? Principles to aim for instead of rules. e.g. there is no maximum

More information

Principles of Object-Oriented Design

Principles of Object-Oriented Design Principles of Object-Oriented Design Part II 1 The Law of Demeter Any object receiving a message in a given method must be one of a restricted set of objects. 1. Strict Form: Every supplier class or object

More information

Object Relationships

Object Relationships Object Relationships Objects can work together in three different types of relationships: Uses: An object can use another to do some work (association). Composition: A complex object may be composed of

More information

Component-Level Design. Slides copyright 1996, 2001, 2005, 2009 by Roger S. Pressman. For non-profit educational use only

Component-Level Design. Slides copyright 1996, 2001, 2005, 2009 by Roger S. Pressman. For non-profit educational use only Chapter 10 Component-Level Design Slide Set to accompany Software Engineering: A Practitioner s Approach, 7/e by Roger S. Pressman Slides copyright 1996, 2001, 2005, 2009 by Roger S. Pressman For non-profit

More information

09. Component-Level Design

09. Component-Level Design 09. Component-Level Design Division of Computer Science, College of Computing Hanyang University ERICA Campus 1 st Semester 2017 What is Component OMG UML Specification defines a component as OO view a

More information

SOLID Principles. Equuleus Technologies. Optional Subheading October 19, 2016

SOLID Principles. Equuleus Technologies. Optional Subheading October 19, 2016 SOLID Principles Optional Subheading October 19, 2016 Why SOLID Principles? The traits of well designed software are as follows Maintainability - The ease with which a software system or component can

More information

GRASP Design Patterns A.A. 2018/2019

GRASP Design Patterns A.A. 2018/2019 GRASP Design Patterns A.A. 2018/2019 Objectives Introducing design patterns Introduzione ai design pattern Designing objects and responsibilities GRASP design patterns A long corridor A passage room Does

More information

Summary of the course lectures

Summary of the course lectures Summary of the course lectures 1 Components and Interfaces Components: Compile-time: Packages, Classes, Methods, Run-time: Objects, Invocations, Interfaces: What the client needs to know: Syntactic and

More information

CMPS 115 Winter 04. Class #10 (2004/02/05) Changes/Review Programming Paradigms Principles of OOD <break> Design Patterns

CMPS 115 Winter 04. Class #10 (2004/02/05) Changes/Review Programming Paradigms Principles of OOD <break> Design Patterns CMPS 115 Winter 04 Class #10 (2004/02/05) Changes/Review Programming Paradigms Principles of OOD Design Patterns Changes & Lecture 9 Takeaway Changes/Notices 2/26 may be guest after all, on design-with-frameworks

More information

Object-Oriented Design

Object-Oriented Design Object-Oriented Design Lecture 14: Design Workflow Department of Computer Engineering Sharif University of Technology 1 UP iterations and workflow Workflows Requirements Analysis Phases Inception Elaboration

More information

17.11 Bean Rules persistent

17.11 Bean Rules persistent 17.10 Java Beans Java beans are a framework for creating components in Java. AWT and Swing packages are built within this framework Made to fit in with graphic development environments such as Jbuilder

More information

CSE 70 Final Exam Fall 2009

CSE 70 Final Exam Fall 2009 Signature cs70f Name Student ID CSE 70 Final Exam Fall 2009 Page 1 (10 points) Page 2 (16 points) Page 3 (22 points) Page 4 (13 points) Page 5 (15 points) Page 6 (20 points) Page 7 (9 points) Page 8 (15

More information

Object Model. Object Orientated Analysis and Design. Benjamin Kenwright

Object Model. Object Orientated Analysis and Design. Benjamin Kenwright Object Model Object Orientated Analysis and Design Benjamin Kenwright Outline Submissions/Quizzes Review Object Orientated Programming Concepts (e.g., encapsulation, data abstraction,..) What do we mean

More information

CAS 703 Software Design

CAS 703 Software Design Dr. Ridha Khedri Department of Computing and Software, McMaster University Canada L8S 4L7, Hamilton, Ontario Other 1 2 3 4 Other Principle of Least Privilege Principle of Fail-Safe Defaults Principle of

More information

Classes and Objects. Object Orientated Analysis and Design. Benjamin Kenwright

Classes and Objects. Object Orientated Analysis and Design. Benjamin Kenwright Classes and Objects Object Orientated Analysis and Design Benjamin Kenwright Outline Review Previous Weeks Object Model, Complexity,.. What do we mean by Classes and Objects? Summary/Discussion Review

More information

CHAPTER 5 GENERAL OOP CONCEPTS

CHAPTER 5 GENERAL OOP CONCEPTS CHAPTER 5 GENERAL OOP CONCEPTS EVOLUTION OF SOFTWARE A PROGRAMMING LANGUAGE SHOULD SERVE 2 RELATED PURPOSES : 1. It should provide a vehicle for programmer to specify actions to be executed. 2. It should

More information

Inheritance (Chapter 7)

Inheritance (Chapter 7) Inheritance (Chapter 7) Prof. Dr. Wolfgang Pree Department of Computer Science University of Salzburg cs.uni-salzburg.at Inheritance the soup of the day?! Inheritance combines three aspects: inheritance

More information

Presenter: Dong hyun Park

Presenter: Dong hyun Park Presenter: 200412325 Dong hyun Park Design as a life cycle activity bonds the requirements to construction Process of breaking down the system into components, defining interfaces and defining components

More information

Design Patterns V Structural Design Patterns, 2

Design Patterns V Structural Design Patterns, 2 Structural Design Patterns, 2 COMP2110/2510 Software Design Software Design for SE September 17, 2008 Department of Computer Science The Australian National University 19.1 1 2 Formal 3 Formal 4 Formal

More information

Software Engineering Fall 2015 (CSC 4350/6350) TR. 5:30 pm 7:15 pm. Rao Casturi 11/03/2015

Software Engineering Fall 2015 (CSC 4350/6350) TR. 5:30 pm 7:15 pm. Rao Casturi 11/03/2015 Software Engineering Fall 2015 (CSC 4350/6350) TR. 5:30 pm 7:15 pm Rao Casturi 11/03/2015 http://cs.gsu.edu/~ncasturi1 Object Design Software Engineering -CSC4350/6350 - Rao Casturi 2 Object Design Close

More information

Agile Software Development

Agile Software Development Agile Software Development Principles, Patterns, and Practices Robert Cecil Martin Alan Apt Series Prentice Hall Pearson Education, Inc. Upper Saddle River, New Jersey 07458 Foreword Preface About the

More information

OO Design Principles

OO Design Principles OO Design Principles Software Architecture VO (706.706) Roman Kern Institute for Interactive Systems and Data Science, TU Graz 2018-10-10 Roman Kern (ISDS, TU Graz) OO Design Principles 2018-10-10 1 /

More information

Design Pattern What is a Design Pattern? Design Pattern Elements. Almas Ansari Page 1

Design Pattern What is a Design Pattern? Design Pattern Elements. Almas Ansari Page 1 What is a Design Pattern? Each pattern Describes a problem which occurs over and over again in our environment,and then describes the core of the problem Novelists, playwrights and other writers rarely

More information

Appendix A - Glossary(of OO software term s)

Appendix A - Glossary(of OO software term s) Appendix A - Glossary(of OO software term s) Abstract Class A class that does not supply an implementation for its entire interface, and so consequently, cannot be instantiated. ActiveX Microsoft s component

More information

Principles of Object-Oriented Design

Principles of Object-Oriented Design Principles of Object-Oriented Design 1 The Object-Oriented... Hype What are object-oriented (OO) methods? OO methods provide a set of techniques for analysing, decomposing, and modularising software system

More information

Advanced Object Oriented PHP

Advanced Object Oriented PHP CNM STEMulus Center Web Development with PHP November 11, 2015 1/17 Outline 1 2 Diamond Problem Composing vs Inheriting Case Study: Strategy Design Pattern 2/17 Definition is when a class is based on another

More information

PROCESS DEVELOPMENT METHODOLOGY The development process of an API fits the most fundamental iterative code development

PROCESS DEVELOPMENT METHODOLOGY The development process of an API fits the most fundamental iterative code development INTRODUCING API DESIGN PRINCIPLES IN CS2 Jaime Niño Computer Science, University of New Orleans New Orleans, LA 70148 504-280-7362 jaime@cs.uno.edu ABSTRACT CS2 provides a great opportunity to teach an

More information

Data Structures and Algorithms Design Goals Implementation Goals Design Principles Design Techniques. Version 03.s 2-1

Data Structures and Algorithms Design Goals Implementation Goals Design Principles Design Techniques. Version 03.s 2-1 Design Principles Data Structures and Algorithms Design Goals Implementation Goals Design Principles Design Techniques 2-1 Data Structures Data Structure - A systematic way of organizing and accessing

More information

Chapter 1: Principles of Programming and Software Engineering

Chapter 1: Principles of Programming and Software Engineering Chapter 1: Principles of Programming and Software Engineering Data Abstraction & Problem Solving with C++ Fifth Edition by Frank M. Carrano Software Engineering and Object-Oriented Design Coding without

More information

Welcome to Design Patterns! For syllabus, course specifics, assignments, etc., please see Canvas

Welcome to Design Patterns! For syllabus, course specifics, assignments, etc., please see Canvas Welcome to Design Patterns! For syllabus, course specifics, assignments, etc., please see Canvas What is this class about? While this class is called Design Patterns, there are many other items of critical

More information

Object-Oriented Software Engineering Practical Software Development using UML and Java. Chapter 2: Review of Object Orientation

Object-Oriented Software Engineering Practical Software Development using UML and Java. Chapter 2: Review of Object Orientation Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 2: Review of Object Orientation 2.1 What is Object Orientation? Procedural paradigm: Software is organized

More information

Object-oriented design principles

Object-oriented design principles Object-oriented design principles Objektumorientált szoftvertervezés Object-oriented software design Dr. Balázs Simon BME, IIT Outline OO concepts Single Responsibility Principle (SRP) Open/Closed Principle

More information

GRASP: Patterns for. chapter18

GRASP: Patterns for. chapter18 GRASP: Patterns for assigning responsibility chapter18 1 Chapter Objectives Learn about design patterns Learn how to apply five GRASP patterns 2 Building Collaboration diagrams System Design: how the system

More information

Chapter 5 Object-Oriented Programming

Chapter 5 Object-Oriented Programming Chapter 5 Object-Oriented Programming Develop code that implements tight encapsulation, loose coupling, and high cohesion Develop code that demonstrates the use of polymorphism Develop code that declares

More information

Testing Object-Oriented Software. 22 November 2017

Testing Object-Oriented Software. 22 November 2017 Testing Object-Oriented Software 22 November 2017 Testing Object-Oriented Software 2 Problems in object-oriented testing [Binder] Each level in the class hierarchy creates a new context for inherited features:

More information

Object-Oriented Software Engineering. Chapter 2: Review of Object Orientation

Object-Oriented Software Engineering. Chapter 2: Review of Object Orientation Object-Oriented Software Engineering Chapter 2: Review of Object Orientation 2.1 What is Object Orientation? Procedural paradigm: Software is organized around the notion of procedures Procedural abstraction

More information

ADVANCED SOFTWARE DESIGN LECTURE 4 SOFTWARE ARCHITECTURE

ADVANCED SOFTWARE DESIGN LECTURE 4 SOFTWARE ARCHITECTURE ADVANCED SOFTWARE DESIGN LECTURE 4 SOFTWARE ARCHITECTURE Dave Clarke 1 THIS LECTURE At the end of this lecture you will know notations for expressing software architecture the design principles of cohesion

More information

Agile Principles, Patterns, and Practices in C#

Agile Principles, Patterns, and Practices in C# Agile Principles, Patterns, and Practices in C# Robert C. Martin Micah Martin 22 Upper Saddle River, NJ Boston Indianapolis San Francisco New York Toronto Montreal London Munich Paris Madrid!ENTICE,,,.

More information

17. GRASP: Designing Objects with Responsibilities

17. GRASP: Designing Objects with Responsibilities 17. GRASP: Designing Objects with Responsibilities Objectives Learn to apply five of the GRASP principles or patterns for OOD. Dr. Ziad Kobti School of Computer Science University of Windsor Understanding

More information

Inheritance and object compatibility

Inheritance and object compatibility Inheritance and object compatibility Object type compatibility An instance of a subclass can be used instead of an instance of the superclass, but not the other way around Examples: reference/pointer can

More information

Compositional Design Principles

Compositional Design Principles Chapter 16 Compositional Design Principles Learning Objectives In this chapter, I will more formally introduce the three principles that form the 3-1- 2 process. The learning focus is understanding how

More information

Introduction to Programming Microsoft.NET Applications with Visual Studio 2008 (C#)

Introduction to Programming Microsoft.NET Applications with Visual Studio 2008 (C#) Introduction to Programming Microsoft.NET Applications with Visual Studio 2008 (C#) Course Number: 6367A Course Length: 3 Days Course Overview This three-day course will enable students to start designing

More information

Modularity Guidelines for design in any programming language

Modularity Guidelines for design in any programming language Modularity Guidelines for design in any programming language 14-1 Modular Software Software constructed as assemblies of small pieces» Each piece encompasses the data and operations necessary to do one

More information

Last Time: Object Design. Comp435 Object-Oriented Design. Last Time: Responsibilities. Last Time: Creator. Last Time: The 9 GRASP Patterns

Last Time: Object Design. Comp435 Object-Oriented Design. Last Time: Responsibilities. Last Time: Creator. Last Time: The 9 GRASP Patterns Last Time: Object Design Comp435 Object-Oriented Design Week 7 Computer Science PSU HBG The main idea RDD: Responsibility-Driven Design Identify responsibilities Assign them to classes and objects Responsibilities

More information

C++ Modern and Lucid C++ for Professional Programmers

C++ Modern and Lucid C++ for Professional Programmers Informatik C++ Modern and Lucid C++ for Professional Programmers part 13 Prof. Peter Sommerlad Institutsleiter IFS Institute for Software Rapperswil, HS 2015 Inheritance and dynamic Polymorphism base classes,

More information

Software Engineering CSC40232: SOFTWARE ENGINEERING. Guest Lecturer: Jin Guo SOLID Principles sarec.nd.edu/courses/se2017

Software Engineering CSC40232: SOFTWARE ENGINEERING. Guest Lecturer: Jin Guo SOLID Principles sarec.nd.edu/courses/se2017 CSC40232: SOFTWARE ENGINEERING Guest Lecturer: Jin Guo SOLID Principles sarec.nd.edu/courses/se2017 Department of Computer Science and Engineering http://www.kirkk.com/modularity/2009/12/solid-principles-of-class-design/

More information

CHAPTER 5: PRINCIPLES OF DETAILED DESIGN

CHAPTER 5: PRINCIPLES OF DETAILED DESIGN CHAPTER 5: PRINCIPLES OF DETAILED DESIGN SESSION II: STRUCTURAL AND BEHAVIORAL DESIGN OF COMPONENTS Software Engineering Design: Theory and Practice by Carlos E. Otero Slides copyright 2012 by Carlos E.

More information

Introduction to Testing and Maintainable code

Introduction to Testing and Maintainable code Introduction to Testing and Maintainable code Reasons not to write unit tests 1. I don't know how to write tests. 2. Writing tests is too hard. 3. I don't have enough time to write tests. 4. Testing is

More information

Object-Oriented Systems Analysis and Design Using UML

Object-Oriented Systems Analysis and Design Using UML 10 Object-Oriented Systems Analysis and Design Using UML Systems Analysis and Design, 8e Kendall & Kendall Copyright 2011 Pearson Education, Inc. Publishing as Prentice Hall Learning Objectives Understand

More information

Software Design Patterns. Background 1. Background 2. Jonathan I. Maletic, Ph.D.

Software Design Patterns. Background 1. Background 2. Jonathan I. Maletic, Ph.D. Software Design Patterns Jonathan I. Maletic, Ph.D. Department of Computer Science Kent State University J. Maletic 1 Background 1 Search for recurring successful designs emergent designs from practice

More information

Eliminate enterprise software design instability - protect variations! Nickolay Kofanov

Eliminate enterprise software design instability - protect variations! Nickolay Kofanov Eliminate enterprise software design instability - protect variations! Nickolay Kofanov Owning a hammer doesn't make one an architect. Responsibility-Driven-Design The way of thinking about the design

More information

The following topics will be covered in this course (not necessarily in this order).

The following topics will be covered in this course (not necessarily in this order). The following topics will be covered in this course (not necessarily in this order). Introduction The course focuses on systematic design of larger object-oriented programs. We will introduce the appropriate

More information

Outline. Subtype Polymorphism, Subtyping vs. Subclassing, Liskov Substitution Principle. Benefits of Subtype Polymorphism. Subtype Polymorphism

Outline. Subtype Polymorphism, Subtyping vs. Subclassing, Liskov Substitution Principle. Benefits of Subtype Polymorphism. Subtype Polymorphism Subtype, Subtyping vs. Subclassing, Liskov Substitution Principle Outline Subtype polymorphism Subtyping vs. subclassing Liskov Substitution Principle (LSP) Function subtyping Java subtyping Composition:

More information

Topics in Object-Oriented Design Patterns

Topics in Object-Oriented Design Patterns Software design Topics in Object-Oriented Design Patterns Material mainly from the book Design Patterns by Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides; slides originally by Spiros Mancoridis;

More information

[ L5P1] Object-Oriented Programming: Advanced Concepts

[ L5P1] Object-Oriented Programming: Advanced Concepts [ L5P1] Object-Oriented Programming: Advanced Concepts Polymorphism Polymorphism is an important and useful concept in the object-oriented paradigm. Take the example of writing a payroll application for

More information

CHAPTER 9 DESIGN ENGINEERING. Overview

CHAPTER 9 DESIGN ENGINEERING. Overview CHAPTER 9 DESIGN ENGINEERING Overview A software design is a meaningful engineering representation of some software product that is to be built. Designers must strive to acquire a repertoire of alternative

More information

More on Inheritance. Interfaces & Abstract Classes

More on Inheritance. Interfaces & Abstract Classes More on Inheritance Interfaces & Abstract Classes Java interfaces A Java interface is used to specify minimal functionality that a client requires of a server. A Java interface contains: method specifications

More information

Examples. Object Orientated Analysis and Design. Benjamin Kenwright

Examples. Object Orientated Analysis and Design. Benjamin Kenwright Examples Object Orientated Analysis and Design Benjamin Kenwright Outline Revision Questions Group Project Review Deliverables Example System Problem Case Studey Group Project Case-Study Example Vision

More information

Granularity. Inheritance Bi-directional. Association. Derived A1

Granularity. Inheritance Bi-directional. Association. Derived A1 Granularity This is the fifth of my Engineering Notebook columns for The C++ Report. The articles that appear in this column focus on the use of C++ and OOD, and address issues of software engineering.

More information

Chapter 10. Object-Oriented Analysis and Modeling Using the UML. McGraw-Hill/Irwin

Chapter 10. Object-Oriented Analysis and Modeling Using the UML. McGraw-Hill/Irwin Chapter 10 Object-Oriented Analysis and Modeling Using the UML McGraw-Hill/Irwin Copyright 2007 by The McGraw-Hill Companies, Inc. All rights reserved. Objectives 10-2 Define object modeling and explain

More information

1. Write two major differences between Object-oriented programming and procedural programming?

1. Write two major differences between Object-oriented programming and procedural programming? 1. Write two major differences between Object-oriented programming and procedural programming? A procedural program is written as a list of instructions, telling the computer, step-by-step, what to do:

More information

SOFTWARE ENGINEERING SOFTWARE DESIGN. Saulius Ragaišis.

SOFTWARE ENGINEERING SOFTWARE DESIGN. Saulius Ragaišis. SOFTWARE ENGINEERING SOFTWARE DESIGN Saulius Ragaišis saulius.ragaisis@mif.vu.lt CSC2008 SE Software Design Learning Objectives: Discuss the properties of good software design including the nature and

More information

Learning Objectives. C++ For Artists 2003 Rick Miller All Rights Reserved xli

Learning Objectives. C++ For Artists 2003 Rick Miller All Rights Reserved xli Identify and overcome the difficulties encountered by students when learning how to program List and explain the software development roles played by students List and explain the phases of the tight spiral

More information

Object- Oriented Design with UML and Java Part I: Fundamentals

Object- Oriented Design with UML and Java Part I: Fundamentals Object- Oriented Design with UML and Java Part I: Fundamentals University of Colorado 1999-2002 CSCI-4448 - Object-Oriented Programming and Design These notes as free PDF files: http://www.softwarefederation.com/cs4448.html

More information

OO Package Design Principles

OO Package Design Principles 4 4.1 Packages Introduction 4.2 Packages in UML 4.3 Three Package Design Principles 4.4 Development Environment (Three more principles) 4.5 Summary 1 4.1 Packages Introduction What is a package? Classes

More information

Lecture 13: Object orientation. Object oriented programming. Introduction. Object oriented programming. OO and ADT:s. Introduction

Lecture 13: Object orientation. Object oriented programming. Introduction. Object oriented programming. OO and ADT:s. Introduction Lecture 13: Object orientation Object oriented programming Introduction, types of OO languages Key concepts: Encapsulation, Inheritance, Dynamic binding & polymorphism Other design issues Smalltalk OO

More information

Ingegneria del Software Corso di Laurea in Informatica per il Management. Software quality and Object Oriented Principles

Ingegneria del Software Corso di Laurea in Informatica per il Management. Software quality and Object Oriented Principles Ingegneria del Software Corso di Laurea in Informatica per il Management Software quality and Object Oriented Principles Davide Rossi Dipartimento di Informatica Università di Bologna Design goal The goal

More information

OO Class Design Principles

OO Class Design Principles 3.3 Class Design Principles Single Responsibility Principle (SRP) Open/Closed Principle (OCP) Liskov Substitution Principle (LSP) a.k.a. Design by Contract Dependency Inversion Principle (DIP) Interface

More information

The Release Reuse Equivalency Principle (REP) The Common Closure Principle (CCP) The Common Reuse Principle (CRP)

The Release Reuse Equivalency Principle (REP) The Common Closure Principle (CCP) The Common Reuse Principle (CRP) Package Cohesion Principles The Release Reuse Equivalency Principle (REP) The Common Closure Principle (CCP) The Common Reuse Principle (CRP) Portions Copyright 2000 by Robert C. Martin. Page 1 The Release

More information

CS558 Programming Languages Winter 2013 Lecture 8

CS558 Programming Languages Winter 2013 Lecture 8 OBJECT-ORIENTED PROGRAMMING CS558 Programming Languages Winter 2013 Lecture 8 Object-oriented programs are structured in terms of objects: collections of variables ( fields ) and functions ( methods ).

More information

SOFTWARE ENGINEERING SOFTWARE EVOLUTION. Saulius Ragaišis.

SOFTWARE ENGINEERING SOFTWARE EVOLUTION. Saulius Ragaišis. SOFTWARE ENGINEERING SOFTWARE EVOLUTION Saulius Ragaišis saulius.ragaisis@mif.vu.lt CSC2008 SE Software Evolution Learning Objectives: Identify the principal issues associated with software evolution and

More information

Highlights of Previous Lecture

Highlights of Previous Lecture Highlights of Previous Lecture Final Project Goals 1. Set up collections of Flights 2. Maintain information about reservation availability on flights 3. Respond to reservation requests 4. Set up collections

More information

Influence of Design Patterns Application on Quality of IT Solutions

Influence of Design Patterns Application on Quality of IT Solutions Influence of Design Patterns Application on Quality of IT Solutions NADINA ZAIMOVIC, DZENANA DONKO Department for Computer Science and Informatics Faculty of Electrical Engineering, University of Sarajevo

More information

Socket attaches to a Ratchet. 2) Bridge Decouple an abstraction from its implementation so that the two can vary independently.

Socket attaches to a Ratchet. 2) Bridge Decouple an abstraction from its implementation so that the two can vary independently. Gang of Four Software Design Patterns with examples STRUCTURAL 1) Adapter Convert the interface of a class into another interface clients expect. It lets the classes work together that couldn't otherwise

More information

The Strategy Pattern Design Principle: Design Principle: Design Principle:

The Strategy Pattern Design Principle: Design Principle: Design Principle: Strategy Pattern The Strategy Pattern defines a family of algorithms, encapsulates each one, and makes them interchangeable. Strategy lets the algorithm vary independently from clients that use it. Design

More information

Lethbridge/Laganière 2005 Chapter 9: Architecting and designing software 6

Lethbridge/Laganière 2005 Chapter 9: Architecting and designing software 6 Trying to deal with something big all at once is normally much harder than dealing with a series of smaller things Separate people can work on each part. An individual software engineer can specialize.

More information

HOW AND WHEN TO FLATTEN JAVA CLASSES?

HOW AND WHEN TO FLATTEN JAVA CLASSES? HOW AND WHEN TO FLATTEN JAVA CLASSES? Jehad Al Dallal Department of Information Science, P.O. Box 5969, Safat 13060, Kuwait ABSTRACT Improving modularity and reusability are two key objectives in object-oriented

More information

Software Design Fundamentals. CSCE Lecture 11-09/27/2016

Software Design Fundamentals. CSCE Lecture 11-09/27/2016 Software Design Fundamentals CSCE 740 - Lecture 11-09/27/2016 Today s Goals Define design Introduce the design process Overview of design criteria What results in a good design? Gregory Gay CSCE 740 -

More information

Introduction to Object-Oriented Programming

Introduction to Object-Oriented Programming Polymorphism 1 / 19 Introduction to Object-Oriented Programming Today we ll learn how to combine all the elements of object-oriented programming in the design of a program that handles a company payroll.

More information

Conformance. Object-Oriented Programming Spring 2015

Conformance. Object-Oriented Programming Spring 2015 Conformance Object-Oriented Programming 236703 Spring 2015 1 What s Conformance? Overriding: replace method body in sub-class Polymorphism: subclass is usable wherever superclass is usable Dynamic Binding:

More information

Software Engineering with Objects and Components Open Issues and Course Summary

Software Engineering with Objects and Components Open Issues and Course Summary Software Engineering with Objects and Components Open Issues and Course Summary Massimo Felici Software Engineering with Objects and Components Software development process Lifecycle models and main stages

More information

Faculty of Information Technology Department of SE Marking Scheme

Faculty of Information Technology Department of SE Marking Scheme Philadelphia University Lecturer : Dr. Moayad A. Coordinator : Dr. Moayad A. Internal Examiner: Dr. Murad Mouash Software Design (721322) Date: zo" December 2012 - ---- Second Exam Section: 1 Faculty of

More information

Think of drawing/diagramming editors. ECE450 Software Engineering II. The problem. The Composite pattern

Think of drawing/diagramming editors. ECE450 Software Engineering II. The problem. The Composite pattern Think of drawing/diagramming editors ECE450 Software Engineering II Drawing/diagramming editors let users build complex diagrams out of simple components The user can group components to form larger components......which

More information

OO Frameworks. Introduction. Using Frameworks

OO Frameworks. Introduction. Using Frameworks OO Frameworks Jonathan I. Maletic, Ph.D. Department of Computer Science Kent State University Introduction Frameworks support reuse of detailed designs and architectures An integrated set of components

More information

Idioms and Design Patterns. Martin Skogevall IDE, Mälardalen University

Idioms and Design Patterns. Martin Skogevall IDE, Mälardalen University Idioms and Design Patterns Martin Skogevall IDE, Mälardalen University 2005-04-07 Acronyms Object Oriented Analysis and Design (OOAD) Object Oriented Programming (OOD Software Design Patterns (SDP) Gang

More information

MechEng SE3 Lecture 7 Domain Modelling

MechEng SE3 Lecture 7 Domain Modelling MechEng SE3 Lecture 7 Domain Modelling Simon Gay (slides by Phil Gray) 17 February 2010 1 This week s supplementary reading Zero Balances and Zero Responsibility Michael Bolton http://www.developsense.com/essays/zero.html

More information

Inheritance. EEC 521: Software Engineering. Dealing with Change. Polymorphism. Software Design. Changing requirements Code needs to be flexible

Inheritance. EEC 521: Software Engineering. Dealing with Change. Polymorphism. Software Design. Changing requirements Code needs to be flexible Inheritance EEC 521: Software Engineering Software Design Design Patterns: Decoupling Dependencies 10/15/09 EEC 521: Software Engineering 1 Inheritance is the mechanism by which one class can acquire properties/responsibilities

More information

Applying Design Patterns to accelerate development of reusable, configurable and portable UVCs. Accellera Systems Initiative 1

Applying Design Patterns to accelerate development of reusable, configurable and portable UVCs. Accellera Systems Initiative 1 Applying Design Patterns to accelerate development of reusable, configurable and portable UVCs. Accellera Systems Initiative 1 About the presenter Paul Kaunds Paul Kaunds is a Verification Consultant at

More information

Modularity!! Guidelines for design! in any programming language!

Modularity!! Guidelines for design! in any programming language! Modularity!! Guidelines for design! in any programming language! 14-1! Modular Software! Software constructed as assemblies of small pieces! 14-2! Modular Software 2! Software constructed as assemblies

More information

Software Engineering Fall 2014

Software Engineering Fall 2014 Software Engineering Fall 2014 (CSC 4350/6350) Mon.- Wed. 5:30 pm 7:15 pm ALC : 107 Rao Casturi 11/03/2014 Re Cap - Object Design Close the gap between the application objects and the off-the shelf components.

More information

Final Exam. Final Exam Review. Ch 1: Introduction: Object-oriented analysis, design, implementation. Exam Format

Final Exam. Final Exam Review. Ch 1: Introduction: Object-oriented analysis, design, implementation. Exam Format Final Exam Final Exam Review CS 4354 Fall 2012 Jill Seaman Friday, December 14, 11AM Closed book, closed notes, clean desk Content: Textbook: Chapters 1, 2, 4-10 Java Lectures, GRASP + JUnit 35% of your

More information

CS342: Software Design. November 21, 2017

CS342: Software Design. November 21, 2017 CS342: Software Design November 21, 2017 Runnable interface: create threading object Thread is a flow of control within a program Thread vs. process All execution in Java is associated with a Thread object.

More information

EINDHOVEN UNIVERSITY OF TECHNOLOGY

EINDHOVEN UNIVERSITY OF TECHNOLOGY EINDHOVEN UNIVERSITY OF TECHNOLOGY Department of Mathematics & Computer Science Exam Programming Methods, 2IP15, Wednesday 17 April 2013, 09:00 12:00 TU/e THIS IS THE EXAMINER S COPY WITH (POSSIBLY INCOMPLETE)

More information