Abstraction Lecture-4. ADT example: London Underground Map.

Slides:



Advertisements
Similar presentations
Understand and appreciate Object Oriented Programming (OOP) Objects are self-contained modules or subroutines that contain data as well as the functions.
Advertisements

Object-Oriented Software Engineering Visual OO Analysis and Design
Chapter 14 Graph class design John Keyser’s Modifications of Slides by Bjarne Stroustrup
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12Slide 1 Software Design l Objectives To explain how a software design may be represented.
Informática II Prof. Dr. Gustavo Patiño MJ
Chapters 7 & 9 System Scope
Classes and Object- Oriented... tMyn1 Classes and Object-Oriented Programming The essence of object-oriented programming is that you write programs in.
OASIS Reference Model for Service Oriented Architecture 1.0
Lecturer: Sebastian Coope Ashton Building, Room G.18 COMP 201 web-page: Lecture.
Object-Oriented Databases v OO systems associated with – graphical user interface (GUI) – powerful modeling techniques – advanced data management capabilities.
Modified from Sommerville’s originalsSoftware Engineering, 7th edition. Chapter 8 Slide 1 System models.
1 Basic Object-Oriented Concepts  Object-Oriented Paradigm What is an Object?  What is a Class?  Constructing Objects from a class Problem Solving in.
© Copyright Eliyahu Brutman Programming Techniques Course.
1 Software Requirements Specification Lecture 14.
1 An introduction to design patterns Based on material produced by John Vlissides and Douglas C. Schmidt.
PRJ566: PROJECT PLANNING AND MANAGEMENT Class Diagrams.
Abstraction: Polymorphism, pt. 1 Abstracting Objects.
Object-Oriented Analysis and Design
UFCEUS-20-2 : Web Programming Lecture 5 : Object Oriented PHP (1)
Systems Analysis and Design in a Changing World, Fifth Edition
CS 350 – Software Design The Object Paradigm – Chapter 1 If you were tasked to write code to access a description of shapes that were stored in a database.
CS 360 Lecture 6.  A model is a simplification of reality  We build models to better understand the system being developed.  We build models of complex.
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
This chapter is extracted from Sommerville’s slides. Text book chapter
CS 4310: Software Engineering Lecture 4 System Modeling The Analysis Stage.
Systems Analysis and Design in a Changing World, 3rd Edition
 Three-Schema Architecture Three-Schema Architecture  Internal Level Internal Level  Conceptual Level Conceptual Level  External Level External Level.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 14 Slide 1 Object-oriented Design.
1 Class Diagrams: The Essentials. 2 Terms and Concepts A class is... The most important building block of any object-oriented system. A description of.
BTS430 Systems Analysis and Design using UML Domain Model—Part 2: Associations and Attributes.
SWEN 5130Requirements Engineering Algebraic Specification Slide 1 Algebraic Specification u Specifying abstract types in terms of relationships between.
Architecture View Models A model is a complete, simplified description of a system from a particular perspective or viewpoint. There is no single view.
More Design Patterns From: Shalloway & Trott, Design Patterns Explained, 2 nd ed.
Logic as Semiotic: The Theory of Signs Charles Sanders Pierce
OOP (Object Oriented Programming) Lecture 1. Why a new paradigm is needed? Complexity Five attributes of complex systems –Frequently, complexity takes.
1 Introduction to Classes. 2 Terms and Concepts A class is... –The most important building block of any object- oriented system. –A description of a set.
Winter 2011SEG Chapter 11 Chapter 1 (Part 1) Review from previous courses Subject 1: The Software Development Process.
SEG 4110 – Advanced Software Design and Reengineering Topic T Introduction to Refactoring.
Data Design and Implementation. Definitions Atomic or primitive type A data type whose elements are single, non-decomposable data items Composite type.
BTS430 Systems Analysis and Design using UML Domain Model—Part 2: Associations and Attributes.
Refactoring Agile Development Project. Lecture roadmap Refactoring Some issues to address when coding.
Computational Thinking
1 Using const in C++ Classes In the presence of pointers we must take steps to ensure the integrity of the object Can use const method definitions The.
Author: DoanNX Time: 45’.  OOP concepts  OOP in Java.
Chapter 6 Guidelines for Modelling. 1. The Modelling Process 1. Modelling as a Transformation Process 2. Basic Modelling Activities 3. Types of Modelling.
Object Oriented Paradigm OOP’s. Problems with Structured Programming As programs grow ever larger and more complex, even the structured programming approach.
CSC 205 Java Programming II Abstract Data Type. Abstraction The meaning of abstraction Abstraction arises from a recognition of similarities between certain.
Concepts of Object Orientation lecture 1 –b. Objectives: Concepts of Object Orientation OOAD 2  Explain the basic principles of object orientation 
Introduction to Object Oriented Programming Lecture-3.
Sadegh Aliakbary Sharif University of Technology Fall 2010.
WELCOME TO OUR PRESENTATION UNIFIED MODELING LANGUAGE (UML)
11 Systems Analysis and Design in a Changing World, Fifth Edition.
MAITRAYEE MUKERJI Object Oriented Programming in C++
 The Object Oriented concepts was evolved for solving complex problems. Object- oriented software development started in the 1980s. Object-oriented design.
Software Engineering Lecture 4 System Modeling The Analysis Stage.
Business System Development
Object-Oriented Analysis and Design
Concepts of Object Orientation
Chapter 5: Object Oriented Analysis and Design
Unified Modeling Language
Objectives State the reasons for the complexity involved in the development of software Define the following terms Objects Classes Messages Methods Explain.
Rumbaugh’s Objectmodeling Technique
INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING (OOP) & CONCEPTS
The Object Oriented Approach to Design
Chapter 10: Process Implementation with Executable Models
Chapter 4 Entity Relationship (ER) Modeling
Lecture 11 Abstract Data Type
Object-Oriented PHP (1)
Software Engineering Basics
Agenda Software development (SD) & Software development methodologies (SDM) Orthogonal views of the software OOSD Methodology Why an Object Orientation?
Presentation transcript:

Abstraction Lecture-4

ADT example: London Underground Map

The New LU Map

Abstraction In philosophical terminology abstraction is the thought process wherein ideas are distanced from objects. Abstraction uses a strategy of simplification of detail, wherein formerly concrete details are left ambiguous, vague, or undefined; thus speaking of things in the abstract demands that the listener have an intuitive or common experience with the speaker, if the speaker expects to be understood For example, many different things have the property of redness: lots of things are red

Abstract Art Abstract art is now generally understood to mean art that does not depict objects in the natural world, but instead uses shapes and colours in a non-representational or subjective way. Abstract art is defined as art that has no reference to any figurative reality. In its wider definition the term describes art that depicts real forms in a simplified or rather reduced way - keeping only an allusion of the original natural subject

Abstract Data Type O-O programming is often described as programming with abstract Data types But what is an Abstract Data type ?  A tangible or visible 'thing' e.g. a person  A conceptual thing e.g. the economy 'An object represents an individual identifiable item, unit or entity, either real or abstract, with a well defined role in the problem domain' 'An abstraction denotes the essential characteristics of an object that distinguishes it from all other kinds of objects and thus provides crisply defined conceptual boundaries, relative to the perspective of the viewer'

Handling Problems Designing Software for real life problems However real life problems are “too complex” So we must separate the necessary from the un- necessary This is known as abstraction Problem Model Abstraction

What Makes an Abstract Data Type (ADT)‏ ADT implies that the model focuses only on the problem defines properties of the problem The problem defines  Data which is affected  Operations on the data

ADT example: London Underground Map First map created in 1908 Faithful to the geography of the stations and London All distances relative and twist and turns of tracks reproduced Map fully to scale Purpose to show travellers the order of stations on each line, and various interchanges; the fidelity of the map made it difficult to extract information

ADT example: London Underground Map

The New LU Map In 1933 map was changed to a more abstract representation called the diagram Connectivity of stations preserved However passengers could see at a glance the route to the destination This is an abstraction from superfluous detail, in this case the physical layout of the lines was the key to the usefulness of the Diagram

The New LU Map

Why is the 'Diagram' a good abstraction Abstract, since it only records the logical layout not the physical reality in all it's detail Concise, it is printed on a single A5 Sheet Complete, Since every station on the London Underground network is represented Unambiguous, Since the meaning of the symbols are explained and the diagram is is expressed in simple geometric terms. Maintainable, with stations being removed and added. This is what we aim for when we are designing Object- Oriented code (and especially C++ classes) ‏

Modelling the Real World OO Links together data and operations performed on the data Any real world object can be described in terms of  what it is called (O-O term 'identity') ‏  what it is (O-O term 'state') ‏  what it does (O-O term 'behaviour') ‏ For Example a real world object such as a Coffee cup has :  identity (Coffee Cup) ‏  state (white, hot, full etc)  fixed behavior (manufactured, filled drunk, washed, broken) ‏

Encapsulation Using the Coffee cup example All the previous examples are encapsulated into the object 'Coffee cup' We cannot divorce any one from the other eg.  'full' is linked with the action of 'being filled'  as the 'cup cannot be full unless it has at some stage been filled' This link between data ('what it is') and operations ('what it does') ‏ This is the sort of real world example which we try to reflect in O-O software development.

How does this relate to Graphics programming? We can use the same abstraction techniques to derive identity, state and behaviour for any objects Try to decide upon identity, state and behaviour for the following A 3D point A Sphere A Colour

Information Hiding Encapsulation allows us to implement information hiding Encapsulation hides 'private' elements of an object behind a 'public' interface to give two aspects to the object  protection of the objects state from unforeseen external influences  hiding the implementation details used to define an object's behaviour Now an objects state cannot be altered except by fixed methods of behaviour

Information Hiding Now an objects state cannot be altered except by fixed methods of behaviour This makes life easier because  behaviour of an object is predictable and less prone to error  enhances re-usability and maintainability Now we need only know that an objects state changes and not how

Attributes and Methods To build abstract data types in a program we have to identify three things  The abstract 'thing' we are trying to represent  The data which represents the state of that 'thing'  The behavior of that 'thing' The 'thing' will be the name of the abstract data type but not the object itself but a class of objects. The class will define the common attributes and methods for all objects of the class

Attributes and Methods All Coffee Cups.. have common attributes.... I have a color I have a temperature and common methods.... drink me wash me

Attributes Now we know what we are going to represent we need to identify what elements go to make up its state These are called attributes (in O-O speak) ‏ But in programming these are know as variables or data structures These, however, do not specify a value just what it represents For the coffee cup example we would (for example) ‏  say it has a colour (but not what the colour is) ‏  as all coffee cups have a colour but not all coffee cups are the same colour

Methods The behavior of an object is defined by it's methods These process routines related to the data type However the access to this data is limited by using methods The two most common types of methods are :  Selector method (or get method) which retrieves the data from the object  Modifier method (or set method) which sets the data from the object

Methods This can be seen using the doughnut diagram Attributes Method1 Method4 Method3 Method2