Object Classes In UML. Object Concepts What is an object? How do objects communicate? How is an object’s interface defined? What have objects to do with.

Slides:



Advertisements
Similar presentations
Object-Oriented Programming Basics Prof. Ankur Teredesai, Computer Science Department, RIT.
Advertisements

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12Slide 1 Software Design l Objectives To explain how a software design may be represented.
Computer Science Dept. Fall 2003 Object models Object models describe the system in terms of object classes An object class is an abstraction over a set.
Stereotypes Stereotypes provide the capability to create a new kind of modeling element. –They can be used to classify or mark modeling elements. –A type.
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall A.1.
Lecturer: Sebastian Coope Ashton Building, Room G.18 COMP 201 web-page: Lecture.
2-1 © Prentice Hall, 2007 Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph.
Introduction To System Analysis and Design
Object Oriented Design Concepts of OOD Introduction to UML Lectures 19.
Essentials of interaction diagrams Lecture Outline Collaborations Interaction on collaboration diagrams Sequence diagrams Messages from an object.
Copyright 2004 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Second Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Appendix.
Modelling classes Drawing a Class Diagram. Class diagram First pick the classes –Choose relevant nouns, which have attributes and operations. Find the.
PRJ566: PROJECT PLANNING AND MANAGEMENT Class Diagrams.
State,identity and behavior of objects Sem III K.I.R.A.S.
The Unified Modeling Language (UML) Class Diagrams.
Object-Oriented Analysis and Design
Introduction To System Analysis and design
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.
Module 7: Object-Oriented Programming in Visual Basic .NET
OBJECT ORIENTED PROGRAMMING CONCEPTS ISC 560. Object-oriented Concepts  Objects – things names with nouns  Classes – classifications (groups) of similar.
Copyright 2001 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Appendix A Object-Oriented.
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.
Introduction To System Analysis and Design
Object-Oriented Analysis and Design An Introduction.
Programming in Java Unit 3. Learning outcome:  LO2:Be able to design Java solutions  LO3:Be able to implement Java solutions Assessment criteria: 
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 15: Object-Oriented Data Modeling Modern Database Management 9 h Edition Jeffrey A.
Systems Analysis and Design 8 th Edition Chapter 6 Object Modeling.
Centre for Computer Technology ICT214 Object Oriented Design and Programming Week 02 – Classes, Objects, Instances Richard Salomon and Umesh Patel Centre.
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.
Lecture 6: Structural Modeling
CIS224 Software Projects: Software Engineering and Research Methods Lecture 1b Object concepts (Based on Stevens and Pooley (2006), Chapter 2) David Meredith.
Designing Classes Prelude © 2015 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Data Structures and Abstractions with Java, 4e Frank.
Week III  Recap from Last Week Review Classes Review Domain Model for EU-Bid & EU-Lease Aggregation Example (Reservation) Attribute Properties.
What is Object-Oriented?  Organization of software as a collection of discreet objects that incorporate both data structure and behavior.
Chapter 10 Defining Classes. The Internal Structure of Classes and Objects Object – collection of data and operations, in which the data can be accessed.
Design Model Lecture p6 T120B pavasario sem.
Domain Classes – Part 1.  Analyze Requirements as per Use Case Model  Domain Model (Conceptual Class Diagram)  Interaction (Sequence) Diagrams  System.
CS451 - Lecture 2 1 CS451 Lecture 2: Introduction to Object Orientation Yugi Lee STB #555 (816) * Acknowledgement:
1 Kyung Hee University Modeling with Objects Spring 2001.
Ch- 8. Class Diagrams Class diagrams are the most common diagram found in modeling object- oriented systems. Class diagrams are important not only for.
Class diagrams Terézia Mézešová.
Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey A.
Chapter 7 Classes and Methods III: Static Methods and Variables Lecture Slides to Accompany An Introduction to Computer Science Using Java (2nd Edition)
M1G Introduction to Programming 2 2. Creating Classes: Game and Player.
Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall Appendix A Object-Oriented Analysis and Design A.1.
Object Oriented Programming and Data Abstraction Earl Huff Rowan University.
COP 4331 – OOD&P Lecture 7 Object Concepts. What is an Object Programming language definition: An instance of a class Design perspective is different.
1 M206 Chapter 31: An Overview of Software Development 1.Defining the problem 2.Analyzing the requirement – constructing initial structural model 3.Analyzing.
DOMAIN CLASSES – PART 1 BTS430 Systems Analysis and Design using UML.
Defects of UML Yang Yichuan. For the Presentation Something you know Instead of lots of new stuff. Cases Instead of Concepts. Methodology instead of the.
2-1 © Prentice Hall, 2004 Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph.
Appendix 3 Object-Oriented Analysis and Design
CHAPTER
Unified Modeling Language (UML)
Object-Oriented Modeling
Object-oriented and Structured System Models
Object-Oriented Programming Basics
Object-Oriented Analysis and Design
Design (2).
The Object-Oriented Thought Process Chapter 1
Chapter 3: Using Methods, Classes, and Objects
Today’s Objectives Define the Problem Domain
Dynamic Modeling: Defining Classes
Object Oriented Analysis and Design
Chapter 20 Object-Oriented Analysis and Design
Appendix A Object-Oriented Analysis and Design
SYS466 Domain Classes – Part 1.
Appendix A Object-Oriented Analysis and Design
Appendix A Object-Oriented Analysis and Design
Presentation transcript:

Object Classes In UML

Object Concepts What is an object? How do objects communicate? How is an object’s interface defined? What have objects to do with components?

Object Thing –Which of the following are objects: hammer, sphere, chemical process, fog, river, anger, cat, grayness, gray cat? State –Encapsulated in the data in its attributes Behaviour –Understands and reacts to certain messages - can receive messages and act on them. Identity –Can be a name, but shouldn’t be dependent on the values of its attributes.

Example myClock Understands the messages reportTime resetTimeTo(07:43), resetTimeTo(12:30) I.e. resetTimeTo (newTime) for any suitable value of newTime. –The object’s interface says it accepts messages of the form reportTime() and resetTimeto(newTime:Time) where Time is a type whose elements are the sensible values of time.

Messages A message contains a keyword called a selector - e.g. ResetTimeTo or ReportTime A message can have zero or more arguments, as specified by the definition of the message in the interface.

Interfaces The object’s public interface defines which messages it will accept regardless of where they come from. An object can send itself a message. The private interface is usable by itself and other privileged parts of the system - this specifies the attributes of the objects - not viewable to the public. E.g. a clock will have an attribute Time.

Classes A class of objects is a group of objects that have the same attribute types and behavior Rather than specifying each object, a class definition shows how the object is defined and behaves. A Clock class could contain an object myClock. The Clock class has an operation resetTimeTo(newTime:Time); i.e. all of the clocks can reset time. myClock is an instance of the Clock class.

Interfaces The object’s public interface defines which messages it will accept regardless of where they come from. –A public interface is a method that can be operated on the class. An object can send itself a message. The private interface is usable by itself and other privileged parts of the system - this specifies the attributes of the objects - not viewable to the public. E.g. a clock will have an attribute Time. –A private interface is an attribute that is held about the class.

What is a class? A business class is a group of objects that have similar attributes and operations. Objects are nouns. Only objects that need to have data about them recorded are suitable candidates. A user may be a business object, but probably is not.

Starting a class diagram Choose your candidate objects from the system description. For each candidate: –Is there more than one object in this class? –Is this object a system user / location? –Can you describe the type of information you need to know about each member of this group of objects?

What is an attribute? An attribute is the type of information you need to know about each object in a class. An attribute is an attribute when:- –it has a finite length –it has a single value for each object An attribute is not an attribute when:- –it in turn has several attributes –it has multiple values

What is an association? An association is a relationship between object classes. An association is used to implement a link between objects – to send messages or instructions from one class to another. –An object from one class can invoke a method on an object from another class, thereby accessing it through its public interface.

Operations What sort of operations are there in a class? –Constructor operations create new objects in the class. –Selector operations get information about and from an object in a class. –Mutator operations set information about and to an object in a class. –Destructor operations destroy objects of the class.

Starting class diagrams Rather than trying to define the entire class –concentrate on the data that is required for business classes –set up a data model, that can be converted into a relational database –later, loosen the structure, to give object- oriented advantages –add operations on the data.

Object oriented modelling and design Introduction The world as seen by the object object instances and classes object identifiers Super and sub classes Interaction between classes

three models Object model Static structure of objects in a system and their relationships Contains class diagrams functional model data value transformations within a system - Use case and object interaction diagrams dynamic model describes aspects that change over time: state transition diagrams function data time

Object modelling Object - Class (v instance) Attributes (v values) Abstraction and encapsulation –Abstraction is when a client of a module doesn’t need to know more than is in the interface. –Encapsulation is when a client of a module isn’t able to know more than is in the interface. Method - implementation of an operation for class Method signature - number and types of arguments; type of result value Notation of object instances and classes

Sample object classes

Adding relationships Links Physical or conceptual connection between object instances Associations Groups of links with common structure and common semantics bi-directional; forward and inverse direction implied by the name is forward

Link Notation class associations one to one zero or many one to many many to many * 1..* 1 1 1

Sample associations

Examples Identify some of the classes that you would expect to find in each of the following systems: –A system for a library –A system to manage hotel bookings –A mail-order clothes system –An airline booking system –A system for an X-ray clinic

Class Person List the attributes that a person would have in each of the following systems: –A system for a library –A payroll system –A voting registration system –A sporting club registration system –A dentist’s system