The Object Model Nazim H. Madhavji UWO 1(c) N.H. Madhavji, 14 August, 2014.

Slides:



Advertisements
Similar presentations
Chapter 6 Structures and Classes. Copyright © 2006 Pearson Addison-Wesley. All rights reserved. 6-2 Learning Objectives Structures Structure types Structures.
Advertisements

User Defined Functions
COMP1007 Introduction to Requirements Analysis © Copyright De Montfort University 2002 All Rights Reserved COMP1007 Introduction to Requirements Analysis.
Programming Paradigms Introduction. 6/15/2005 Copyright 2005, by the authors of these slides, and Ateneo de Manila University. All rights reserved. L1:
COMPSCI 105 S Principles of Computer Science 12 Abstract Data Type.
1 Object-Oriented Programming (Section ) CSCI 431 Programming Languages Fall 2003 A compilation of material developed by Felix Hernandez-Campos.
Object-Oriented Databases v OO systems associated with – graphical user interface (GUI) – powerful modeling techniques – advanced data management capabilities.
The Unified Software Development Process - Workflows Ivar Jacobson, Grady Booch, James Rumbaugh Addison Wesley, 1999.
Design The goal is to design a modular solution, using the techniques of: Decomposition Abstraction Encapsulation In Object Oriented Programming this is.
Chapter 1 Software Development. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. 1-2 Chapter Objectives Discuss the goals of software development.
Program Flow Charting How to tackle the beginning stage a program design.
1) More on parameter passing: a) Parameter association b) Default parameters c) Procedures as parameters 2) Modules: Ada packages, C modules, C header.
© Wolfgang Pelz Introduction Object-Oriented Methods: Analysis, Design & Programming Dr. Wolfgang Pelz Dr. Yingcai Xiao The University of Akron.
 2006 Pearson Education, Inc. All rights reserved Introduction to Classes and Objects.
“DOK 322 DBMS” Y.T. Database Design Hacettepe University Department of Information Management DOK 322: Database Management Systems.
WEL COME PRAVEEN M JIGAJINNI PGT (Computer Science) MCA, MSc[IT], MTech[IT],MPhil (Comp.Sci), PGDCA, ADCA, Dc. Sc. & Engg.
1 ES 314 Advanced Programming Lec 2 Sept 3 Goals: Complete the discussion of problem Review of C++ Object-oriented design Arrays and pointers.
 QUALITY ASSURANCE:  QA is defined as a procedure or set of procedures intended to ensure that a product or service under development (before work is.
Lesson 7 Guide for Software Design Description (SDD)
CSC2012 Database Technology & CSC2513 Database Systems.
Design Patterns OOD. Course topics Design Principles UML –Class Diagrams –Sequence Diagrams Design Patterns C#,.NET (all the course examples) Design Principles.
1/19 Component Design On-demand Learning Series Software Engineering of Web Application - Principles of Good Component Design Hunan University, Software.
Welcome to OBJECT ORIENTED PROGRAMMIN Date: 10/09/2014 Prepared By Prepared By : VINAY ALEXANDER PGT(CS) KV jhagrakhand.
1 Chapter 1 Parallel Machines and Computations (Fundamentals of Parallel Processing) Dr. Ranette Halverson.
Object Oriented Design and Programming Alan Goude Room: Sheaf 9323.
Gary MarsdenSlide 1University of Cape Town Principles of programming language design Gary Marsden Semester 2 – 2001.
Programming Languages –14 David Watt (Glasgow) Steven Wong (Singapore) Moodle : Computing Science → Level 3 → Programming Languages 3 © 2012 David.
Class Relationships Lecture Oo10 Dependencies. References n Booch, et al, The Unified Modeling Language User Guide, Chapt 5 p.69, Chapt 9 130, Chapt 10.
Program documentation using the Javadoc tool 1 Program documentation Using the Javadoc tool.
Gary MarsdenSlide 1University of Cape Town Human-Computer Interaction - 3 Programmer Support Gary Marsden ( ) July 2002.
Testing in UP1 Testing as part of the Unified Process (UP)
1 CS Programming Languages Class 15 October 17, 2000.
Software Development. Software Developers Refresher A person or organization that designs software and writes the programs. Software development is the.
38 4/11/98 CSE 143 Modules [Chapter 2]. 39 4/11/98 What is a Module?  Collection of related items packaged together  Examples:  Stereo System Components.
Introduction to Design (and Zen) CpSc 372: Introduction to Software Engineering Jason O. Hallstrom Authorship Disclaimer. These.
Chapter 10, Slide 1 ABSTRACT DATA TYPES Based on the fundamental concept of ABSTRACTION:  process abstraction  data abstraction Both provide:  information.
September 2002 HND Year 2 Database Management Systems Sept 2002.
N. HARIKA Lecturer(csc). 3 General Structure Of A Java Program.
1 Chapter 11 © 1998 by Addison Wesley Longman, Inc The Concept of Abstraction - The concept of abstraction is fundamental in programming - Nearly.
(1) ICS 313: Programming Language Theory Chapter 11: Abstract Data Types (Data Abstraction)
1 Copyright © 1998 by Addison Wesley Longman, Inc. Chapter 10 Abstraction - The concept of abstraction is fundamental in programming - Nearly all programming.
Copyright (c) 2014 Pearson Education, Inc. Introduction to DBMS.
Lesson 1 1 LESSON 1 l Background information l Introduction to Java Introduction and a Taste of Java.
1-1 1 Introduction  Programming linguistics: concepts and paradigms syntax, semantics, and pragmatics language processors.  Historical development of.
Object-Oriented Systems. Goals Object-Oriented Methodologies – The Rumbaugh et al. OMT – The Booch methodology – Jacobson's methodologies.
CSIS 4850: CS Senior Project – Spring 2009 CSIS 4850: Senior Project Spring 2009 Object-Oriented Design.
From Use Cases to Implementation 1. Structural and Behavioral Aspects of Collaborations  Two aspects of Collaborations Structural – specifies the static.
MANAGING COMPLEXITY Lecture OO01 Introduction to Object-oriented Analysis and Design Abstract Data Types.
Basic Characteristics of Object-Oriented Systems
Advanced Databases COMP3017 Dr Nicholas Gibbins
Welcome to OBJECT ORIENTED PROGRAMMING Prepared By Prepared By : VINAY ALEXANDER PGT(CS) KV jhagrakhand.
SOFTWARE DESIGN & SOFTWARE ENGINEERING Software design is a process in which data, program structure, interface and their details are represented by well.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
From Use Cases to Implementation 1. Mapping Requirements Directly to Design and Code  For many, if not most, of our requirements it is relatively easy.
Chapter 11: Abstract Data Types Lecture # 17. Chapter 11 Topics The Concept of Abstraction Advantages of Abstract Data Types Design Issues for Abstract.
Structures and Classes
What Do Computers Do? A computer system is
CompSci 280 S Introduction to Software Development
Programming paradigms
ABSTRACT DATA TYPES Based on the fundamental concept of ABSTRACTION:
11.1 The Concept of Abstraction
Developing Applications
Abstract Data Types and Encapsulation Concepts
Database Design Hacettepe University
Overview of Programming Paradigms
Object-Oriented Programming
Programming Languages and Paradigms
11.1 The Concept of Abstraction
Chapter 11 Abstraction - The concept of abstraction is fundamental in
Presentation transcript:

The Object Model Nazim H. Madhavji UWO 1(c) N.H. Madhavji, 14 August, 2014

Key sources of material Chapter 2, OO Analysis and Design with Applications, 3 rd Ed., Grady Booch, et al., Addison Wesley, Personal thoughts. 2(c) N.H. Madhavji, 14 August, 2014

Key topics covered The Evolution of the Object Model Foundations of the Object Model Elements of the Object Model (c) N.H. Madhavji, 14 August, 20143

The Evolution of the Object Model Please read the text book for complementary details; here we shall cover: Algorithmic/Structured languages vs. OO languages 4(c) N.H. Madhavji, 14 August, 2014

Algorithmic/Structured languages vs. OO languages Algorithmic languages were so called because “algorithms” (actions, instructions, etc.) were the primary basis underlying the design and code of programs in these languages. OO languages have “objects” and “classes” of objects as the primary basis. 5(c) N.H. Madhavji, 14 August, 2014

Algorithmic/Structured languages Programs in algorithmic (a.k.a “structured”) languages (such as Algol 60, Pascal, etc.) were basically tree-structured. Relatively small(er) programs (“programming-in-the-small”). Independent development of parts of the same program manually managed. PROGRAM X (I/O parameters); BEGIN END. 6(c) N.H. Madhavji, 14 August, 2014

Modular languages More sophisticated (a.k.a “modular”) languages (such as Modula, Modula-2, Ada, C) facilitated development of a large “system” as a set of “modules”. This suited “programming-in-the-large” – for development by teams. Say, programmer 1 develops module M1, and programmer 2 develops module M2, etc. Modules could be developed independently and concurrently. – Separately compiled – Loaded (integrated) to form a whole system 7(c) N.H. Madhavji, 14 August, 2014

Modular languages A module had two parts: interface part and implementation part. The implementation part was hidden from the users of a given module; they could only read/use the interface part. The modules M1 and M2, etc., interacted with each other through their interfaces. A module interface had “exports” and “imports”. Exported items from module M1 need to be declared in the interface part of M1. – Data structures exported showed their internal structure in the interface part. – Procedures/functions exported showed the parameters so that the user of module M1 can make proper calls. 8(c) N.H. Madhavji, 14 August, 2014

Modular languages Items imported in module M1 (from module M2, etc.) need to be specified in the interface part of module M1 and must be exported from the exporting module’s interface (M2, etc.). Each module was essentially like a tree- structured Pascal program. 9(c) N.H. Madhavji, 14 August, 2014

Interface and Implementation Modules INTERFACE MODULE M1. EXPORT A, B, X; FROM M2 IMPORT P, Q; (*P and Q need to be made visible through the interface of Module M2 *) <visible declarations: A: int; B: real; PROCEDURE X (....); END M1. IMPLEMENTATION MODULE M1. ; Procedure X (....); BEGIN.... END; (*hidden from the user*) BEGIN.... END M1. 10(c) N.H. Madhavji, 14 August, 2014

Modular languages and scaling up While modular languages enabled programmers to do independent development (of large-scale systems) and collaborate through module interaction, the increasing domain complexity was still a challenge. – Modules could not be nested so scaling up to very large- scale development was a problem. – Fundamentally, viewing a real-world problem in an algorithmic way was getting more and more difficult as system complexity increased. – There was a need to represent the application domain more directly in the system design in order to handle system complexity. 11(c) N.H. Madhavji, 14 August, 2014

From Modular to OO languages Object-oriented languages (e.g., Java, C++) turned this around (to the extent it has been able to) by structuring systems based on classes (as representation of real-world things) and objects as instances of classes. See OO history (Chapter 2) – Algorithms are encapsulated in classes as “operations” (a.k.a methods) on the objects. – Objects in different classes interact with each other through calls (messages) from methods in one class to methods in other classes. – Specialisation (reuse) of a parent class is done through inheritance; this did not exist in modular/structured languages. 12(c) N.H. Madhavji, 14 August, 2014

From Modular to OO languages The OO paradigm builds upon the structured paradigm, does not abandon it. – The basic elements of structured languages are all there: declarations, procedures and functions, calls, execution statements, assignment, etc. – However, be warned that different OO language designers have tended to call the same thing differently in different OO languages (Smalltalk, C++, Eiffel, Object Pascal, CLU, Java, etc.). – As programmers in OO languages, you need to know the different terminology used by different OO languages. (For an overview of various OO languages see Appendix A of the book by Booch et al, 3 rd. Ed.). (c) N.H. Madhavji, 14 August,

Small to moderate-sized OO programs (c) N.H. Madhavji, 14 August,

Large-sized OO systems (c) N.H. Madhavji, 14 August, Note encapsulation of Small objects (classes) into large objects (packages). Enables scaling up to designing and developing large Systems.

Foundations of the Object Model For a historical exposé on the various influencing and concurrent factors in the development of OO languages and paradigm, see Section 2.2 (Foundations of the Object Model), pg in Booch et al., 3 rd ed. We will focus on the meanings of: OO Programming (OOP), OO Design (OOD) and OO Analysis (OOA) (c) N.H. Madhavji, 14 August,

OOP -- Object-oriented programming OOP is a way of writing programs organized as cooperative collections of objects, each of which represents an instance of some class, and whose classes are all members of a hierarchy of classes united via inheritance relationships. – Object-oriented programming uses objects, not algorithms, as its fundamental logical building blocks (”part of’ hierarchy ). – Each object is an instance of some class. – Classes may be related to one another via inheritance relationships (the “is a” hierarchy). A language that supports the above three elements is an OO language. (c) N.H. Madhavji, 14 August,

OOD -- Object-oriented design While OOP emphasises proper and effective use of particular OO *language* mechanisms, OOD emphasises proper and effective *structuring* of a complex system. In this course (cs3307) we are concerned with this latter, design issue. OOD is a method of design encompassing the process of object-oriented decomposition and a notation for depicting both logical and physical as well as static and dynamic models of the system under design. (c) N.H. Madhavji, 14 August,

OOD -- Object-oriented design The difference between OOD and structured design is that OOD uses class and object abstractions to logically structure systems; whereas, structured design uses algorithmic abstractions. (c) N.H. Madhavji, 14 August,

OOA -- Object-oriented analysis OOA is a method of analysis that examines requirements from the perspective of the classes and objects found in the vocabulary of the problem domain. Helps identify what should be part of the system and what should not be included, and what interactions system should have with things outside the system. This is also called “boundary analysis”. (c) N.H. Madhavji, 14 August,

OO Programming (OOP), OO Design (OOD) and OO Analysis (OOA) (c) N.H. Madhavji, 14 August, Requirements Engineering Software Design Programming OOAOOD OOP These three notions are all important and complementary in software/systems engineering. OOA produces models used to start OOD the models of which can then be used to implement a system using OOP.

Elements of the Object Model There are four fundamental elements of this model: – Abstraction – Encapsulation – Modularity – Hierarchy Without any of these four elements, it is unthinkable to be able to build large OO systems. (c) N.H. Madhavji, 14 August,

Elements of the Object Model Three relatively minor elements of this model are: – Typing – Concurrency – Persistence These elements are useful but not essential in all the systems at the design level. (c) N.H. Madhavji, 14 August,

Abstraction An abstraction focuses on the outside view of an object and so serves to separate an object’s essential behavior from its implementation. (c) N.H. Madhavji, 14 August,

Encapsulation Abstraction and encapsulation are complementary: – Abstraction focuses on the observable behavior of an object – Encapsulation focuses on the implementation that gives rise to this behavior (c) N.H. Madhavji, 14 August,

Encapsulation The abstraction of an object should precede the decisions about its implementation. Once an implementation is selected, it should be treated as a secret of the abstraction and hidden from most clients. (c) N.H. Madhavji, 14 August,

Encapsulation Encapsulation is achieved through information hiding (not just data hiding): – hides all the secrets of an object that do not necessary for the clients to know: structure of an object is hidden, Implementation of its methods. No part of a complex system should depend on the internal details of any other part”. (c) N.H. Madhavji, 14 August,

Modularity Modularity is the property of a system that has been decomposed into a set of cohesive and loosely coupled modules. – High cohesion within a module. – Low coupling across modules. Modularity and encapsulation go hand in hand. (c) N.H. Madhavji, 14 August,

Hierarchy Abstraction, encapsulation and modularity are all useful for dealing with complexity; yet they are not adequate. In complex systems, we end up making a set of abstractions, e.g.: – Person  (Male doctor | Female doctor) – Male doctor  Male & (GP |specialist) (c) N.H. Madhavji, 14 August,

Hierarchy A set of abstractions often forms a hierarchy Identifying these hierarchies in our design can help deal with problem complexity. Hierarchy is thus a ranking or ordering of abstractions. (c) N.H. Madhavji, 14 August,

Hierarchy Two important hierarchies to note: – class structure (the “is a” hierarchy) – object structure (the “part of’ hierarchy). Single inheritance and Multiple inheritance – “is a” relationship among classes in the hierarchy (c) N.H. Madhavji, 14 August,

Typing – Type is a precise characterization of structural or behavioral properties which a collection of entities all share. E.g.: the Integer type (1,2,3....) – Typing is used to enforce constraints on operations. Objects of different types may not be interchanged, or interchanged in very restricted ways. – E.g.: operations on variables of mixed types in an expression – NHM: Data types are important (of course) but they tend to be at the programming (a.o.t. Design) level. (c) N.H. Madhavji, 14 August,

Concurrency An automated system may have to handle many different events simultaneously. Other problems may involve computation that exceeds the capacity of any single processor. May need to: – distribute the solution across a set of computers. – Or do multitasking (time-sharing) on a signle computer. May need to model this at design time. (c) N.H. Madhavji, 14 August,

Persistence An object takes up space and time during its life. Persistence encompasses the following: – Transient results in expression evaluation – Local variables in procedure activations – Global variables that outlive a procedure’s life – Data that exists between executions of a program – Data that exists between various versions of a program – Data that outlives the program Important to think of these issues in system design. (c) N.H. Madhavji, 14 August,

Summary OOA, OOD and OOP address the issues of programming-in-the-large. There are several different programming paradigms: procedure-oriented, object-oriented, logic-oriented, rule-oriented, and constraint- oriented. Key OO system design properties: – Abstraction; Encapsulation; Modularity; Hierarchy Other properties include: Typing, Concurrency and Persistence. (c) N.H. Madhavji, 14 August,