UML - Class Diagrams.

Slides:



Advertisements
Similar presentations
Based on Java Software Development, 5th Ed. By Lewis &Loftus
Advertisements

OBJECT-ORIENTED PROGRAMMING CONCEPTS (Review). What is an Object? What is an Object? Objects have states and behaviors. Example: A dog has states - color,
Inheritance, part 2: Subclassing COMP 401, Fall 2014 Lecture 8 9/11/2014.
1 Classes Overview l Classes as Types l Declaring Instance Variables l Implementing Methods l Constructors l Accessor and Mutator Methods.
UML-diagrams Unified Modelling Language Used for Classes Objects.
Unit 011 Inheritance Recall What Inheritance is About The extends Keyword The Object Class Overriding versus Overloading What is Actually Inherited? Single.
CS 2511 Fall UML Diagram Types  2 Main Types Structure Diagrams ○ Class Diagrams ○ Component Diagrams ○ Object Diagrams Behavior Diagrams ○ Sequence.
Object Oriented Paradigm Programming Paradigms En Mohd Norafizal A.Aziz.
Distribution of Marks Internal Sessional Evaluation Assignments – 10 Quizzes – 10 Class Participation Attendence – 5 Mid – Term Test – 25 External Evaluation.
Java Objects and Classes. 3-2 Object Oriented Programming  An OO program models the application as a world of interacting objects.  A typical Java program.
Introduction To OOP 1.0 Fundamentals Of Java Programming Language 2.0 Exception Handling 3.0 Classes, Inheritance And Polymorphism
Unified Modeling Language
CS 2511 Fall UML Diagram Types  2 Main Types Structure Diagrams ○ Class Diagrams ○ Component Diagrams ○ Object Diagrams Behavior Diagrams ○
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.
Chapter 4 Objects and Classes.
Sadegh Aliakbary. Copyright ©2014 JAVACUP.IRJAVACUP.IR All rights reserved. Redistribution of JAVACUP contents is not prohibited if JAVACUP.
Writing Classes (Chapter 4)
Object Oriented Programming Concepts Fatih University Ceng-104-A Introduction to Object Oriented Programming Harun Reşit Zafer This is a slide version.
12-CRS-0106 REVISED 8 FEB 2013 CSG2H3 Object Oriented Programming.
Fall 2010 CS4310 Requirements Engineering A Brief Review of UML & OO Dr. Guoqiang Hu Department of Computer Science UTEP 1.
UML (U NIFIED M ODELING LANGUAGE ) Prepared by Miss Simab Shahid Lecturer computer Science and Software Engineering department, University.
Singleton and Basic UML CS340100, NTHU Yoshi. What is UML Unified Modeling Language A standardized general-purpose modeling language in the field of software.
 28object-oriented_programming%29 28object-oriented_programming%29.
BCS 2143 Object Oriented Design Using UML. Objectives Objects Interactions Finding Classes Relationship Between Classes Attribute and Operation Class.
Information Systems Engineering
Peyman Dodangeh Sharif University of Technology Fall 2014.
Java - Classes JPatterson. What is a class? public class _Alpha { public static void main(String [] args) { } You have been using classes all year – you.
CSE 219 Computer Science III UML. UML Diagrams UML - Unified Modeling Language UML diagrams are used to design object-oriented software systems –represent.
Page 4.1 – Autumn 2010Steffen Vissing Andersen SDJ I1, Autumn 2010 Agenda – Session 4 – 7. September 2009 Java fundamentals, checkpoint from chapter 2.
Class Diagram Chapter 21 Applying UML and Patterns Craig Larman.
Class diagrams Terézia Mézešová.
Copyright © 2015 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 3 A First Look at Classes and Objects.
Inheritance in Java. Access Specifiers private keywordprivate keyword –Used for most instance variables –private variables and methods are accessible.
By : Robert Apeldorn. What is OOP?  Object-oriented programming is a programming paradigm that uses “objects” to design applications and computer programs.
Presented by Ted Higgins, SQL Server DBA An Introduction to Object – Oriented Programming.
Software development For large and complex software use divide and conquer rule. Software design methods: Structured design Object-Oriented design.
Object Oriented Programming and Data Abstraction Earl Huff Rowan University.
Unified Modeling Language (UML)
UML Review – class diagrams SE-2030 Dr. Mark L. Hornick 1.
Inheritance Class Hierarchies SoftUni Team Technical Trainers Software University
COP 3330 Notes 4/13. Today’s Topics UML Class Diagrams.
Theory *OOP Charachteristic*
Advanced Programming in Java
OBJECT ORIENTED PROGRAMMING
Unified Modeling Language (UML)
What is an Object Objects are key to understanding object-oriented technology. An object can be considered a "thing" that can perform a set of related.
Unified Modeling Language
Advanced Programming in Java
03/10/14 Chapter 9 Inheritance.
The Complete Guide to UML Diagram Types with Examples in Simple Words
CLASS DEFINITION (> 1 CONSTRUCTOR)
Part II The Switch Statement
The Basics of Class Diagrams for a single class
ניתוח מערכות מידע א' הרצאה 3
البرمجة الكينونية بلغة جافا 1294
Software Engineering Lecture #11.
CSE 1020:Programming by Delegation
Advanced Programming Behnam Hatami Fall 2017.
OBJECT-ORIENTED PROGRAMMING
Software Engineering System Modeling Extra examples Dr.Doaa Sami
Software Design Lecture : 15.
Software Design Lecture : 14.
Inheritance Inheritance is a fundamental Object Oriented concept
انجمن جاواکاپ تقدیم می‌کند دوره برنامه‌نويسی جاوا
Basics of OOP A class is the blueprint of an object.
By Rajanikanth B OOP Concepts By Rajanikanth B
Class Diagram.
Chih-Ping Chu Dept. of Computer Science & Information Engineering
Dr. R Z Khan Handout-3 Classes
ADVANCED OBJECT-ORIENTED PROGRAMMING
Presentation transcript:

UML - Class Diagrams

What is UML Diagram? Unified Modeling Language (UML) Standardized general-purpose modeling language in the field of object-oriented software engineering. The standard is managed, and was created, by the Object Management Group.

UML Diagram UML 2.2 has 14 types of diagrams divided into two categories. Seven diagram types represent structural information. Seven represent general types of behavior.

UML Diagram Types 

What is class diagram? Is a type of static structure diagram that describes the structure of a system by showing the system's classes, their attributes, operations (or methods), and the relationships among the classes.

Class Diagram Models Class Name Attributes Methods

Example: CD Models (Class and Attribute) Person Person - Name : String Modifier + : Public : Private # : Protected ~ : Package

Example 2: CD Models (Class, Attributes, Method) MyCar + Color : String + yearOfProduction : int + printMyCar (): void

Example 3: CD Models (Class with main method) MyCarInAction + main(String[]): void

Exercise 1: Create code from UML class diagram below! MyCar2 + Color : String + yearOfProduction : int + printMyCar (): void + turnOnMechine (): void + changeGear (): void + turnOffMechine (): void MyCarInAction2 + main(String[]): void

Example 4: CD Models (Class with main constructor) Students nim : String nama : String + Students(nim : String, nama : String) + getNim (): String + getNama (): String StudentsCard + main(String[]): void

Example 4: CD Models (Class with constructor) Result

Exercise 2: Create code from UML class diagram below! Students2 nim : String nama : String + Students2(nim : String) + setNim(String): void + setNama(String): void + getNim (): String + getNama (): String StudentsCard2 + main(String[]): void With scanner import java.util.scanner

Example 5: CD Models (Inheritence) Bicycle gear: int speed : int + changeGear(int): void + speedUp(int): void + applyBrake(int): void MountainBikeAction + main(String[]): void MountainBike - seatHeight : int + setHeight (int): void

Example 5: CD Models (Inheritence) Result Bicycle gear: int speed : int + changeGear(int): void + speedUp(int): void + applyBrake(int): void

Example 5: CD Models (Inheritence) Result cont’d MountainBike - seatHeight : int + setHeight (int): void MountainBikeAction + main(String[]): void

Exercise 3: Create code from UML class diagram below! Calc # result: double = 0 # operand1: double = 0 # operand2: double = 0 # setOperand1(double): void # setOperand2(double): void # getOperand1(): double # getOperand2(): double # addition(): double # subtraction(): double # multiplication (): double # division(): double AdvancedCalcAction + main(String[]): void AdvancedCalc + modulo(double,double): double

Exercise 3: Result

Example 6: CD Models (Multilevel Inheritance) Person # name: String # address: String # setName(String): void # setAddress(String): void # getName(): String # getAddress(): String PersonInAction + main(String[]): void Student - campus : String # setCampus(String): void # getCampus(): String Employee # totalSalary: double # setTotalSalary(double): void # calculateSalary(): void # getTotalSalary(): double Monthly - numberOfAbsent : int - salaryPerMonth : double + calculateSalary(): void + addAbsent(int): void Hourly - salaryPerHour : double + calculateSalary(): void + addHour(float): void

Exercise 4: Create code from class diagram in the previous slide Clue: calculateSalary is polymorhism method

THANKS