Basic Concepts Introduction to OO Development and Software Engineering Principles SYSC 3100 - System Analysis and Design.

Slides:



Advertisements
Similar presentations
Introduction to Object Orientation System Analysis and Design
Advertisements

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12Slide 1 Software Design l Objectives To explain how a software design may be represented.
1 OBJECT-ORIENTED CONCEPTS. 2 What is an object?  An object is a software entity that mirrors the real world in some way.  A software object in OOP.
Informática II Prof. Dr. Gustavo Patiño MJ
OBJECT ORIENTED PROGRAMMING M Taimoor Khan
Solutions to Review Questions. 4.1 Define object, class and instance. The UML Glossary gives these definitions: Object: an instance of a class. Class:
Classes and Object- Oriented... tMyn1 Classes and Object-Oriented Programming The essence of object-oriented programming is that you write programs in.
Introduction To System Analysis and Design
Review of OO Introduction to Eclipse/Java September 6, 2005.
7M701 1 Software Engineering Object-oriented Design Sommerville, Ian (2001) Software Engineering, 6 th edition: Chapter 12 )
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 2: Review of Object Orientation.
1 SWE Introduction to Software Engineering Lecture 23 – Architectural Design (Chapter 13)
Object Oriented System Development with VB .NET
7M701 1 Class Diagram advanced concepts. 7M701 2 Characteristics of Object Oriented Design (OOD) objectData and operations (functions) are combined 
©Ian Sommerville 2006Software Engineering, 7th edition. Chapter 14 Slide 1 Object-oriented Design.
Object-oriented Programming Concepts
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 1 Introduction to Object-Oriented Programming and Software Development.
03/12/2001 © Bennett, McRobb and Farmer What Is Object-Orientation? Based on Chapter 4 of Bennett, McRobb and Farmer: Object Oriented Systems Analysis.
Object-Oriented Analysis: some basic principles. Objects “Objects have state, behaviour and identity.” Booch (1994) State: the condition of an object.
Teamwork Know each other Compete Leadership Strengths and Weaknesses
1 INTRODUCTION TO OOP Objective: Know the difference between functional programming and OOP Know basic terminology in OOP Know the importance of OOP Know.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 2: Review of Object Orientation 1.
Introduction To System Analysis and design
With a focus on OO design techniques
11 1 Object oriented DB (not in book) Database Systems: Design, Implementation, & Management, 6 th Edition, Rob & Coronel Learning objectives: What.
Design Patterns OOD. Course topics Design Principles UML –Class Diagrams –Sequence Diagrams Design Patterns C#,.NET (all the course examples) Design Principles.
MT311 Java Application Development and Programming Languages Li Tak Sing( 李德成 )
1 CS 456 Software Engineering. 2 Contents 3 Chapter 1: Introduction.
1 WXGC6102: Object-Oriented Techniques What Is Object-Orientation? References: Chapter 4 of Bennett, McRobb and Farmer: Object Oriented Systems Analysis.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 20 Object-Oriented.
What Is Object-Orientation?
Introduction To System Analysis and Design
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
1 Object-Oriented Systems Development Bahrami © Irwin/ McGraw-Hill Chapter 2: Object Basics Object-Oriented Systems Development Using the Unified Modeling.
CSC480 Software Engineering Lecture 11 September 30, 2002.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 14 Slide 1 Object-oriented Design.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12Slide 1 Object-oriented Design Designing systems using self- contained objects and object.
1 Object-oriented Design Designing systems using self- contained objects and object classes.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12Slide 1 Object-oriented Design Designing systems using self- contained objects and object.
 To explain how a software design may be represented as a set of interacting objects that manage their own state and operations  To describe the activities.
Lecture 1: Introduction to Software Engineering WXGE6103 Software Engineering Process and Practice Object-oriented Design.
CS.436 Software Engineering By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 10 Object-oriented Design Slide 1 1 Chapter 10 Object-oriented Design.
1/26 On-demand Learning Series Software Engineering of Web Application - Object-Oriented Development & UML Hunan University, Software School.
Object-oriented Design Designing systems using self-contained objects and object classes Designing systems using self-contained objects and object classes.
Chap 10. Object-oriented Design - Designing systems using self-contained objects and object classes -
14. Object-Oriented Design Software Engineering. Objectives To explain how a software design may be represented as a set of interacting objects that manage.
ITEC 3220A Using and Designing Database Systems Instructor: Gordon Turpin Course Website: Office: CSEB3020.
Learners Support Publications Object Oriented Programming.
12/2/2015 1www.prsolutions08.blogspot.com Object-oriented Design.
OBJECT ORIENTED AND FUNCTION ORIENTED DESIGN 1 Chapter 6.
Dr D. Greer, Queens University Belfast )Chapter Six 1 Software Engineering Chapter Six Software Design Quality Learning Outcomes.
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
Object-oriented Design. Recap The software architect is responsible for deriving a structural system model, a control model and a sub-system decomposition.
CMSC 345 Fall 2000 OO Design. Characteristics of OOD Objects are abstractions of real-world or system entities and manage themselves Objects are independent.
Lecture 2: Review of Object Orientation. © Lethbridge/La ganière 2005 Chapter 2: Review of Object Orientation What is Object Orientation? Procedural.
Lesson 1 1 LESSON 1 l Background information l Introduction to Java Introduction and a Taste of Java.
Slide 1 Chapter 10 Object-oriented Design. Slide 2 Characteristics of OOD l Objects are abstractions of real-world or system entities and manage themselves.
OOPS CONCEPT.  OOPS  Benefits of OOPs  OOPs Principles  Class  Object Objectives.
Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall Appendix A Object-Oriented Analysis and Design A.1.
Object-oriented Design 3/3/20161ICS 413 – Software Engineering.
CHAPTER 6: OBJECT-ORIENTED DESIGN. Objectives  To explain how a software design may be represented as a set of interacting objects that manage their.
Polymorphism and Inheritance (CS-319 Supplementary Notes)
Basic Characteristics of Object-Oriented Systems
CSCE 240 – Intro to Software Engineering Lecture 3.
Sachin Malhotra Saurabh Choudhary
Systems Analysis and Design With UML 2
Programming in Java Sachin Malhotra, Chairperson, PGDM-IT, IMS Ghaziabad Saurabh Chaudhary, Dean, Academics, IMS Ghaziabad.
Chapter 20 Object-Oriented Analysis and Design
What Is Object-Orientation?
Presentation transcript:

Basic Concepts Introduction to OO Development and Software Engineering Principles SYSC System Analysis and Design

Everything is an Object! You, me, your neighbour, desks, chairs, doors, etc. Some of these things are the same, and some of them are different. Some of them are “active”, and others are “passive”.

Objectives Define objects, attributes and operations. Differentiate between OOA, OOD and OOP (!) Describe a Class and an object. Define information hiding and encapsulation. Define generalization and specialization and the isA rule. Define polymorphism and over-riding. Describe active objects and persistence.

Object-Oriented Development (OOD) Objects are abstractions of real-world or system entities and manage themselves Objects are independent and encapsulate state and representation information (attributes). System functionality is expressed in terms of object services (operations) Shared data areas are eliminated. Objects communicate by message passing Objects may be distributed and may execute sequentially or in parallel

Objects, Attributes, Operations

O-O World View An object-oriented system is regarded as a network of cooperating objects which -interact by sending each other messages -maintain their own state -have an individual identity

Advantages of OOD Easier maintenance. Classes may be understood as stand-alone entities, including their own functionality and data Classes are appropriate reusable components For some systems, there may be an obvious mapping from real world entities to system classes, e.g., accounts in banking system

Object-oriented development Object-oriented analysis (OOA), design (OOD) and programming (OOP) are related but distinct OOA is concerned with developing an object model of the application domain OOD is concerned with developing an object- oriented system model (structure, behaviour) to implement requirements OOP is concerned with realising an OOD using an OO programming language such as Java or C++

Principal Concepts –Objects, classification –encapsulation and information hiding –modularity –generalization and inheritance –typing –polymorphism –dynamic binding –concurrency –persistence

Classes and Objects Object – A chunk of structured data in a running software system – Has properties Represent its state – Has behaviour How it acts and reacts May simulate the behaviour of an object in the real world – Has an identity: each object is unique

High-level Examples Class Person. ‘Hussain Pervez.’ Speak, walk, read. Studying, resting, qualified. Shirt. My favourite button white denim shirt. Shrink, stain, rip. Pressed, dirty, worn. Sale. Sale no #0015, 16/06/02. Earn loyalty points.Invoiced, cancelled. IdentityBehaviourState Bottle of ketchup. This bottle of ketchup. Spill in transit.Unsold, opened, empty.

Objects Margaret: date of birth: 1980/03/03 position: Teller Transaction 487: amount: time: 2001/09/01 14:30 Greg: date of birth: 1970/01/01 address: 75 Object Dr. Mortgage Account 29865: balance: opened: 2000/08/12 property: 75 Object Dr. Instant Teller 876: location: Java Valley Cafe Savings Account 12876: balance: opened: 1997/03/03 Jane: date of birth: 1955/02/02 position: Manager address: 99 UML St. address: 150 C++ Rd.

Classes A class: – Is a unit of abstraction in an object oriented analysis, design, or program – Represent instances of real-world and system entities – Represents similar objects Its instances – Is a kind of software module Describes its instances’ structure (properties) Contains operations/methods to implement their behaviour

Classes and Objects: Example

Encapsulation and Information Hiding Encapsulation: The technique of hiding details which are not needed by the user of an abstraction Applied in object-oriented systems by the separation of object interfaces and bodies A_STACK PUSH POP interface body client’s view

Message-passing and Encapsulation Message from another object requests a service. Operation called only via valid operation signature. Data accessed only by object’s own operations. An object’s data is hidden (encapsulated). ‘Layers of an onion’ model of an object: An outer layer of operation signatures… …gives access to middle layer of operations… …which can access inner core of data

Object-Oriented Computation Model draw-line clear Attributes #3 #4 remove insert Attributes #4 #2 remove insert Attributes #2 #3 update draw Attributes #1 #1 print control flowdata flow system operation

Organizing Classes into Inheritance Hierarchies Superclasses – Contain features common to a set of subclasses Inheritance hierarchies – Show the relationships among superclasses and subclasses Inheritance – The implicit possession by all subclasses of features defined in its superclasses

An Example Inheritance Hierarchy Inheritance – The implicit possession by all subclasses of features defined in its superclasses

Generalization and Specialization Classification is hierarchic in nature Generalization: the technique of factoring out common properties into shared classes – facilitates reuse and change control – the reverse operation is the specialization For example, a person may be an employee, a customer, a supplier of a service An employee may be paid monthly, weekly or hourly An hourly paid employee may be a driver, a cleaner, a sales assistant

Specialization Hierarchy Person EmployeeCustomer Supplier monthly paidweekly paidhourly paid DriverCleaner Sales assistant More general (superclasses) More specialized (subclasses)

The Isa Rule Always check generalizations to ensure they obey the “isa” rule – “A checking account is an account” – “A village is a municipality” Should ‘Province’ be a subclass of ‘Country’? – No, it violates the isa rule “A province is a country” is invalid!

Inheritance hierarchy of mathematical objects

Make Sure all Inherited Features Make Sense in Subclasses

Methods, Operations and Polymorphism Operation – A higher-level procedural abstraction that specifies a type of behaviour – Independent of any code which implements that behaviour E.g., calculating area (in general) – Operations are defined during Analysis and Design – They are implemented with methods

Methods, Operations and Polymorphism Method – A procedural abstraction used to implement the behaviour of a class. – Several different classes can have methods with the same name They implement the same abstract operation in ways suitable to each class E.g, calculating area in a rectangle is done differently from in a circle

Polymorphism A property of object oriented software by which an abstract operation may be performed in different ways in different classes. – Requires that there be multiple methods of the same name – The choice of which one to execute depends on the object (i.e., type) that is in a variable, on which the method is executed – Reduces the need for programmers to code many if-else or switch statements

Overriding A method would be inherited, but a subclass contains a new version instead – For restriction E.g. scale(x,y) would not work in Circle – For extension E.g. SavingsAccount might charge an extra fee following every debit – For optimization E.g. The getPerimeterLength method in Circle is much simpler than the one in Ellipse

How a decision is made about which method to run 1.If there is a concrete method for the operation in the current class, run that method. 2.Otherwise, check in the immediate superclass to see if there is a method there; if so, run it. 3.Repeat step 2, looking in successively higher superclasses until a concrete method is found and run. 4.If no method is found, then there is an error – In Java and C++ the program would not have compiled

Dynamic binding Occurs when decision about which method to run can only be made at run time – Needed when: A variable is declared to have a superclass as its type, and There is more than one possible polymorphic method that could be run among the type of the variable and its subclasses

Abstract Classes and Methods An operation should be declared to exist at the highest class in the hierarchy where it makes sense – The operation may be abstract (lacking implementation) at that level – If so, the class also must be abstract No instances can be created The opposite of an abstract class is a concrete class – If a superclass has an abstract operation then its subclasses at some level must have a concrete method for the operation Leaf classes must have or inherit concrete methods for all operations Leaf classes must be concrete

Concurrency The nature of objects as self-contained entities make them suitable for concurrent implementation. There are two forms of objects in concurrent systems. Passive: – operations execute only in response to external stimuli – call other objects only in response to external stimuli Active – operations may execute asynchronously – has an independent thread of control – call other objects “spontaneously” – change state “spontaneously”

Active transponder object Active objects may have their attributes modified by operations but may also update them autonomously using internal operations Transponder object broadcasts an aircraft’s position. The position may be updated using a satellite positioning system. The object periodically update the position by triangulation from satellites

An active transponder object

Persistence The ability of an object to exist after the termination of the program which created it Allows data storage in terms of objects (e.g. files are objects) Provides a model for interaction with a DBMS or FMS E.g., Java serialization, Object-oriented DBMS OO program Database

Summary An object is some “thing” which has attributes (variables) and operations that they can perform A class is the blueprint or template that describes objects that have similar characteristics. Big idea: hide implementation of objects to make it easy to change without affecting the world. Polymorphism allows different types to implement common operations differently. “Active objects” operate spontaneously and independently of each other (like us!).