OBJECT AND CLASES: THE BASIC CONCEPTS Pertemuan 8 Matakuliah: Konsep object-oriented Tahun: 2009.

Slides:



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

Chapter 22 Object-Oriented Systems Analysis and Design and UML Systems Analysis and Design Kendall and Kendall Fifth Edition.
Solutions to Review Questions. 4.1 Define object, class and instance. The UML Glossary gives these definitions: Object: an instance of a class. Class:
UML Class Diagram. UML Class Diagrams2 Agenda What is a Class Diagram? Essential Elements of a UML Class Diagram Tips.
2-1 © Prentice Hall, 2007 Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph.
L3-1-S1 OO Concepts © M.E. Fayad SJSU -- CMPE Software System Engineering Dr. M.E. Fayad, Professor Computer Engineering Department, Room.
UML – Class Diagrams.
Object-Oriented Databases v OO systems associated with – graphical user interface (GUI) – powerful modeling techniques – advanced data management capabilities.
Object Oriented System Development with VB .NET
Slide 1 Systems Analysis & Design CS183 Spring Semester 2008 Dr. Jonathan Y. Clark Course Website:
Basic OOP Concepts and Terms
7M701 1 Class Diagram advanced concepts. 7M701 2 Characteristics of Object Oriented Design (OOD) objectData and operations (functions) are combined 
Class Diagram & Object Diagram
Lecturer: Dr. AJ Bieszczad Chapter 66-1 Object-Oriented analysis and design Special nature of OO development Use cases Design with UML OO system design.
Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 1 Object-Oriented Analysis and Design - CDT309 Period 4, Spring 2008 Object-oriented concepts.
7M822 UML Class Diagrams advanced concepts 15 September 2008.
7M822 UML Class Diagrams advanced concepts 14 October 2010.
Modelling classes Drawing a Class Diagram. Class diagram First pick the classes –Choose relevant nouns, which have attributes and operations. Find the.
2-1 © Prentice Hall, 2004 Chapter 2: Introduction to Object Orientation (Adapted) Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra,
1 Object-Oriented Modeling Using UML CS 3331 Fall 2009.
BACS 287 Basics of Object-Oriented Programming 1.
CSM-Java Programming-I Spring,2005 Introduction to Objects and Classes Lesson - 1.
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 2: Modelling.
Lawrence ChungCS6359.0T1: Module 41 Module 4: Relationships.
Systems Analysis and Design in a Changing World, Fifth Edition
OBJECT-ORIENTEDNESS KCDCC. WHAT IS OBJECT-ORIENTEDNESS? KCDCC model system as a collection of interacting objects O-O Modelling O-O Programming similar.
1 A Student Guide to Object- Orientated Systems Chapter 4 Objects and Classes: the basic concepts.
OBJECT ORIENTED PROGRAMMING CONCEPTS ISC 560. Object-oriented Concepts  Objects – things names with nouns  Classes – classifications (groups) of similar.
1 CS 456 Software Engineering. 2 Contents 3 Chapter 1: Introduction.
Unified Modeling Language, Version 2.0
UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
Systems Analysis and Design in a Changing World, 6th Edition 1 Chapter 4 - Domain Classes.
Slide 1 Structural Modeling Chapter 7. Slide 2 Key Ideas A structural or conceptual model describes the structure of the data that supports the business.
Systems Analysis and Design in a Changing World, 6th Edition 1 Chapter 4 Domain Classes.
CS3773 Software Engineering Lecture 04 UML Class Diagram.
CHAPTER 13: OBJECT-ORIENTED DATA MODELING (OVERVIEW) © 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 Modern Database Management 11 th Edition.
Object-Oriented Design Simple Program Design Third Edition A Step-by-Step Approach 11.
The Static Analysis Model Class Diagrams Prof. Hany H. Ammar, CSEE, WVU, and Dept. of Computer Science, Faculty of Computers and Information, Cairo University.
OBJECT-ORIENTED PROGRAMMING (OOP) WITH C++ Instructor: Dr. Hany H. Ammar Dept. of Electrical and Computer Engineering, WVU.
Basic OOP Concepts and Terms. In this class, we will cover: Objects and examples of different object types Classes and how they relate to objects Object.
5 Systems Analysis and Design in a Changing World, Fifth Edition.
BCS 2143 Object Oriented Design Using UML. Objectives Objects Interactions Finding Classes Relationship Between Classes Attribute and Operation Class.
ITEC 3220A Using and Designing Database Systems Instructor: Prof Z. Yang Course Website: 3220a.htm
Object Oriented Analysis: Associations. 2 Object Oriented Modeling BUAD/American University Class Relationships u Classes have relationships between each.
ITEC 3220A Using and Designing Database Systems Instructor: Gordon Turpin Course Website: Office: CSEB3020.
Class Modeling Design Class diagram. Classes The term “class ” refers to a group of objects that share a common attributes and common behaviour (operations).
 Week08.  Review Schedule Weeks 8-14  This week o Review last class o Introduce Class Diagrams o ICE-03 Sheridan SYST Engineering Quality Systems.
Basic Concepts of Object Orientation Object-Oriented Analysis CIM2566 Bavy LI.
Database Design – Lecture 12 Object Oriented Database Design cont’d.
Chapter 12 Object-oriented design for more than one class.
CS212: Object Oriented Analysis and Design Lecture 33: Class and Sequence Diagram.
Chapter 4 Basic Object-Oriented Concepts. Chapter 4 Objectives Class vs. Object Attributes of a class Object relationships Class Methods (Operations)
Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey A.
Object Modeling THETOPPERSWAY.COM. Object Modelling Technique(OMT)  Building a model of an application domain and then adding implementation.
OOPS CONCEPT.  OOPS  Benefits of OOPs  OOPs Principles  Class  Object Objectives.
Basic Characteristics of Object-Oriented Systems
Software Modelling Class Diagram. Class Diagrams The main building block in object oriented modeling They are used both for general conceptual modeling.
Slide 1 Unified Modeling Language, Version 2.0 Object-Oriented SAD.
2-1 © Prentice Hall, 2004 Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph.
 Class and Diagram  Representation of Class Name Attributes Operations  Visibility of Attributes and Operations.
UML Diagrams: Class Diagrams The Static Analysis Model
Object-Oriented Modeling
Business System Development
Object Oriented Concepts -I
Object Oriented Analysis and Design
Software Engineering Lecture #11.
Software Engineering Lecture 10.
ITEC 3220A Using and Designing Database Systems
Basic OOP Concepts and Terms
Presentation transcript:

OBJECT AND CLASES: THE BASIC CONCEPTS Pertemuan 8 Matakuliah: Konsep object-oriented Tahun: 2009

A Student Guide to Object- Orientated Systems Chapter 4 Objects and Classes: the basic concepts 3

Objects and Classes – the basic concepts Use cases model the user’s view of the functionality of a system. Each use case represents a task or major chunk of functionality Object orientated software structure based on objects Objects must deliver all the system functionality 4

What is an object? The most important concept in object-orientated development A representation of something in the application domain about which we need to store data to enable the system to provide the required functionality. 5

What is an object? 6 aBike :Bike type = men’s dailyHireRate = £8 deposit = £50 Object name – two optional parts, both underlined aBike = this specific object’s name Bike = the class the object belongs to The object’s attribute values Attributes are data items defined as part of an object or class. type is an attribute men’s is the value of the ‘type’ attribute for this object 2 sections, top is the object’s name, bottom is the object’s attribute values

More about objects Every object belongs to a class Objects in an O-O system can represent –physical things (customers, products, members, and books), –conceptual things (orders, loans, reservations and cancellations) –organizational things (companies or departments). –computer implementation features (GUI windows, files or linked lists) 7

More about objects Every object in a system has three characteristics – Behaviour, real world objects have certain attributes and behaviour – State, object behaviour may vary depending on its state – Identity, each object has a unique identity and existence 8

Object characteristics – behaviour Real world objects Car has data and characteristic behaviour. Data – amount of fuel, engine temperature, speed. Behaviour – stop, start, move. Object orientated objects In OO data becomes attributes Behaviour becomes operations (procedures) Data and behaviour are packaged together 9

Object characteristics – state An object’s state is determined by the value of its attributes e.g. Bank a/c with no overdraft allowed Attribute determining state = balance 10 Value of balance attribute = £100 Behaviour – Withdrawal of £90 allowed Withdrawal of £150 denied Value of balance attribute = £300 Behaviour – Withdrawal of £90 allowed Withdrawal of £150 allowed

Object characteristics – identity Every object has an identity Every object is a unique Each object has a separate existence and ultimately a separate space in memory Objects whose attribute values are identical are totally distinct from one another. 11

Encapsulation Encapsulation - packaging related data and operations together Data hiding – making the internal details of an object inaccessible to another object Public interface – provides the services an object makes available to other objects. 12

Encapsulation 13 data Operations Data inside an object is surrounded by a protective ring of operations The data is protected by the operations that encapsulate it. Public interface – an object’s name, class and operations, the only parts of the object accessible to other objects.

Class An object is defined in terms of its class A class of objects is a group of objects with the same set of attributes, relationships and behaviour An object is an instance of a class Instantiation is creating a new object 14

Class 15 Bike bike# available type size make model dailyHireRate deposit getCharges (no.days) findBike (bike#) registerBike (bikeDetails) getBike# () Class name – starts with capital letter, if two words ‘CarPark’ Attributes – lower case, no spaces, each subsequent word starts with capital letter Operations – same notation as attributes

Relationships Three types of relationships »Association »Aggregation »Inheritance These are links between classes that are used for message passing A navigable path between objects 16

Association – a link between two classes indicating a relationship * Student 1..* Course 0..*1..* studies Association relationship between Student and Course classes The association can be named: a student studies a course. An association has two ends each attached to a class. The numbers and asterisk on the line indicate the multiplicity of the association.

Multiplicity – UML notation 18 MeaningExampleNotation an exact number exactly one exactly six 1 (or may be omitted) 6 manyzero or more one or more 0..* 1..* a specific range one to four, zero to six 1..4, 0..6, a choicetwo or four or five2, 4, 5 unspecifiedan arbitrary, unspecified number *

Aggregation – a whole-part relationship 19 Identified by - 'consists of', 'has a', or 'is a part of‘ Wheels, doors and engine are ‘part’ of a car

Composition – tighter aggregation the whole object has exclusive ownership of its parts i.e. the part object can only participate in one aggregation; the parts live and die with the whole 20

Inheritance and generalization 21 Inheritance – mechanism for defining a new class in terms of an existing class Generalization – moving common attributes and operations in to a more general class VisitorsCard cardNumber currentDate delete () StaffCard cardNumber name dept expiryDate delete ()

Inheritance and generalization 22 a specialized class inherits from a general class a subclass inherits from a superclass a child class inherits from a parent class a derived class inherits from a base class. Relationship described as ‘is-a’ ‘is–a-type-of’ ‘is–a–kind–of’

Abstract class – never instantiated 23 Card {abstract} cardNumber delete() Inheritance a relationship between classes Card objects will never be created (instantiated)

Polymorphism The term polymorphism means the ability for a single message to produce a different response depending on the class of the object to which it is sent. Polymorphism linked with an inheritance hierarchy allows a single message to be interpreted differently by different objects. Which method is executed will depend on which object receives the message. A single operation may be implemented by more than one method. 24