Object Oriented Methods with UML

Similar documents
Object Oriented Modeling

(C) 2010 Pearson Education, Inc. All rights reserved. Dr. Marenglen Biba

Unified Modeling Language (UML) Class Diagram

UML Is Not a Methodology

Unified Modeling Language (UML)

ACS-3913 Ron McFadyen 1. UML Notation for Class diagrams Object diagrams

1st Semester MTCE 601A COMPUTER SYSTEM SOFTWARE

OO Techniques & UML Class Diagrams

Object-Oriented Analysis, Design and Implementation. Case Study Part II

Static Modeling. SWE 321 Fall2014

The Unified Modeling Language. Asst.Prof.Dr. Supakit Nootyaskool IT-KMITL

S T R U C T U R A L M O D E L I N G ( M O D E L I N G A S Y S T E M ' S L O G I C A L S T R U C T U R E U S I N G C L A S S E S A N D C L A S S D I A

Unified Modeling Language (UML)

Database Systems: Design, Implementation, and Management Tenth Edition. Chapter 4 Entity Relationship (ER) Modeling

Database Systems: Design, Implementation, and Management Tenth Edition. Chapter 4 Entity Relationship (ER) Modeling

Class diagrams. Modeling with UML Chapter 2, part 2. Class Diagrams: details. Class diagram for a simple watch

Object-Oriented Design. Module UFC016QM. and Programming. Objects and Classes. O-O Design Unit 2: Faculty of Computing, Engineering

Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition. Chapter 7 Data Modeling with Entity Relationship Diagrams

SWE 621: Software Modeling and Architectural Design. Lecture Notes on Software Design. Lecture 14 - Course Review

A l Ain University Of Science and Technology

Introduction to Classes and Objects Pearson Education, Inc. All rights reserved.

A l Ain University Of Science and Technology

Chapter 2 Entity-Relationship Data Modeling: Tools and Techniques. Fundamentals, Design, and Implementation, 9/e

CSE 403: Software Engineering, Spring courses.cs.washington.edu/courses/cse403/15sp/ UML Class Diagrams. Emina Torlak

DATABASE SYSTEMS. Chapter 5 Entity Relationship (ER) Modelling DESIGN IMPLEMENTATION AND MANAGEMENT INTERNATIONAL EDITION ROB CORONEL CROCKETT

Äriprotsesside modelleerimine ja automatiseerimine Loeng 7 Valdkonna mudel

Object-Oriented Systems Development: Using the Unified Modeling Language

Introduction to Classes and Objects

Chapter 1: Principles of Programming and Software Engineering

What are the characteristics of Object Oriented programming language?

Storing Data in Objects

Five EASY Steps to Switch to

Class diagrams. Modeling with UML Chapter 2, part 2. Class Diagrams: details. Class diagram for a simple watch

Chapter 6: Entity-Relationship Model

Conceptual Data Modeling and the Entity- Relationship Model. Department of Computer Science Northern Illinois University September 2014

2. An implementation-ready data model needn't necessarily contain enforceable rules to guarantee the integrity of the data.

Modeling with UML. (1) Use Case Diagram. (2) Class Diagram. (3) Interaction Diagram. (4) State Diagram

Object Orientated Analysis and Design. Benjamin Kenwright

PART A : MULTIPLE CHOICE Circle the letter of the best answer (1 mark each)

Overview. OOP: model, map, reuse, extend. Examples of objects. Introduction to Object Oriented Design

Object Oriented Design. Program Design. Analysis Phase. Part 2. Analysis Design Implementation. Functional Specification

The DBMS accepts requests for data from the application program and instructs the operating system to transfer the appropriate data.

Chapter 2 Entity-Relationship Data Modeling: Tools and Techniques. Fundamentals, Design, and Implementation, 9/e

Object-oriented basics. Object Class vs object Inheritance Overloading Interface

UML Primer. -Elango Sundaram

Appendix E: Using UML in Class Design

More on the Chen Notation

SEEM4570 System Design and Implementation. Lecture 11 From Design to Implementation

Relationships. Association Aggregation/Composition Multiplicity Dependencies

CHAPTER 2: DATA MODELS

The Final Exam Paper. Duration: 2 hours Reading: 15 minutes Total marks: 65 Hurdle: 32.5

Using High-Level Conceptual Data Models for Database Design A Sample Database Application Entity Types, Entity Sets, Attributes, and Keys

Data Structures (INE2011)

CS304 Object Oriented Programming Final Term

A Data Modeling Process. Determining System Requirements. Planning the Project. Specifying Relationships. Specifying Entities

Lecture 13: Analysis Modeling


The Object-Oriented Design Process

A - 1. CS 494 Object-Oriented Analysis & Design. UML Class Models. Overview. Class Model Perspectives (cont d) Developing Class Models

CS304 Lecture Wise Questions by Virtualians Social

Credit where Credit is Due. Lecture 4: Fundamentals of Object Technology. Goals for this Lecture. Real-World Objects

COSC 3351 Software Design. An Introduction to UML (I)

UML class diagrams. Nigel Goddard. School of Informatics University of Edinburgh

OO System Models Static Views

Chapter 1: Programming Principles

Chapter 4. In this chapter, you will learn:

OBJECT ORIENTED MODELLING & DESIGN 1

Unified Modeling Language (UML)

CS112 Lecture: Defining Classes. 1. To describe the process of defining an instantiable class

Object-Oriented Systems Development: Using the Unified Modeling Language. Chapter 1: An Overview of Object- Oriented Systems Development

Intro to DB CHAPTER 6

Advantages of Object Oriented Programming :- Features of Object Oriented Programming :- Advantages Of Object Oriented Programming :

Administrivia. IBM Info Session Date: Wed,, Jan 13 Time: 5:30 7 pm Location: Wesbrook 100

Conceptual Database Design. COSC 304 Introduction to Database Systems. Entity-Relationship Modeling. Entity-Relationship Modeling

UML Class Diagrams Revisited

MechEng SE3 Lecture 7 Domain Modelling

Modern Systems Analysis and Design Seventh Edition

Class diagrams and architectural design

CHAPTER 2: DATA MODELS

Today s Topic. Lecture 5. What is UML? Why Use UML. UML Diagrams. Introduction to UML. What is UML Why use UML? UML Diagrams

Lecture 2: Entity Relationship Data Model 2. 1

Chapter 6: Entity-Relationship Model

Type Hierarchy. Lecture 6: OOP, autumn 2003

Conceptual Data Modeling

Introduction to UML. Danang Wahyu utomo

Design Process Modeling Constraints E-R Diagram Design Issues Weak Entity Sets Extended E-R Features Design of the Bank Database Reduction to

OO Analysis and Design with UML 2 and UP

Chapter 10 Object-Oriented Design Principles

Data Flow Diagrams System Analysis ( (

public class Account { private int id; private static int nextaccountid = 0; private String name; private double balance;

Chapter 6: Entity-Relationship Model

Introduction to Unified Modelling Language (UML)

SE 1: Software Requirements Specification and Analysis

Spring 2003 Instructor: Dr. Shahadat Hossain. Administrative Matters Course Information Introduction to Programming Techniques

Lecture 14 of 42. E-R Diagrams, UML Notes: PS3 Notes, E-R Design. Thursday, 15 Feb 2007

Introduction to OO Concepts

Principles of Software Construction: Objects, Design, and Concurrency

LECTURE 2: The Object Model. Ivan Marsic Rutgers University

E-R Model. Hi! Here in this lecture we are going to discuss about the E-R Model.

CS-202 Introduction to Object Oriented Programming

Transcription:

Object Oriented Methods with UML Introduction to Class Diagram Lecture -3 Presented By Dr.A.Bazila Banu

What is a class? Central feature of C++ that supports OOP. It combines data representation and methods for manipulating the data. Members of class Data Methods class Rectangle { int width, height; public: void set_values (int, int); int area (void); } rect;

Example -Class Class name Data Methods Object

Access Specifiers in Class Data hiding is one of the important features of Object Oriented Programming which allows preventing the functions of a program to access directly the internal representation of a class type. The access restriction to the class members is specified by Private :Variable or function cannot be accessed, or even viewed from outside the class Public :Accessible from anywhere outside the class but within a program. Protected : Accessed in child classes which are called derived classes.

How to identify a class? Noun Phrase Approach Read through the Use cases, Interviews and Requirement Specification to find the Noun Phrases

Noun Phrase Approach Identify Tentative classes Look for nouns and noun phrases in use cases All classes must make sense in application domain Select classes from relevant categories Eliminate the following classes Adjectives Attributes Irrelevant classes Redundant

Example-Banking Account Account Balance Amount ATM card ATM machine Bank Bank Client Card Cash Check Checking Checking a/c Client Client s a/c Currency Dollar Envelope Invalid PIN Message Money Password PIN PIN code Record Savings a/c Business a/c Transaction

Eliminate Adjectives No adjectives to eliminate Eliminate Attributes Account Check Account Balance Checking Amount Checking a/c ATM card ATM machine Client Bank Client s a/c Bank Client Currency Card Dollar Cash Envelope Invalid PIN Money Password PIN PIN code Record Savings a/c Business a/c Transaction Message

Identify Redundant Classes Account Client s a/c ATM card ATM machine Bank Bank Client Client Checking Checking a/c Savings a/c Business a/c Transaction

Selected List of Classes Account ATM card ATM machine Bank Client Bank Savings Account Business Account Transaction

Class Diagram A class diagram depicts classes and their interrelationships Used for describing structure and behavior in the use cases Provide a conceptual model of the system in terms of entities and their relationships Used for requirement capture, end-user interaction

Class Diagram Account_Name - Customer_Name - Balance +addfunds( ) -withdraw( ) #transfer( ) Name Attributes Operations

Class Diagram -Notations Each class is represented by a rectangle subdivided into three compartments Name Attributes Operations Modifiers are used to indicate visibility of attributes and operations. + is used to denote Public visibility (everyone) # is used to denote Protected visibility (friends and derived) - is used to denote Private visibility (no one) By default, attributes are hidden and operations are visible.

Relationships in Class Diagram There are two kinds of Relationships Generalization (parent-child relationship) Association (student enrolls in course) Associations can be further classified as Aggregation Composition

OO Relationships: Generalization - -Inheritance is a required feature of OO Model. Supertype Customer Regular Customer Loyalty Customer Subtype1 Subtype2

OO Relationships: Association Represent relationship between instances of classes Student enrolls in a course Courses have students Courses have exams Etc. Association has two ends Role names (e.g. enrolls) Multiplicity (e.g. One course can have many students) Navigability (unidirectional, bidirectional)

Association 1 * University Person 0..1 employer * teacher Multiplicity Symbol Meaning 1 One and only one 0..1 Zero or one M..N From M to N (natural language) * From zero to any positive integer 0..* From zero to any positive integer 1..* From one to any positive integer Role Role A given university groups many people; some act as students, others as teachers. A given student belongs to a single university; a given teacher may or may not be working for the university at a particular time.

Association Association Models the part whole relationship I) Composition Models the part whole relationship but, in addition, Every part may belong to only one whole, and If the whole is deleted, so are the parts II) Aggregation Expresses a relationship among instances of related classes.

Association Represent relationship between instances of classes Student enrolls in a course Courses have students Courses have exams Etc. Association has two ends Role names (e.g. enrolls) Multiplicity (e.g. One course can have many students) Navigability (unidirectional, bidirectional)

Association: Multiplicity and Roles student 1 * University Person employer 0..1 * teacher Multiplicity Symbol Meaning 1 One and only one 0..1 Zero or one M..N From M to N (natural language) * From zero to any positive integer 0..* From zero to any positive integer 1..* From one to any positive integer Role Role A given university groups many people; some act as students, others as teachers. A given student belongs to a single university; a given teacher may or may not be working for the university at a particular time.

Depiction of Aggregation Relationship Modules Computing Business commerce

Depiction of Composition Relationship Address City Street Post Code

Class Diagram -Example +Bank_ Name +Bank_Code +Branch_ Code +Bank_Address +Bank_CNumber Bank +Display_Clients(Bank_Client) -Display_All_AccountDetails() -Update_All_Client_Details() +Update_AccountDetails() +Display_AccountDetails(Account_number) Bank Client +Client_name #Client_email #Cleint_CNumber #Cleint_Address +get_client() +set_client() +void() Account -Account_number +Account_type +Amount +balance +getaccountdetails() +setaccountdetails() +getbalance() +setbalance() ATM machine +ATM_machineId +ATM_Location +getmachineinfo() ATM card -card_number -Expiry_date -CVC_code Savings Account +primaryaccount +secondaryaccount +setsavingsbalance() +getsavingsbalance() Business Account +Proprietor +BusinessPartner +getbusinessbalance() +setbusinessbalance() +getcard_details() Transaction +Trans_id +Trans_time +Trans_date +start_dur +end_dur +gettransaction_details() +gettransactionhistory(start_dur, end_dur)