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

Slides:



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

Systems Analysis and Design with UML Version 2.0, Second Edition
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.
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.
UML Class Diagram and Packages Written by Zvika Gutterman Adam Carmi.
Object Oriented System Development with VB .NET
Irwin/McGraw-Hill Copyright © 2004 The McGraw-Hill Companies. All Rights reserved Whitten Bentley DittmanSYSTEMS ANALYSIS AND DESIGN METHODS6th Edition.
Slide 1 Systems Analysis & Design CS183 Spring Semester 2008 Dr. Jonathan Y. Clark Course Website:
Slide 1 Chapter 7 Structural Modeling. Slide 2 Key Ideas A structural or conceptual model describes the structure of the data that supports the business.
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
Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 1 Object-Oriented Analysis and Design - CDT309 Period 4, Spring 2008 Object-oriented concepts.
Requirements Analysis 2 What objects collaborate to achieve the goal of a use case?
7M822 UML Class Diagrams advanced concepts 15 September 2008.
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,
PRJ566: PROJECT PLANNING AND MANAGEMENT Class Diagrams.
OO Analysis and Design CMPS OOA/OOD Cursory explanation of OOP emphasizes ▫ Syntax  classes, inheritance, message passing, virtual, static Most.
CSM-Java Programming-I Spring,2005 Introduction to Objects and Classes Lesson - 1.
Lawrence ChungCS6359.0T1: Module 41 Module 4: Relationships.
Systems Analysis and Design in a Changing World, Fifth Edition
OBJECT AND CLASES: THE BASIC CONCEPTS Pertemuan 8 Matakuliah: Konsep object-oriented Tahun: 2009.
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.
UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
An Introduction to Java Chapter 11 Object-Oriented Application Development: Part I.
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.
Databases : Data Modeling 2007, Fall Pusan National University Ki-Joune Li.
The Static Analysis Model Class Diagrams Prof. Hany H. Ammar, CSEE, WVU, and Dept. of Computer Science, Faculty of Computers and Information, Cairo University.
Modeling system requirements. Purpose of Models Models help an analyst clarify and refine a design. Models help simplify the complexity of information.
UML Class Diagram Trisha Cummings. What we will be covering What is a Class Diagram? Essential Elements of a UML Class Diagram UML Packages Logical Distribution.
Slide 1 Systems Analysis and Design with UML Version 2.0, Second Edition Alan Dennis, Barbara Haley Wixom, and David Tegarden Chapter 7: Structural Modeling.
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.
What is a Structural Model?
Lecture 1: UML Class Diagram September 12, UML Class Diagrams2 What is a Class Diagram? A class diagram describes the types of objects in the system.
Structural Modeling Chapter 7. Key Ideas A structural or conceptual model describes the structure of the data that supports the business processes in.
1 Structural Modeling Chapter 7. 2 Key Ideas A structural or conceptual model describes the structure of the data that supports the business processes.
ITEC 3220A Using and Designing Database Systems Instructor: Prof Z. Yang Course Website: 3220a.htm
Design Model Lecture p6 T120B pavasario sem.
Object Oriented Analysis: Associations. 2 Object Oriented Modeling BUAD/American University Class Relationships u Classes have relationships between each.
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.
Domain Classes – Part 1.  Analyze Requirements as per Use Case Model  Domain Model (Conceptual Class Diagram)  Interaction (Sequence) Diagrams  System.
Database Design – Lecture 12 Object Oriented Database Design cont’d.
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.
Slide 1 Systems Analysis and Design with UML Version 2.0, Second Edition Alan Dennis, Barbara Haley Wixom, and David Tegarden Chapter 7: Structural Modeling.
UML Diagrams: Class Diagrams The Static Analysis Model
Object-Oriented Modeling
Business System Development
Object Oriented Concepts -I
Object Oriented Analysis and Design
UML Class Diagram.
SYS466 Domain Classes – Part 1.
Understand and Use Object Oriented Methods
ITEC 3220A Using and Designing Database Systems
Basic OOP Concepts and Terms
Chapter 22 Object-Oriented Systems Analysis and Design and UML
Presentation transcript:

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

2 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

3 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.

4 What is an object? 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

5 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)

6 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

7 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

8 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 Value of balance attribute = £100 Behaviour – Withdrawal of £90 allowed Withdrawal of £150 denied Value of balance attribute = £300 Behaviour –

9 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.

Identification Of Objects  Many methodologists have their own favorite approaches  All techniques have short comings  fail to identify all objects  identifies false objects

Using The Things To Be Modeled Basic Steps Are: –Identify individual or group things, such as persons, roles, organizations, logs, reports, forms, etc. in the application domain –Identify the corresponding objects and classes Requires significant experience with OO to apply successfully

Using Nouns This assumes that written documents about the domain exist Steps are: –Obtain or author a narrative English text that represents an informal description of the problem to be solved. –Use the nouns, pronouns, and noun phrases to identify objects and classes –Verbs and predicate phrases are used to identify services

13 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. Encapsulation

14 Encapsulation 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.

15 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

16 Class 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

17 Relationships Three types of relationships Association Aggregation Generalization (Inheritance) Dependency These are links between classes that are used for message passing A navigable path between objects

18 Association – a link between two classes indicating a relationship 0..* 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.

19 Multiplicity – UML notation 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 *

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

21 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

22 Inheritance and generalization 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 ()

23 Inheritance and generalization 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’

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

25 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.

26