OO design using protocol hiearchies

Size: px
Start display at page:

Download "OO design using protocol hiearchies"

Transcription

1 OO design using protocol hiearchies Jorge Mederos Martín, Julio García Martín Universidad Politécnica de Madrid 1 Abstract This paper describes the use of protocol hierarchies as a way to sort out object oriented designs using different points of view of them. A protocol hierarchy is a somewhat hidden facility of some modern object oriented languages like Java, Objective-C or Inprise Object Pascal in Delphi. The paper explores several interesting properties of protocol hierarchies and the way they permit us to split functionality from implementation, leading to more simple object oriented designs. Introduction Traditionally, class inheritance or subclassing has been used to add flexibility to object oriented designs. A class, for example, can be a generic abstraction to represent list of things. We can define different list implementations subclassing from. Subclassing allows us to manage list implementations using generic objects, without worrying about the exact list implementation used. In other words, we can use derived classes or subclasses as if they were their parent classes or superclasses. In this way, changing from a subclass point of view a list implementation to a superclass point of view a generic list is a change between two partial representations of a list abstraction. The added flexibility comes with the fact to use objects to manage several list implementations. The ability to manage a set of abstractions subclasses using other abstraction a superclass is used to be called polymorphism. It is often interesting not to specify an abstraction implementation in a superclass. Thus, a generic list class like could not impose list implementation details so we would provide several ones. An abstract class has some of its method implementations undefined. In a same sense, a pure abstract class does not define any of its method implementations. Pure abstract classes have been proben useful in object oriented design, because they permit us to describe an abstraction functionality in a superclass without specifying its implementation details. Concrete subclasses implement the details of a superclass abstraction. A class cluster is a slight variation. It groups private, concrete subclasses under a public, pure abstract superclass. It simplifies the publicly visible architecture of an abstraction without reducing its functional richness. Protocols or interfaces Some object oriented languages like Java [Ref], Objective-C [Don95] and Delphi [Ref] include another interesting way to describe an abstraction functionality. A protocol or interface is a list of method declarations or method signatures grouped by a common identifier and unattached to any class definition. A protocol does not provide any implementation about the methods it declares. The following are protocol declarations in Objective-C and StringEncoding - (String *) encodetostring; - (void) decodefromstring: (String *) astring; 1 LSIIS Department, Facultad de informática, Campus de Montegancedo, Boadilla del Monte, Madrid, Spain. jmederos@gran-via.com, juliog@fi.upm.es

2 @end interface StringEncoding { String encodetostring(); void decodefromstring ( String astring ); Protocols or interfaces can be handled without problems using the reflection mechanics or run time type information (RTTI) of those languages. A class adopts a protocol if it agrees to implement all the methods the protocol declares. A class can not adopt a protocol part. But they can adopt more than one protocol. If a same method signature is found in some of the adopted protocols, only one method signature will remain. As example, here are two simple classes inheriting from the root class Object and adopting the StringEncoding protocol, also in both languages. The classes must define implementations for all protocol method MyClass : Object <StringEncoding> { int memberfield; - (String *) encodetostring; - (void) decodefromstring: (String *) class MyClass extends Object implements StringEncoding { int memberfield; String encodetostring(); void decodefromstring ( String astring ); A class conforms to a protocol if it adopts a protocol or inherits from a class that adopts it. There is no need to declare again the adopted protocol. In the following example, MySubClass inherits form MyClass. MySubClass does not adopts any protocol, but it conforms to the StringEncoding protocol adopted by its MySubClass : MyClass { int class MySubClass extends MyClass { int othermemberfield; A protocol can incorporate or inherit other protocols to extend them, or as a way to name a set of protocols under a single name. Duplicated method signatures are eliminated. As example, if protocol Encoding incorporates (or inherits) StringEncoding and ByteDataEncoding protocols, then it contains all method declarations of StringEncoding, ByteDataEncoding and maybe other method declarations specific to Encoding (see figure Encoding <StringEncoding, ByteDataEncoding> - ( *) interface Encoding extends StringEncoding, ByteDataEncoding { encodingstyles(); 2

3 Protocols were first introduced as an extension to Objective-C and inspired the interface declarations of Java [JavaRef] and Delphi [DelphiRef] programming languages. They are useful in at least the following situations [Don95;95]: To declare methods that others are expected to implement. They can be used as a replacement of pure abstract classes. Protocols are always abstract, because they only hold method declarations. In the previous conforming to a protocol example, the MyClass class does not need to have an abstract StringEncoding superclass, the protocol declaration is sufficient. To capture similarities among classes that are not hierarchically related. For example a encoding/decoding interface for persistent objects. We can declare other class, like MyOtherClass adopting the StringEncoding protocol in the same way as MyClass does. Both classes will have the methods declared by StringEncoding without inheritance relationships. This property is interesting. Classes that are unrelated in most respects might nevertheless need to implement some similar methods. This limited similarity may not justify a hierarchical MyOtherClass : Object <StringEncoding> - (String *) encodetostring; - (void) decodefromstring: (String *) class MyOtherClass extends Object implements StringEncoding { String encodetostring(); void decodefromstring ( String astring ); To declare the interaface to an object while concealing its class. Thus, avoiding to declare an exact class type, even a common superclass type. For example, we can create an object variable that understand the StringEncoding protocol, without declaring its exact class identifier. Objects can be type checked by a compiler against a protocol identifier, like they are checked against a class identifier. id <StringEncoding> anobject; anobject = [ MyClass new ]; //... processing with anobject, then asigned to another object of a distinct class anobject = [ MyOtherClass new ]; StringEncoding anobject; anobject = new MyClass; //... processing with anobject, then asigned to another object of a distinct class anobject = new MyOtherClass; Note that in this example we are using the same variable anobject to hold objects of classes not hierarchically related. The class hidding property The class hidding property reflects the fact that protocols or interfaces are not attached to any class type. It sumarizes the three properties alredy reviewed in the previous section: A protocol defines a set of method signatures allowing the access to any class adopting that protocol and giving a meaning name to that set. A name not related to class names. To understand why class hidding works, we need to see in more detail how protocol method signatures are translated into normal object method calls. The term dynamic binding is often used to name two distinct implementations of how to do an object method call. Classes store 3

4 methods they understand (which would be inherited) in a dispatch method table. An important implementation difference is related to the moment when the dispatch method table of each class is filled with method pointers. Why? Because to fill a dispatch method table it is necessary to review the class hierarchy looking for all inherited methods known by a given class. The search is made from subclasses to superclasses, so a method defined by a subclass is not searched again in a superclass, allowing in this way the overriding of superclass methods by subclasses. One approach to implement dynamic binding is taken by C++ or Eiffel: methods are filled during compile time. The other approach is taken by Smalltalk, Objective-C or Java: methods are filled at runtime [Revisar Java]. At compile time they do not store method pointers, but method signatures. Method signatures have an associed method pointer, but the same method signature have different method pointers in different classes. At runtime they select a correct method pointer searching up the class hierarchy using a method signature as request. A protocols is a set of method signatures. A protocol variable stores objects belonging to any class that conforms to that set of method signatures. When it is requested the execution of a method through a protocol variable, the object receives the method signature and selects the exact method pointer to execute. Method requesting and method execution are decoupled. For this reason it is possible for a protocol variable to hold an object of any class conforming to that protocol. If protocols would have used method pointers, all objects stored in protocol variables should agree in those method pointers. This is exactly the case of an object variable of a pure abstract base class. Protocols or interfaces are a very simple yet powerful abstraction, which slightly modifies the way traditional object oriented designs are carried out. As we will explore in this paper, protocol-based design encourages the separation between functionality and implementation through the use of the class hidding property in similar ways as encapsulation can do. But the implications of protocol use are a little more complex, so we will review them before. Protocol hierarchy concepts A protocol or interface that incorporates other or others protocols is a protocol hierarchy. Note that, as a special case, a protocol hierarchy can contain only one protocol if the functionality described is simple enough and it does not incorporate any other protocol. Four key aspects must be kept in mind about protocol hierarchies. The use of protocols can be viewed as another way of polymorphism. Because it lets us to reffer to an unrelated group of classes using a protocol identifier, not only a class identifier. Thus it is more generic than the use of abstract classes. In this example the encoding protocol is used to handle several unrelated classes as a common abstraction. Figure 1 shows the difference from a classical class hierarchy approach. StringEncoding MyClass StringEncoding MyOtherClass StringEncoding MyClass MyOtherClass Figure 1. Classic hierarchies need abstract classes to support common functionality. With protocols, the design is strainfoward, because classes only need to agree in protocols. The figure shows the StringEncoding abstract class in in italic inside a rectangle. It also shows a representation of protocols adopted by a class using rounded rectangles below the class name. 4

5 As we see before, a StringEncoding protocol variable can be used to hold any object belonging to any class that conforms to the StringEncoding protocol. Pure abstract superclasses are replaced by protocol adoption, simplifying the class hierarchy tree. A protocol is a partial functionality type check. It only checks a specific functionality of a given object, not the whole set of functionality provided by a given object, which maybe is distributed among several protocols. Protocols are a type checking form. It is more flexible than a whole class type check, and it can be made at compile time and at run time. A static type check is made declaring a protocol or interface variable, as we have seen before. A run time protocol type check in Objective-C and Java is the following: if ( [ anobject conformsto ) ] ) { // dynamic type check ok bool ConformsTo ( Object anobject, Object aninterface ) { //... to be filled if ( ConformsTo ( anobject, aninterface ) ) { // dynamic type check ok The Java example is somewhat more complex, because Java reflection facility continues being not as complete as desired. A protocol hierarchy defines a structured abstract interface. A tree of incorporated or inherited protocol declarations offers a more structured and often convenient organization than a simple method declaration enumeration. It is different from a hierarchy of pure abstract classes, because the protocol hierarchy is not attached to any class or set of classes. StringEncoding ByteDataEncoding Encoding Figure 2. StringEncoding and ByteDataEncoding are stand alone protocols which can be incorporated in a more generic Encoding protocol for type checking purposes. A protocol hierarchy decouples functionality from implementation through class hidding. This is an important conclusion from previous points. Complex interfaces can be declared using protocol hierarchies, and different class implementations can conform to those protocols. Using protocol-typed variables instead of class-typed variables literally detach implementation constraints from a functional point of view. 5

6 Protocol hierarchies hide class implementations. You can define multiple points of view using different protocol hierarchies. These hierarchies can be mapped to one or several class hierarchies implementations, which in turn can use again protocol hierarchies if it is needed. But, as protocols only provide a protocol name and method signatures, other implicit semantics about the use of protocol variables must be well documented. This is not new, it is equally aplied to pure abstract classes and class clusters. Functional layer (protocols) Implementation layer (classes & protocols) Figure 3. Protocols are not tied to any particular class. Among them they build a functional hierarchy not tied to a concrete implementation. This independence can serve to figure out more decoupled designs, only using protocols as an intermediate layer which hides implementation details. Several protocol hierarchies can represent different points of view of the same problem. Figure 3 shows the point. An object oriented design can be splitted in two layers: one functional with an equivalent of abstract classes using protocol hierarchies, and other with an actual implementation of the functional interface previously described. Of course, the implementation layer could be complex enough to have to be partitioned again. To ilustrate the last point better, let us assume that we are designing a list facility. We would like to declare an abstract list interface, since different implementations could be provided. There is an interesting property we would want to maintain in the list facility design. Read only lists are thread safe after construction. They are non-mutable objects. Mutable objects could have problems in a multithreading environment if they are not implemented with care, but the same problem is irrelevant for non-mutable ones. So we would like to design the list facility with mutable and non-mutable concepts in mind. A nonmutable list declares methods to read elements, and a mutable one declares methods for read an write elements. Module using protocol variables (using the functional layer) Array Linked Functional layer Modules implementing a class hierarchy conforming to protocols declared in the functional layer. MutableArray MutableLinked Implementation layer Figure 4. The and are part of a protocol hierarchy. Different implementations can be provided for distinct requirements. In this case an Array and a Linked. Note how these implementations are quite strainforward because protocols simplify the overall design and they not need to have common superclasses. Figure 4 shows the basis of functional and implementation separation. The functional layer is defined using a protocol hierarchy of two protocols: and. That is all we need 6

7 to know about the list facility interface, because we can use variables typed with those protocols. The real nature of the implementation classes for the protocol hierarchy does not need to be known. Array and Linked could belong to different class libraries. Let us see it in more detail reviewing protocol relations. is a protocol that incorporates the protocol. Array adopts the protocol. MutableArray inherits from Array and adopts the protocol. Finally, MutableArray conforms to the and protocols. Note that MutableArray conforms to the protocols in two distinct ways. It inherits from Array which adopts the protocol and it adopts the protocol because incorporates the protocol. There is no problem with that, because duplicated method signatures are not taken into account. More important, the class hidding property of protocol hierarchies allow us to concentrate in three different smaller problems instead of a single greater problem. Figure 4 shows the three modules used in this example. A module which use the list facility through protocol variables, a module implementing the array-based list facility and a module implementing the linked list-based list facility. The only needed connection are protocol declarations. In a traditional class hierarchy, as shown in figure 5, design approach we must keep in mind the complete class diagram for a very simple functionality while writing a module using the whole list facility class hierarchy. Array Linked MutableArray MutableLinked Figure 5. The and are pure abstract classes, and are shown in italic. The functional equivalent design in a traditional class hierarchy is more complex, including multiple inheritance relationships. 7

8 Protocol hierarchies do not need to conform to a one-to-one relationship with implementation hierarchies. In the above example, we would want to have two different implementations of a abstraction. One of these implementations could have the thread-safe property and would set the apropiate locks when writing data into the list. The other one could implement a mutable list without the overhead of a thread-safe code to be used in programs with only one thread. Linked Array MutableArray MutableThreadSafeArray MutableLinked MutableThreadSafeLinked Figure 6. In this case, the list facility protocol hierarchy continues having two protocols: and. We also provide two different class hierarchy trees (for illustrating purposes) representing different choices during the implementation phase. Note that these differences are not known by the module using the list facility protocol variables. The example shown in Figure 6 represents two different implementation choices for the list facility protocol hierarchy. We have continued improving the implementation details of the two implementation modules without modifying the protocol hierarchy. The module using the protocol hierarchy only need to change to reflect the exact class thread-safe or not which will be hold in a protocol variable. This issue can be properly hidden using a factory for the list facility, as we will review later. Of course, other list implementations could be added without breaking the existing ones, maybe with radically different implementation designs, like a distributed access to objects in other processes or machines. Other requirements might show us the convenience to have another way to reffer to our multiples implementations of the list facility. Those other requirements could lead us to consider the same implementations from another point of view. For example, a list can be viewed as a degenerated tree: a tree which every node has only one child. In this case, we want to see our list facility from other point of view: as a tree facility. Tree classes have few things in common with lists and they might be implemented in another class hierarchy. If we are using protocol hierarchies, we can modify our list facility to behave as a tree facility, allowing the reuse of our list facility from modules using protocol variables of a tree protocol hierarchy. We only need to implement the tree protocol hierarchy method signatures translating them to list facility calls. 8

9 Linked, Tree Tree MutableTree MutableLinked, MutableTree Functional layer MutableThreadSafeLinked, MutableTree Implementation layer Class hierarchies design simplification Protocol hierarchies allow us to describe problems from a functional point of view, rather than an implementation point of view. The inherent decoupled behavior of protocols from classes is quite convenient to describe problems without imposing implementation constraints. We will review three interesting simplifications with the use of protocol hierarchies. They simplify common object oriented designs, even the most simple ones, and alredy well documented using design patterns. As a side effect, these simplified designs are more suitable to be composed successfully. Without protocols or interfaces, some problems cannot be isolated from non-elegant implementation details, disallowing us to obtain clearer and simpler designs. They can substitute many times the use of multiple inheritance, permitting us to reuse single inheritance designs in ways that were not possible previously. Design patterns simplification There is an interesting field of research in the documentation of OO designs, with the aim to reuse good OO design ideas alredy proben to be applied in other designs.... Figure 7. The separation of protocol hierarchies and implementation hierarchies dramatically reduces the complexity of object oriented designs. The benefits grows with the addition of new points of view. Note that the inclusion of a tree point of view does not increases the complexity of the overall design, which is not true for a classical class hierarchy design. Class hierarchies limitations To ilustrate the protocol hierarchies let face to the following problem: We want to create a multiplatform graphical user interface programming framework. For example, to support some different graphical user interfaces (GUI) like Sun XView [Hel93] and OSF Motif [Hel94]. We would like to have an independient framework to describe both GUI, hidding the implementation differences between them. We could begin defining an abstract GUI object class GuiObject, which could have two (or maybe more in the future) specific subclasses: 9

10 XvGuiObject and XmGuiObject. Later, we could add more specific graphical items, like a form and a generic form item. GuiObject XmGuiObject XvGuiObject GuiForm XmGuiForm XvGuiForm GuiFormItem Figure 1a shows an initial attempt to sort this problem out. We are really describing a GUI independient interface and behavior and two GUI specific implementations of the same hierarchy. But single inheritance is not well suited for this problem. For example, we cannot reuse specific behavior from GUI specific classes, because the inheritance tree is alredy used while trying to get the independent behavior

11 11

12 Bibliography [Coa95] Peter Coad, David North, Mark Mayfield. Object models: strategies, paterns, and applications. Prentice Hall, Englewood Cliffs, NJ, [Coo95] Sean Cooter. Inside Taligent Technology. Addison-Wesley, Reading, MA, [Don95] Don Larkin, Greg Wilson. Object oriented programming and the objective- C language. NeXT Developer Library. Addison-Wesley, Reading, MA, REVISAR [Gam95] Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides. Design Patterns. Elements of reusable object-oriented software. Addison-Wesley, Reading, MA, [Hel93] Dan Heller, Thomas Van Raalte. XView Programming Manual for XView Version 3.2. O Reilly & Associates, Inc [Hel94] Dan Heller, Paula M. Ferguson. Motif programming Manual for OSF/Motif Release 1.2. O Reilly & Associates, Inc [Hel96] Richard Helm, Erich Gamma. The Courier Patern. Dr. Dobb s Sourcebook. january/february [Ion95] Orbix Programmer s Guide. Release 1.3. Iona Technologies Ltd. July [Vli96] Pattern Languajes of Program Design 2. Edited by John Vlissides, James Coplien and Norman Kerth. Addison-Wesley, Reading, MA,

James Newkirk

James Newkirk Private Interface Class Structural James Newkirk newkirk@oma.com Intent Provide a mechanism that allows specific classes to use a non-public subset of a class interface without inadvertently increasing

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

Object-Oriented Software Development Goal and Scope

Object-Oriented Software Development Goal and Scope Object-Oriented Software Development Goal and Scope Koichiro Ochimizu Japan Advanced Institute of Science and Technologies School of Information Science Scope and Goal Goal enable you to understand basic

More information

Patterns for polymorphic operations

Patterns for polymorphic operations Patterns for polymorphic operations Three small object structural patterns for dealing with polymorphism Alexander A. Horoshilov hor@epsylontech.com Abstract Polymorphism is one of the main elements of

More information

REVIEW OF THE BASIC CHARACTERISTICS OF OBJECT ORIENTATION

REVIEW OF THE BASIC CHARACTERISTICS OF OBJECT ORIENTATION c08classandmethoddesign.indd Page 282 13/12/14 2:57 PM user 282 Chapter 8 Class and Method Design acceptance of UML as a standard object notation, standardized approaches based on work of many object methodologists

More information

Object-Oriented Languages and Object-Oriented Design. Ghezzi&Jazayeri: OO Languages 1

Object-Oriented Languages and Object-Oriented Design. Ghezzi&Jazayeri: OO Languages 1 Object-Oriented Languages and Object-Oriented Design Ghezzi&Jazayeri: OO Languages 1 What is an OO language? In Ada and Modula 2 one can define objects encapsulate a data structure and relevant operations

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

What are the characteristics of Object Oriented programming language?

What are the characteristics of Object Oriented programming language? What are the various elements of OOP? Following are the various elements of OOP:- Class:- A class is a collection of data and the various operations that can be performed on that data. Object- This is

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

Java Object Oriented Design. CSC207 Fall 2014

Java Object Oriented Design. CSC207 Fall 2014 Java Object Oriented Design CSC207 Fall 2014 Design Problem Design an application where the user can draw different shapes Lines Circles Rectangles Just high level design, don t write any detailed code

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

Goals of Lecture. Lecture 27: OO Design Patterns. Pattern Resources. Design Patterns. Cover OO Design Patterns. Pattern Languages of Programming

Goals of Lecture. Lecture 27: OO Design Patterns. Pattern Resources. Design Patterns. Cover OO Design Patterns. Pattern Languages of Programming Goals of Lecture Lecture 27: OO Design Patterns Cover OO Design Patterns Background Examples Kenneth M. Anderson Object-Oriented Analysis and Design CSCI 6448 - Spring Semester, 2001 April 24, 2001 Kenneth

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

CHAPTER 6: CREATIONAL DESIGN PATTERNS

CHAPTER 6: CREATIONAL DESIGN PATTERNS CHAPTER 6: CREATIONAL DESIGN PATTERNS SESSION III: BUILDER, PROTOTYPE, SINGLETON Software Engineering Design: Theory and Practice by Carlos E. Otero Slides copyright 2012 by Carlos E. Otero For non-profit

More information

Lecture 13: Design Patterns

Lecture 13: Design Patterns 1 Lecture 13: Design Patterns Kenneth M. Anderson Object-Oriented Analysis and Design CSCI 6448 - Spring Semester, 2005 2 Pattern Resources Pattern Languages of Programming Technical conference on Patterns

More information

Pattern Resources. Lecture 25: Design Patterns. What are Patterns? Design Patterns. Pattern Languages of Programming. The Portland Pattern Repository

Pattern Resources. Lecture 25: Design Patterns. What are Patterns? Design Patterns. Pattern Languages of Programming. The Portland Pattern Repository Pattern Resources Lecture 25: Design Patterns Kenneth M. Anderson Object-Oriented Analysis and Design CSCI 6448 - Spring Semester, 2003 Pattern Languages of Programming Technical conference on Patterns

More information

Programming Language Concepts Object-Oriented Programming. Janyl Jumadinova 28 February, 2017

Programming Language Concepts Object-Oriented Programming. Janyl Jumadinova 28 February, 2017 Programming Language Concepts Object-Oriented Programming Janyl Jumadinova 28 February, 2017 Three Properties of Object-Oriented Languages: Encapsulation Inheritance Dynamic method binding (polymorphism)

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

SOFTWARE PATTERNS. Joseph Bonello

SOFTWARE PATTERNS. Joseph Bonello SOFTWARE PATTERNS Joseph Bonello MOTIVATION Building software using new frameworks is more complex And expensive There are many methodologies and frameworks to help developers build enterprise application

More information

Alternator. An Object Behavioral Design Pattern. John Liebenau

Alternator. An Object Behavioral Design Pattern. John Liebenau Alternator An Design Pattern John Liebenau lieb@itginc.com Copyright 1999, John Liebenau. Permission is granted to copy for the PLoP 1999 conference. All other rights reserved. July 23, 1999 Page 1 1.

More information

Object-Oriented Design

Object-Oriented Design Object-Oriented Design Lecturer: Raman Ramsin Lecture 20: GoF Design Patterns Creational 1 Software Patterns Software Patterns support reuse of software architecture and design. Patterns capture the static

More information

CPS 506 Comparative Programming Languages. Programming Language

CPS 506 Comparative Programming Languages. Programming Language CPS 506 Comparative Programming Languages Object-Oriented Oriented Programming Language Paradigm Introduction Topics Object-Oriented Programming Design Issues for Object-Oriented Oriented Languages Support

More information

Object Oriented Programming

Object Oriented Programming Object Oriented Programming Ray John Pamillo 1/27/2016 1 Nokia Solutions and Networks 2014 Outline: Brief History of OOP Why use OOP? OOP vs Procedural Programming What is OOP? Objects and Classes 4 Pillars

More information

Acyclic Visitor Pattern in Formulation of Mathematical Model

Acyclic Visitor Pattern in Formulation of Mathematical Model Acyclic Visitor Pattern in Formulation of Mathematical Model Ales CEPEK and Jan PYTEL, Czech Republic Key words: acyclic visitor pattern, mathematical model. SUMMARY This paper discusses the use and advantages

More information

PATTERNS AND SOFTWARE DESIGN

PATTERNS AND SOFTWARE DESIGN This article first appeared in Dr. Dobb s Sourcebook, March/April, 1995. Copyright 1995, Dr. Dobb's Journal. PATTERNS AND SOFTWARE DESIGN Patterns for Reusable Object-Oriented Software Richard Helm and

More information

Programming II (CS300)

Programming II (CS300) 1 Programming II (CS300) Chapter 05: Inheritance and Interfaces MOUNA KACEM mouna@cs.wisc.edu Fall 2018 Inheritance and Interfaces 2 Introduction Inheritance and Class Hierarchy Polymorphism Abstract Classes

More information

Facade and Adapter. Comp-303 : Programming Techniques Lecture 19. Alexandre Denault Computer Science McGill University Winter 2004

Facade and Adapter. Comp-303 : Programming Techniques Lecture 19. Alexandre Denault Computer Science McGill University Winter 2004 Facade and Adapter Comp-303 : Programming Techniques Lecture 19 Alexandre Denault Computer Science McGill University Winter 2004 March 23, 2004 Lecture 19 Comp 303 : Facade and Adapter Page 1 Last lecture...

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

JAVA MOCK TEST JAVA MOCK TEST II

JAVA MOCK TEST JAVA MOCK TEST II http://www.tutorialspoint.com JAVA MOCK TEST Copyright tutorialspoint.com This section presents you various set of Mock Tests related to Java Framework. You can download these sample mock tests at your

More information

CSE 401/M501 Compilers

CSE 401/M501 Compilers CSE 401/M501 Compilers ASTs, Modularity, and the Visitor Pattern Hal Perkins Autumn 2018 UW CSE 401/M501 Autumn 2018 H-1 Agenda Today: AST operations: modularity and encapsulation Visitor pattern: basic

More information

Wrapping a complex C++ library for Eiffel. FINAL REPORT July 1 st, 2005

Wrapping a complex C++ library for Eiffel. FINAL REPORT July 1 st, 2005 Wrapping a complex C++ library for Eiffel FINAL REPORT July 1 st, 2005 Semester project Student: Supervising Assistant: Supervising Professor: Simon Reinhard simonrei@student.ethz.ch Bernd Schoeller Bertrand

More information

Programming II (CS300)

Programming II (CS300) 1 Programming II (CS300) Chapter 05: Inheritance and Interfaces MOUNA KACEM mouna@cs.wisc.edu Spring 2018 Inheritance and Interfaces 2 Introduction Inheritance and Class Hierarchy Polymorphism Abstract

More information

Object-Oriented Design

Object-Oriented Design Object-Oriented Design Lecturer: Raman Ramsin Lecture 9: Generalization/Specialization 1 Analysis Workflow: Analyze a Use Case The analysis workflow consists of the following activities: Architectural

More information

Graphical Interface and Application (I3305) Semester: 1 Academic Year: 2017/2018 Dr Antoun Yaacoub

Graphical Interface and Application (I3305) Semester: 1 Academic Year: 2017/2018 Dr Antoun Yaacoub Lebanese University Faculty of Science Computer Science BS Degree Graphical Interface and Application (I3305) Semester: 1 Academic Year: 2017/2018 Dr Antoun Yaacoub 2 Crash Course in JAVA Classes A Java

More information

Object Oriented Issues in VDM++

Object Oriented Issues in VDM++ Object Oriented Issues in VDM++ Nick Battle, Fujitsu UK (nick.battle@uk.fujitsu.com) Background VDMJ implemented VDM-SL first (started late 2007) Formally defined. Very few semantic problems VDM++ support

More information

Chapter 11. Categories of languages that support OOP: 1. OOP support is added to an existing language

Chapter 11. Categories of languages that support OOP: 1. OOP support is added to an existing language Categories of languages that support OOP: 1. OOP support is added to an existing language - C++ (also supports procedural and dataoriented programming) - Ada 95 (also supports procedural and dataoriented

More information

26.1 Introduction Programming Preliminaries... 2

26.1 Introduction Programming Preliminaries... 2 Department of Computer Science Tackling Design Patterns Chapter 27: Proxy Design Pattern Copyright c 2016 by Linda Marshall and Vreda Pieterse. All rights reserved. Contents 26.1 Introduction.................................

More information

Concepts of Programming Languages

Concepts of Programming Languages Concepts of Programming Languages Lecture 10 - Object-Oriented Programming Patrick Donnelly Montana State University Spring 2014 Patrick Donnelly (Montana State University) Concepts of Programming Languages

More information

Lecture Notes on Programming Languages

Lecture Notes on Programming Languages Lecture Notes on Programming Languages 85 Lecture 09: Support for Object-Oriented Programming This lecture discusses how programming languages support object-oriented programming. Topics to be covered

More information

be used for more than one use case (for instance, for use cases Create User and Delete User, one can have one UserController, instead of two separate

be used for more than one use case (for instance, for use cases Create User and Delete User, one can have one UserController, instead of two separate UNIT 4 GRASP GRASP: Designing objects with responsibilities Creator Information expert Low Coupling Controller High Cohesion Designing for visibility - Applying GoF design patterns adapter, singleton,

More information

Tackling Design Patterns Chapter 3: Template Method design pattern and Public Inheritance. 3.1 Introduction... 2

Tackling Design Patterns Chapter 3: Template Method design pattern and Public Inheritance. 3.1 Introduction... 2 Department of Computer Science Tackling Design Patterns Chapter 3: Template Method design pattern and Public Inheritance Copyright c 2016 by Linda Marshall and Vreda Pieterse. All rights reserved. Contents

More information

Inheritance. OOP components. Another Example. Is a Vs Has a. Virtual Destructor rule. Virtual Functions 4/13/2017

Inheritance. OOP components. Another Example. Is a Vs Has a. Virtual Destructor rule. Virtual Functions 4/13/2017 OOP components For : COP 3330. Object oriented Programming (Using C++) http://www.compgeom.com/~piyush/teach/3330 Data Abstraction Information Hiding, ADTs Encapsulation Type Extensibility Operator Overloading

More information

Introduction to Object-Oriented Programming

Introduction to Object-Oriented Programming 1/9 Introduction to Object-Oriented Programming Conception et programmation orientées object, B. Meyer, Eyrolles Object-Oriented Software Engineering, T. C. Lethbridge, R. Laganière, McGraw Hill Design

More information

DESIGN PATTERN - INTERVIEW QUESTIONS

DESIGN PATTERN - INTERVIEW QUESTIONS DESIGN PATTERN - INTERVIEW QUESTIONS http://www.tutorialspoint.com/design_pattern/design_pattern_interview_questions.htm Copyright tutorialspoint.com Dear readers, these Design Pattern Interview Questions

More information

Object Model. Object Oriented Programming Spring 2015

Object Model. Object Oriented Programming Spring 2015 Object Model Object Oriented Programming 236703 Spring 2015 Class Representation In Memory A class is an abstract entity, so why should it be represented in the runtime environment? Answer #1: Dynamic

More information

Inheritance and Substitution (Budd chapter 8, 10)

Inheritance and Substitution (Budd chapter 8, 10) Inheritance and Substitution (Budd chapter 8, 10) 1 2 Plan The meaning of inheritance The syntax used to describe inheritance and overriding The idea of substitution of a child class for a parent The various

More information

Transparent Remote Access

Transparent Remote Access Abstract Transparent Remote Access Klaus Marquardt Käthe-Kollwitz-Weg 14, D-23558 Lübeck, Germany Email: marquardt@acm.org In distributed systems, the different processors communicate via network messages.

More information

Design Patterns: Part 2

Design Patterns: Part 2 Design Patterns: Part 2 ENGI 5895: Software Design Andrew Vardy with code samples from Dr. Rodrigue Byrne and [Martin(2003)] Faculty of Engineering & Applied Science Memorial University of Newfoundland

More information

4.1 Introduction Programming preliminaries Constructors Destructors An example... 3

4.1 Introduction Programming preliminaries Constructors Destructors An example... 3 Department of Computer Science Tackling Design Patterns Chapter 4: Factory Method design pattern Copyright c 2016 by Linda Marshall and Vreda Pieterse. All rights reserved. Contents 4.1 Introduction.................................

More information

Coordination Patterns

Coordination Patterns Coordination Patterns 1. Coordination Patterns Design Patterns and their relevance for Coordination Oscar Nierstrasz Software Composition Group Institut für Informatik (IAM) Universität Bern oscar@iam.unibe.ch

More information

C++ Inheritance and Encapsulation

C++ Inheritance and Encapsulation C++ Inheritance and Encapsulation Private and Protected members Inheritance Type Public Inheritance Private Inheritance Protected Inheritance Special method inheritance 1 Private Members Private members

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

An Introduction to Patterns and Pattern Languages. Overview. Patterns -- Why? Patterns -- Why?

An Introduction to Patterns and Pattern Languages. Overview. Patterns -- Why? Patterns -- Why? An Introduction to Patterns and Pattern Languages CSC591O April 7-9, 1997 Raleigh, NC Copyright (C) 1996, Kyle Brown, Bobby Woolf, and Knowledge Systems Corp. All rights reserved. 1 Kyle Brown Senior Member

More information

What s Conformance? Conformance. Conformance and Class Invariants Question: Conformance and Overriding

What s Conformance? Conformance. Conformance and Class Invariants Question: Conformance and Overriding Conformance Conformance and Class Invariants Same or Better Principle Access Conformance Contract Conformance Signature Conformance Co-, Contra- and No-Variance Overloading and Overriding Inheritance as

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

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

Design Patterns. Gunnar Gotshalks A4-1

Design Patterns. Gunnar Gotshalks A4-1 Design Patterns A4-1 On Design Patterns A design pattern systematically names, explains and evaluates an important and recurring design problem and its solution Good designers know not to solve every problem

More information

C++ Programming: Introduction to C++ and OOP (Object Oriented Programming)

C++ Programming: Introduction to C++ and OOP (Object Oriented Programming) C++ Programming: Introduction to C++ and OOP (Object Oriented Programming) 2018 년도 2 학기 Instructor: Young-guk Ha Dept. of Computer Science & Engineering Contents Brief introduction to C++ OOP vs. Procedural

More information

Implementing Object Equivalence in Java Using the Template Method Design Pattern

Implementing Object Equivalence in Java Using the Template Method Design Pattern Implementing Object Equivalence in Java Using the Template Method Design Pattern Daniel E. Stevenson and Andrew T. Phillips Computer Science Department University of Wisconsin-Eau Claire Eau Claire, WI

More information

Exception Handling Alternatives (Part 2)

Exception Handling Alternatives (Part 2) Exception Handling Alternatives (Part 2) First published in Overload 31 Copyright 1999 Detlef Vollmann Resume In part 1, several alternative mechanisms for handling exceptional events were presented. One

More information

Microthread. An Object Behavioral Pattern for Managing Object Execution. 1.0 Intent. 2.0 Also Known As. 3.0 Classification. 4.0 Motivation/Example

Microthread. An Object Behavioral Pattern for Managing Object Execution. 1.0 Intent. 2.0 Also Known As. 3.0 Classification. 4.0 Motivation/Example Microthread An Object Behavioral Pattern for Managing Object Execution Joe Hoffert and Kenneth Goldman {joeh,kjg}@cs.wustl.edu Distributed Programing Environments Group Department of Computer Science,

More information

Design issues for objectoriented. languages. Objects-only "pure" language vs mixed. Are subclasses subtypes of the superclass?

Design issues for objectoriented. languages. Objects-only pure language vs mixed. Are subclasses subtypes of the superclass? Encapsulation Encapsulation grouping of subprograms and the data they manipulate Information hiding abstract data types type definition is hidden from the user variables of the type can be declared variables

More information

M301: Software Systems & their Development. Unit 4: Inheritance, Composition and Polymorphism

M301: Software Systems & their Development. Unit 4: Inheritance, Composition and Polymorphism Block 1: Introduction to Java Unit 4: Inheritance, Composition and Polymorphism Aims of the unit: Study and use the Java mechanisms that support reuse, in particular, inheritance and composition; Analyze

More information

R/3 System Object-Oriented Concepts of ABAP

R/3 System Object-Oriented Concepts of ABAP R/3 System Object-Oriented Concepts of ABAP Copyright 1997 SAP AG. All rights reserved. No part of this brochure may be reproduced or transmitted in any form or for any purpose without the express permission

More information

Comp 311 Principles of Programming Languages Lecture 21 Semantics of OO Languages. Corky Cartwright Mathias Ricken October 20, 2010

Comp 311 Principles of Programming Languages Lecture 21 Semantics of OO Languages. Corky Cartwright Mathias Ricken October 20, 2010 Comp 311 Principles of Programming Languages Lecture 21 Semantics of OO Languages Corky Cartwright Mathias Ricken October 20, 2010 Overview I In OO languages, data values (except for designated non-oo

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

Object-Oriented Design

Object-Oriented Design Object-Oriented Design Lecturer: Raman Ramsin Lecture 10: Analysis Packages 1 Analysis Workflow: Packages The analysis workflow consists of the following activities: Architectural analysis Analyze a use

More information

Inheritance. Transitivity

Inheritance. Transitivity Inheritance Classes can be organized in a hierarchical structure based on the concept of inheritance Inheritance The property that instances of a sub-class can access both data and behavior associated

More information

security model. The framework allowed for quickly creating applications that examine nancial data stored in a database. The applications that are gene

security model. The framework allowed for quickly creating applications that examine nancial data stored in a database. The applications that are gene Patterns For Developing Successful Object-Oriented Frameworks Joseph W. Yoder August 27, 1997 1 Overview The work described here extends last years OOPSLA framework workshop paper [Yoder 1996] describing

More information

ADAPTER. Topics. Presented By: Mallampati Bhava Chaitanya

ADAPTER. Topics. Presented By: Mallampati Bhava Chaitanya ADAPTER Presented By: Mallampati Bhava Chaitanya Topics Intent Motivation Applicability Structure Participants & Collaborations Consequences Sample Code Known Uses Related Patterns Intent Convert the interface

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

Object-Oriented Concepts and Principles (Adapted from Dr. Osman Balci)

Object-Oriented Concepts and Principles (Adapted from Dr. Osman Balci) Object-Oriented Concepts and Principles (Adapted from Dr. Osman Balci) Sung Hee Park Department of Mathematics and Computer Science Virginia State University September 18, 2012 The Object-Oriented Paradigm

More information

Chapter 5. Inheritance

Chapter 5. Inheritance Chapter 5 Inheritance Objectives Know the difference between Inheritance and aggregation Understand how inheritance is done in Java Learn polymorphism through Method Overriding Learn the keywords : super

More information

Chapter 5: Procedural abstraction. Function procedures. Function procedures. Proper procedures and function procedures

Chapter 5: Procedural abstraction. Function procedures. Function procedures. Proper procedures and function procedures Chapter 5: Procedural abstraction Proper procedures and function procedures Abstraction in programming enables distinction: What a program unit does How a program unit works This enables separation of

More information

Data Structures (list, dictionary, tuples, sets, strings)

Data Structures (list, dictionary, tuples, sets, strings) Data Structures (list, dictionary, tuples, sets, strings) Lists are enclosed in brackets: l = [1, 2, "a"] (access by index, is mutable sequence) Tuples are enclosed in parentheses: t = (1, 2, "a") (access

More information

Idioms for Building Software Frameworks in AspectJ

Idioms for Building Software Frameworks in AspectJ Idioms for Building Software Frameworks in AspectJ Stefan Hanenberg 1 and Arno Schmidmeier 2 1 Institute for Computer Science University of Essen, 45117 Essen, Germany shanenbe@cs.uni-essen.de 2 AspectSoft,

More information

Object-oriented Programming. Object-oriented Programming

Object-oriented Programming. Object-oriented Programming 2014-06-13 Object-oriented Programming Object-oriented Programming 2014-06-13 Object-oriented Programming 1 Object-oriented Languages object-based: language that supports objects class-based: language

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

Overview of OOP. Dr. Zhang COSC 1436 Summer, /18/2017

Overview of OOP. Dr. Zhang COSC 1436 Summer, /18/2017 Overview of OOP Dr. Zhang COSC 1436 Summer, 2017 7/18/2017 Review Data Structures (list, dictionary, tuples, sets, strings) Lists are enclosed in square brackets: l = [1, 2, "a"] (access by index, is mutable

More information

Inheritance and Polymorphism

Inheritance and Polymorphism Division of Mathematics and Computer Science Maryville College Outline Inheritance 1 Inheritance 2 3 Outline Inheritance 1 Inheritance 2 3 The "is-a" Relationship The "is-a" Relationship Object classification

More information

Software Engineering - I An Introduction to Software Construction Techniques for Industrial Strength Software

Software Engineering - I An Introduction to Software Construction Techniques for Industrial Strength Software Software Engineering - I An Introduction to Software Construction Techniques for Industrial Strength Software Chapter 9 Introduction to Design Patterns Copy Rights Virtual University of Pakistan 1 Design

More information

What about Object-Oriented Languages?

What about Object-Oriented Languages? What about Object-Oriented Languages? What is an OOL? A language that supports object-oriented programming How does an OOL differ from an ALL? (ALGOL-Like Language) Data-centric name scopes for values

More information

CS260 Intro to Java & Android 03.Java Language Basics

CS260 Intro to Java & Android 03.Java Language Basics 03.Java Language Basics http://www.tutorialspoint.com/java/index.htm CS260 - Intro to Java & Android 1 What is the distinction between fields and variables? Java has the following kinds of variables: Instance

More information

OBJECT ORİENTATİON ENCAPSULATİON

OBJECT ORİENTATİON ENCAPSULATİON OBJECT ORİENTATİON Software development can be seen as a modeling activity. The first step in the software development is the modeling of the problem we are trying to solve and building the conceptual

More information

Atelier Java - J1. Marwan Burelle. EPITA Première Année Cycle Ingénieur.

Atelier Java - J1. Marwan Burelle.  EPITA Première Année Cycle Ingénieur. marwan.burelle@lse.epita.fr http://wiki-prog.kh405.net Plan 1 2 Plan 3 4 Plan 1 2 3 4 A Bit of History JAVA was created in 1991 by James Gosling of SUN. The first public implementation (v1.0) in 1995.

More information

Introduction to C++ Introduction to C++ Dr Alex Martin 2013 Slide 1

Introduction to C++ Introduction to C++ Dr Alex Martin 2013 Slide 1 Introduction to C++ Introduction to C++ Dr Alex Martin 2013 Slide 1 Inheritance Consider a new type Square. Following how we declarations for the Rectangle and Circle classes we could declare it as follows:

More information

PROGRAMMING IN C++ COURSE CONTENT

PROGRAMMING IN C++ COURSE CONTENT PROGRAMMING IN C++ 1 COURSE CONTENT UNIT I PRINCIPLES OF OBJECT ORIENTED PROGRAMMING 2 1.1 Procedure oriented Programming 1.2 Object oriented programming paradigm 1.3 Basic concepts of Object Oriented

More information

Introduction to Design Patterns

Introduction to Design Patterns Introduction to Design Patterns First, what s a design pattern? a general reusable solution to a commonly occurring problem within a given context in software design It s not a finished design that can

More information

Subtyping (Dynamic Polymorphism)

Subtyping (Dynamic Polymorphism) Fall 2018 Subtyping (Dynamic Polymorphism) Yu Zhang Course web site: http://staff.ustc.edu.cn/~yuzhang/tpl References PFPL - Chapter 24 Structural Subtyping - Chapter 27 Inheritance TAPL (pdf) - Chapter

More information

Introduction. Object-Oriented Programming Spring 2015

Introduction. Object-Oriented Programming Spring 2015 Introduction Object-Oriented Programming 236703 Spring 2015 1 Course Staff Lecturer in charge: Prof. Eran Yahav Lecturer: Eran Gilad TA in charge: Nurit Moscovici TAs: Helal Assi, Eliran Weiss 3 Course

More information

Inheritance and Polymorphism

Inheritance and Polymorphism Division of Mathematics and Computer Science Maryville College Outline Inheritance 1 Inheritance 2 3 Outline Inheritance 1 Inheritance 2 3 The "is-a" Relationship Object classification is typically hierarchical.

More information

Acyclic Visitor. (v1.0) Robert C. Martin Object Mentor A MyFunction Visitor

Acyclic Visitor. (v1.0) Robert C. Martin Object Mentor A MyFunction Visitor Acyclic Visitor (v1.0) Robert C. Martin Object Mentor rmartin@oma.com INTENT Allow new functions to be added to existing class hierarchies without affecting those hierarchies, and without creating the

More information

Object Oriented Programming in Java. Jaanus Pöial, PhD Tallinn, Estonia

Object Oriented Programming in Java. Jaanus Pöial, PhD Tallinn, Estonia Object Oriented Programming in Java Jaanus Pöial, PhD Tallinn, Estonia Motivation for Object Oriented Programming Decrease complexity (use layers of abstraction, interfaces, modularity,...) Reuse existing

More information

Bugsquashing: Command - Pattern. Andreas Fetzer

Bugsquashing: Command - Pattern. Andreas Fetzer Bugsquashing: Command - Pattern Andreas Fetzer Class structure Command: Abstract superclass of all commands. Concrete Command: Specifies a concrete comand. Has the execute method in which the corresponding

More information

Kerievsky_book.fm Page 355 Thursday, July 8, :12 PM. Index

Kerievsky_book.fm Page 355 Thursday, July 8, :12 PM. Index Kerievsky_book.fm Page 355 Thursday, July 8, 2004 12:12 PM Index A Absorbing class, 117 Abstract Factory, 70 71 Accept methods, 327 Accumulation methods, 315, 325 330 Accumulation refactorings Collecting

More information

Software Engineering Prof. Rushikesh K.Joshi IIT Bombay Lecture-15 Design Patterns

Software Engineering Prof. Rushikesh K.Joshi IIT Bombay Lecture-15 Design Patterns Software Engineering Prof. Rushikesh K.Joshi IIT Bombay Lecture-15 Design Patterns Today we are going to talk about an important aspect of design that is reusability of design. How much our old design

More information

An Introduction to Object Orientation

An Introduction to Object Orientation An Introduction to Object Orientation Rushikesh K Joshi Indian Institute of Technology Bombay rkj@cse.iitb.ac.in A talk given at Islampur Abstractions in Programming Control Abstractions Functions, function

More information

CSCD01 Engineering Large Software Systems. Design Patterns. Joe Bettridge. Winter With thanks to Anya Tafliovich

CSCD01 Engineering Large Software Systems. Design Patterns. Joe Bettridge. Winter With thanks to Anya Tafliovich CSCD01 Engineering Large Software Systems Design Patterns Joe Bettridge Winter 2018 With thanks to Anya Tafliovich Design Patterns Design patterns take the problems consistently found in software, and

More information

CS111: PROGRAMMING LANGUAGE II

CS111: PROGRAMMING LANGUAGE II 1 CS111: PROGRAMMING LANGUAGE II Computer Science Department Lecture 4(b): Subclasses and Superclasses OOP OOP - Inheritance Inheritance represents the is a relationship between data types (e.g. student/person)

More information

Working with Classes and Interfaces

Working with Classes and Interfaces Working with Classes and Interfaces Dirk Riehle SKYVA International www.skyva.com, www.skyva.de riehle@acm.org, www.riehle.org Classes are fundamental to object-oriented design and programming in C++.

More information