Informática II Prof. Dr. Gustavo Patiño MJ 16- 18 12-09-2013.

Slides:



Advertisements
Similar presentations
General OO Concepts Objectives For Today: Discuss the benefits of OO Programming Inheritance and Aggregation Abstract Classes Encapsulation Introduce Visual.
Advertisements

Informática II Prof. Dr. Gustavo Patiño MJ
Mastering Object-Oriented Analysis and Design with UML Module 2: Concepts of Object Orientation.
Object-oriented modeling Class/Object Diagrams
Informática II Prof. Dr. Gustavo Patiño MJ
1 Generalizations Multiple Inheritance (finishing up Class Design) Class Design – Another Look – Part 11.
UML Class Diagram. UML Class Diagrams2 Agenda What is a Class Diagram? Essential Elements of a UML Class Diagram Tips.
Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved. 1 1 Abstract Classes and Interfaces.
Object Oriented Analysis and Design Using the UML
What is UML? A modeling language standardized by the OMG (Object Management Group), and widely used in OO analysis and design A modeling language is a.
Page 1  Copyright © 1997 by Rational Software Corporation Class Diagrams A class diagram shows the existence of classes and their relationships in the.
Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 1 Object-Oriented Analysis and Design - CDT309 Period 4, Spring 2008 Object-oriented concepts.
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 Class and Object Diagrams PRACTICAL OBJECT-ORIENTED DESIGN WITH.
Modelling classes Drawing a Class Diagram. Class diagram First pick the classes –Choose relevant nouns, which have attributes and operations. Find the.
UML Class Diagrams: Basic Concepts. Objects –The purpose of class modeling is to describe objects. –An object is a concept, abstraction or thing that.
1 ODB Design: Handling Associations and Inheritance in ODL M. Akhtar Ali School of Informatics.
OOAD Using the UML - Introduction to Object Orientation, v 4.2 Copyright  Rational Software, all rights reserved 1 Object Oriented Analysis.
Object Oriented Analysis and Design Using the UML Version 4.2 Introduction to Object Orientation Prepared by:Kandarp R. Somaiya.
Software Construction Lecture 5 Class Diagrams. Agenda 2  Topics:  Examples of class diagrams  Navigation, visibility, named associations, and multiplicity.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter Chapter 1 Introduction to Object-Oriented Programming and.
Page 1 What is the UML? UML stands for Unified Modeling Language The UML combines the best of the best from – Data Modeling concepts (Entity Relationship.
1 A Student Guide to Object- Orientated Systems Chapter 4 Objects and Classes: the basic concepts.
OBJECT AND CLASES: THE BASIC CONCEPTS Pertemuan 8 Matakuliah: Konsep object-oriented Tahun: 2009.
1 Announcements Research Paper due Friday November 19 For Wednesday read
3rd Country Training, K.Subieta: System Engineering and Databases. Lecture 3, Slide 1 February 20, 2004 Lecture 3: Introduction to Software Analysis and.
Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part V: Design The Design Workflow Design Classes Refining Analysis Relationships.
UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
R McFadyen Chapter 7 Conceptual Data Modeling.
Lab 04.
CS3773 Software Engineering Lecture 04 UML Class Diagram.
© 2011 Pearson Education 1 Chapter 13 (Online): Object-Oriented Databases Modern Database Management 10 th Edition, International Edition Jeffrey A. Hoffer,
Databases : Data Modeling 2007, Fall Pusan National University Ki-Joune Li.
® IBM Software Group © 2006 IBM Corporation Rational Software France Object-Oriented Analysis and Design with UML2 and Rational Software Modeler 03. Classes,
CSC271 Database Systems Lecture # 25. Summary: Previous Lecture  Structural constraints  Multiplicity  Cardinality  Participation  Connection traps.
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.
EC-241 Object-Oriented Programming LECTURE 9. Objectives: Introduction to Object Oriented Design Revise the basic principles of object orientation Unified.
UML Class Diagrams 1 These lecture slides are copyright (C) Marty Stepp, They may not be rehosted, sold, or modified without expressed permission.
SE-1020 Dr. Mark L. Hornick 1 Composition, Aggregation, and Inheritance - Introduction.
Object Oriented Analysis & Design Using UML (CS-512) M-Tech CSE (Ist & 3rd Sem) Part Time Mr. Pawan Luthra Assistant Professor (CSE Deptt.) SBSSTC, Ferozepur.
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.
Class and Sequence diagrams UML notation SE-2030 Dr. Mark L. Hornick 1.
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).
OOAD Using the UML - Introduction to Object Orientation, v 4.2 Copyright  Rational Software, all rights reserved 1 Object Oriented Analysis.
Modeling the Static Structure: Relationships ©SoftMoore ConsultingSlide 1.
CS212: Object Oriented Analysis and Design Lecture 33: Class and Sequence Diagram.
UML Class Diagram notation Indicating relationships between classes SE-2030 Dr. Mark L. Hornick 1.
UML Part 1: Class Diagrams. Introduction UML stands for Unified Modeling Language. It represents a unification of the concepts and notations presented.
Page 1  Copyright © 1997 by Rational Software Corporation Putting the UML to Work The ESU University wants to computerize their registration system –
Object Oriented Analysis and Design Using the UML
1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Module 3: Concepts of Object Orientation.
Didik Dwi h t t p : / / b l o g. e l e k t r o. u m. a c. i d / d i d i k Object Oriented Software Engineering.
ITEC0724 Modern Related Technology on Mobile Devices Lecture Notes #2 1.
Class Diagram Lecture # 1. Class diagram A Class Diagram is a diagram describing the structure of a system shows the system's classes Attributes operations.
1 ODB Design Handling Inheritance in ODL M. Akhtar Ali School of Informatics.
Object-Oriented Modeling
Class Diagrams.
Design (2).
UML SEQUENCE AND CLASS DIAGRAMS
Chapter 13 Abstract Classes and Interfaces
Object Oriented Analysis and Design Using the UML Version 4.2
UML Class Diagrams: Basic Concepts
Object Oriented Analysis and Design Using the UML
Object Oriented Analysis and Design
Software Engineering Lecture #11.
Object Oriented Analysis and Design Using the UML
Understand and Use Object Oriented Methods
Systems Analysis – ITEC 3155 Modeling System Requirements – Part 2
Object Oriented System Design Class Diagrams
Chapter 5 System modeling Chapter 5 – System Modeling Lecture 2 1.
Presentation transcript:

Informática II Prof. Dr. Gustavo Patiño MJ

 An object is represented as rectangles with underlined names : Lecturer Class Name Only Y.Welikala : Lecturer Class and Object Name Y.Welikala Object Name Only Informatica II. Facultad de Ingeniería. Universidad de Antioquia

Intro to OO 201 Algebra 110 Electricity 100 Algorithms 202 ThermalDynamics 110 Electronics 110 English 101

 A class is represented using a compartmented rectangle. Informatica II. Facultad de Ingeniería. Universidad de Antioquia Lecturer

Name save() change() delete() empID create()

 The second and third sections may be suppressed if they need not be visible on the diagram Lecturer Name save() change() delete() empID create() Lecturer Name empID Lecturer save() change() delete() create() Lecturer Informatica II. Facultad de Ingeniería. Universidad de Antioquia

CourseOffering Intro to OO 201 Algebra 110 Algorithms 202 Electricity 101 Electronics 200 English 110 Thermo 110

Informatica II. Facultad de Ingeniería. Universidad de Antioquia Class Attribute CourseOffering number startTime endTime :CourseOffering Number=CS201 endTime=1230 startTime=1030 Object Attribute Value :CourseOffering Number=CS202 endTime=1500 startTime=1300

 Attributes are in fact objects.  However, fine detail such as date, integer, etc., should not be modeled.  Sometimes it is difficult to decide whether an attribute should be an object, and vice versa, e.g. qualification as an attribute of person could be modeled as an object.

 The same operation (e.g. +) may apply to lots of different classes (polymorphism).  The implementation of an operation is called a method.  Methods are exactly equivalent to procedures and functions in traditional languages.  Methods may have arguments.  Methods may return a result.

CourseOffering addStudent deleteStudent getStartTime getEndTime Class Operation Informatica II. Facultad de Ingeniería. Universidad de Antioquia

 Classes are types! Types are classes!  Programming languages have built-in classes, such as Real, Integer, Array.  In an object language you can expand and extend the types available, e.g. add complex numbers to the number hierarchy.

 Association  Aggregation  Composition  Generalization

 A special form of association that models a whole-part relationship between an aggregate (the whole) and its parts TrainCarriage Aggregation Whole Part Informática II. Facultad de Ingeniería. Universidad de Antioquia

 A form of aggregation with strong ownership and coincident lifetimes  The parts cannot survive the whole/aggregate Informática II. Facultad de Ingeniería. Universidad de Antioquia ExamPaper Aggregation Whole Part

 Multiplicity defines how many objects participate in a relationships  The number of instances of one class related to ONE instance of the other class  Specified for each end of the association  Associations and aggregations are bi- directional by default, but it is often desirable to restrict navigation to one direction  If navigation is restricted, an arrowhead is added to indicate the direction of the navigation.

 Unspecified  Exactly one  Zero or more (many, unlimited)  One or more  Zero or one  Specified range  Multiple, disjoint ranges 1 0..* * 1..* ,4..6

StudentSchedule Navigation 0..*1 Multiplicity Informática II. Facultad de Ingeniería. Universidad de Antioquia

 A relationship among classes where one class shares the structure and/or behavior of one or more classes  Defines a hierarchy of abstractions in which a subclass inherits from one or more super classes  Single inheritance  Multiple inheritance  Generalization is an “is-a-kind of” relationship.

 One class inherits from another BankAccount balance number name Withdraw() CreateStatement() Current Withdraw() Savings GetInterest() Withdraw() Subclasses Superclass (parent) Ancestor Descendents Generalization Relationship

 A class can inherit from several other classes FlyingThingAnimal AirplaneHelicopterBirdWolfHorse multiple inheritance

 A subclass inherits its parent’s attributes, operations, and relationships  A subclass may:  Add additional attributes, operations, relationships  Redefine inherited operations (use caution)  Common attributes, operations, and/or relationships are shown at the highest applicable level in the hierarchy.

Order Product Ship via

CorporateIndividual TruckTrain Sale SalespersonCustomerVehicleProduct seller buyer Item sold Shipping mechanism

CorporateIndividualTruckTrainAirplane Suppose you need a new type of shipping vehicle … Sale SalespersonCustomerVehicleProduct seller buyer Item sold Shipping mechanism