A means of graphically displaying a complicated programs 18-Mar-16 UML Thanks to Dave Matuczek, UPenn.

Slides:



Advertisements
Similar presentations
Object Oriented Programming with Java
Advertisements

Inheritance // A simple class hierarchy. // A class for two-dimensional objects. class TwoDShape { double width; double height; void showDim() { System.out.println("Width.
Programming With Java ICS201 University Of Hail1 Chapter 13 Inner Classes.
Inheritance Inheritance Reserved word protected Reserved word super
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall
UML – Class Diagrams.
Class template Describing a generic class Instantiating classes that are type- specific version of this generic class Also are called parameterized types.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Chapter 4 Defining Your Own Classes.
Programming With Java ICS201 University Of Hail1 Chapter 12 UML and Patterns.
UML Class Diagram: class Rectangle
1 Creating Classes. 2 Writing Classes Thus far, we have mainly used existing classes in the Java library  (also main classes for executing) True object-oriented.
© The McGraw-Hill Companies, 2006 Chapter 7 Implementing classes.
Unit 221 UML Back Ground Class Diagrams Inheritance Hierarchy UML Patterns.
1 TCSS 360, Spring 2005 Lecture Notes Design Phase and UML Class Diagrams Relevant Reading: UML Distilled, Third Edition M. Fowler.
Principles of Computer Programming (using Java) Review Haidong Xue Summer 2011, at GSU.
Using Jeroo To Teach Object-Oriented Concepts By Christian Digout.
Chapter 6 Class Inheritance F Superclasses and Subclasses F Keywords: super F Overriding methods F The Object Class F Modifiers: protected, final and abstract.
Things and Relations - Examples Things Relationships Structural Behavioral Grouping Annotational Dependency Association Generalization Realization Class,
Java Class Syntax CSIS 3701: Advanced Object Oriented Programming.
Creating Simple Classes. Outline of Class Account Class Account Account # Balance Holder name phone# Overdrawn (true/false) Data Members Open Credit Debit.
An Introduction to Java Chapter 11 Object-Oriented Application Development: Part I.
1 Given the Radio class  We may define other derivative types: Cassette walkman IS-A radio Alarm clock radio IS-A radio Car radio IS-A radio.
Object-Oriented Programming in C++
UML Review – class diagrams SE 2030 Dr. Rob Hasker 1 Based on slides written by Dr. Mark L. Hornick Used with permission.
31-Oct-15 Simple UML IB Computer Science. 2 What is UML? UML stands for Unified Modeling Language UML is a diagramming language designed for Object- Oriented.
UML Class Diagrams 1 These lecture slides are copyright (C) Marty Stepp, They may not be rehosted, sold, or modified without expressed permission.
UML (U NIFIED M ODELING LANGUAGE ) Prepared by Miss Simab Shahid Lecturer computer Science and Software Engineering department, University.
1 Introduction to Classes and Objects Chapter 3 Introduction to Classes and Objects Chapter 3.
Chapter 8 Inheritance. 2  Review of class relationships  Uses – One class uses the services of another class, either by making objects of that class.
CSE 219 Computer Science III UML. UML Diagrams UML - Unified Modeling Language UML diagrams are used to design object-oriented software systems –represent.
Chapter 7: Class Inheritance F Superclasses and Subclasses F Keywords: super and this F Overriding methods F The Object Class F Modifiers: protected, final.
Chapter 8 Class Inheritance and Interfaces F Superclasses and Subclasses  Keywords: super F Overriding methods  The Object Class  Modifiers: protected,
Interfaces An interface is like an extreme case of an abstract class – However, an interface is not a class – It is a type that can be satisfied by any.
Class diagrams Terézia Mézešová.
Chapter 16 UML Class Diagrams.
Chapter 5 Classes and Methods II Lecture Slides to Accompany An Introduction to Computer Science Using Java (2nd Edition) by S.N. Kamin, D. Mickunas, E.
Copyright © 2012 Pearson Education, Inc. Chapter 13: Introduction to Classes.
Presented by Ted Higgins, SQL Server DBA An Introduction to Object – Oriented Programming.
1 Chapter 8 Class Inheritance and Interfaces F Superclasses and Subclasses  Keywords: super F Overriding methods  The Object Class  Modifiers: protected,
© 2004 Pearson Addison-Wesley. All rights reserved April 10, 2006 Inheritance (part 2) ComS 207: Programming I (in Java) Iowa State University, SPRING.
Object Oriented Programming and Data Abstraction Earl Huff Rowan University.
Unified Modeling Language (UML)
Introduction to Unified Modeling Language (UML) By Rick Mercer with help from The Unified Modeling Language User Guide, Grady Booch, James Rumbaugh, Ivar.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley The Unified Modeling Language
Introducing, the JFrame Gives us a work area beside System.out.println.
Unit 2. Constructors It initializes an object when it is created. It has same as its class and syntactically similar to a method. Constructor have no.
UML Review – class diagrams SE-2030 Dr. Mark L. Hornick 1.
Java Programming: Guided Learning with Early Objects Chapter 9 Inheritance and Polymorphism.
COP 3330 Notes 4/13. Today’s Topics UML Class Diagrams.
TCSS 305 (Stepp) OO Design with UML Class Diagrams
Interface, Subclass, and Abstract Class Review
Lecture on Design Phase and UML Class Diagrams
CompSci 230 Software Construction
UML Class Diagram: class Rectangle
Simple UML 11-Nov-18.
CLASS DEFINITION (> 1 CONSTRUCTOR)
The Basics of Class Diagrams for a single class
OBJECT ORIENTED PROGRAMMING II LECTURE 8 GEORGE KOUTSOGIANNAKIS
Intro to UML Edited from presentation found at:
Simple UML 7-Dec-18.
Unified Modelling Language
Software Engineering System Modeling Extra examples Dr.Doaa Sami
Implementing Classes Chapter 3.
Simple UML 13 Nov 2018.
Basics of OOP A class is the blueprint of an object.
Object Oriented Programming Review
Object-Oriented Programming
Introduction to UML Sources:
Chapter 8 Class Inheritance and Interfaces
INTERFACES Explained By: Sarbjit Kaur. Lecturer, Department of Computer Application, PGG.C.G., Sector: 42, Chandigarh.
Presentation transcript:

A means of graphically displaying a complicated programs 18-Mar-16 UML Thanks to Dave Matuczek, UPenn

What is UML? 2 UML stands for Unified Modeling Language or Universal Modeling Language UML uses graphics to show the relationships between program classes and objects.

Design Patterns 3 Design Patterns common programming strategies Design Patterns are best described by UML We will learn some simple patterns in class

Classes 4 A class is drawn as a rectangle with three sections Name of the class Variables Methods

Variables 5 A variable is written as: domain name : type where: + means public - means private Example: +length:int

Variables 6 Static variables are underlined An initial value can be shown with =value Example: -numberOfEmployees:int=10 means numberOfEmployees is: private static integer and has 10 as its initial value

Methods 7 Methods are written as: domain name (parameters) : returnType where Domain uses the same syntax variables (+, -, blank) parameters are given as name:type if the returnType is void, it is omitted constructors are preceded by «constructor» interfaces are preceded by «interface»

Example of a class 8 Card +cardId:int -copy:boolean=false «constructor» Card( int id ) +isKind( desiredKind:int ) +isSharable( ):boolean +toString( ):String

Types of relationships 9 A B class B extends class A C D 1..4 “Is a”“Has a” Class C contains 1 to 4 objects of class D IGeometry Cube Implements

Example: Geometry program 10

Dependency "uses " No instantiation OBJECT new BankClass( );

Composition "has a" object instantiation public BankAccountClass myAccount; myAccount = new BankAccountClass( ….

Inheritance “is a” public class Clock extends JFrame

Realization interface implementation public class BankAccountClass implements IBankAccountClass

Association "knows a" object is passed public BankAccountClass( double money, int acct, PeopleClass person ) { balance = money; accountNumber = acct; member = person; }