Unit 221 UML Back Ground Class Diagrams Inheritance Hierarchy UML Patterns.

Slides:



Advertisements
Similar presentations
UML (cont.) “The Unified Modeling Language User Guide” by G. Booch, J. Rumbaugh and I. Jacobson ● Classes ● Relationships ● Class diagrams ● Examples.
Advertisements

LOGO Lecturer: Abdullahi Salad Abdi May 1, Object Oriented Programming in C++
Lecture Set 3E Introduction Basic Software Development Issues 1. Notes on Software Development 2. Intro to Software Development Tools 7/31/2008 2:43PM.
HST 952 Computing for Biomedical Scientists Lecture 9.
Stephen P. Carl - CS 2421 Recursive Sorting Algorithms Reading: Chapter 5.
21/3/00SEM107- Kamin & ReddyClass 15 - Recursive Sorting - 1 Class 15 - Recursive sorting methods r Processing arrays by recursion r Divide-and-conquer.
Inheritance Inheritance Reserved word protected Reserved word super
UML Class and Sequence Diagrams Violet Slides adapted from Marty Stepp, CSE 403, Winter 2012 CSE 403 Spring 2012 Anton Osobov.
Nyhoff, ADTs, Data Structures and Problem Solving with C++, Second Edition, © 2005 Pearson Education, Inc. All rights reserved Sorting.
Fundamentals of Algorithms MCS - 2 Lecture # 16. Quick Sort.
1 Software Testing and Quality Assurance Lecture 12 - The Testing Perspective (Chapter 2, A Practical Guide to Testing Object-Oriented Software)
1 Merge and Quick Sort Quick Sort Reading p
Merge- and Quick Sort Reading p Merge Sort Quick Sort.
1 Merge Sort Merge Sort Reading p A Sorting Pattern The most efficient sorting algorithms all seem to follow a divide-and-conquer strategy.
CHAPTER 11 Searching. 2 Introduction Searching is the process of finding a target element among a group of items (the search pool), or determining that.
Itntroduction to UML, page 1 Introduction to UML.
Unified Modeling Language (UML)
Programming With Java ICS201 University Of Hail1 Chapter 12 UML and Patterns.
Sorting Algorithms and Analysis Robert Duncan. Refresher on Big-O  O(2^N)Exponential  O(N^2)Quadratic  O(N log N)Linear/Log  O(N)Linear  O(log N)Log.
Sorting and Searching Arrays CSC 1401: Introduction to Programming with Java Week 12 – Lectures 1 & 2 Wanda M. Kunkle.
ALGORITHM ANALYSIS AND DESIGN INTRODUCTION TO ALGORITHMS CS 413 Divide and Conquer Algortihms: Binary search, merge sort.
1 Design Patterns for Object-Oriented Programming.
Programming With Java ICS201 University Of Hail1 Chapter 12 UML and Patterns.
Chapter 20 Patterns and UML. Copyright © 2006 Pearson Addison-Wesley. All rights reserved Learning Objectives  Patterns  Adapter pattern  Model-View-Controller.
Chapter 12 UML and Patterns.
CSCI-383 Object-Oriented Programming & Design Lecture 9.
CIT UPES | Sept 2013 | Unified Modeling Language - UML.
Introduction to UML By: Prof. Aiman Hanna Department of Computer Science, Concordia University, Montreal, Canada.
Copyright © 2012 Pearson Education, Inc. Chapter 13: Introduction to Classes.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 13: Introduction to Classes.
Modeling system requirements. Purpose of Models Models help an analyst clarify and refine a design. Models help simplify the complexity of information.
Copyright © 2013 Curt Hill UML Unified Modeling Language.
UML (U NIFIED M ODELING LANGUAGE ) Prepared by Miss Simab Shahid Lecturer computer Science and Software Engineering department, University.
An Introduction to the Unified Modeling Language
Copyright © 2002 Pearson Education, Inc. Slide 1.
Software Engineering Design & UML.
CSE 403, Spring 2008, Alverson Using UML to express Software Architecture.
CSE 403, Spring 2007, Alverson Using UML to express Software Architecture.
Introduction to UML CS A470. What is UML? Unified Modeling Language –OMG Standard, Object Management Group –Based on work from Booch, Rumbaugh, Jacobson.
Chapter 12 UML and Patterns Slides prepared by Rose Williams, Binghamton University Copyright © 2008 Pearson Addison-Wesley. All rights reserved.
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 1: Introduction.
Tom Meyer, Iowa State SCT/Pixel Online Workshop June, 2001 UML and OOAD Unified Modeling Language Object Oriented Analysis and.
Programming With Java ICS201 University Of Hail1 Chapter 12 UML and Patterns.
1 Inheritance Reserved word protected Reserved word super Overriding methods Class Hierarchies Reading for this lecture: L&L 9.1 – 9.4.
Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey A.
Copyright © 2012 Pearson Education, Inc. Chapter 13: Introduction to Classes.
CS Data Structures I Chapter 2 Principles of Programming & Software Engineering.
CSCI 3428: Software Engineering Tami Meredith UML Unified Modeling Language.
PREVIOUS SORTING ALGORITHMS  BUBBLE SORT –Time Complexity: O(n 2 ) For each item, make (n –1) comparisons Gives: Comparisons = (n –1) + (n – 2)
Copyright © 2015, 2012, 2009 Pearson Education, Inc., Publishing as Addison-Wesley All rights reserved. Chapter 13: Introduction to Classes.
Quicksort This is probably the most popular sorting algorithm. It was invented by the English Scientist C.A.R. Hoare It is popular because it works well.
Recursion ITI 1121 N. El Kadri. Reminders about recursion In your 1 st CS course (or its equivalent), you have seen how to use recursion to solve numerical.
Unified Modeling Language (UML)
A means of graphically displaying a complicated programs 18-Mar-16 UML Thanks to Dave Matuczek, UPenn.
UML. Model An abstract representation of a system. Types of model 1.Use case model 2.Domain model 3.Analysis object model 4.Implementation model 5.Test.
Introduction to Unified Modeling Language (UML) By Rick Mercer with help from The Unified Modeling Language User Guide, Grady Booch, James Rumbaugh, Ivar.
COP 3330 Notes 4/13. Today’s Topics UML Class Diagrams.
Chapter 20 Patterns and UML
Evolution of UML.
Object-Oriented Analysis and Design
Object-Oriented Modeling and Design
Introduction to Unified Modeling Language (UML)
Chapter 12 UML and Patterns
About the Presentations
An Introduction to Inheritance
Chapter 12 UML and Patterns
Sorting Chapter 13 Nyhoff, ADTs, Data Structures and Problem Solving with C++, Second Edition, © 2005 Pearson Education, Inc. All rights reserved
Quicksort and Mergesort
Chapter 12 UML and Patterns
Presentation transcript:

Unit 221 UML Back Ground Class Diagrams Inheritance Hierarchy UML Patterns

Unit 222 UML Back Ground UML stands for Unified Modeling Language UML is a graphical language used for designing and documenting OO software In 1996, Brady Booch, Ivar Jacobson, and James Rumbaugh released an early version of UML Since then, UML has been developed and revised in response to feedback from the OOP community –Today, the UML standard is maintained and certified by the Object Management Group (OMG)

Unit 223 UML Introduction Pseudo code is a way of representing a program in a linear and algebraic manner –It simplifies design by eliminating the details of programming language syntax Graphical representation systems for program design have also been used –Flowcharts and structure diagrams for example Unified Modeling Language (UML) is yet another graphical representation formalism –UML is designed to reflect and be used with the OOP philosophy

Unit 224 UML Class Diagrams Classes are central to OOP, and the class diagram is the easiest of the UML graphical representations to understand and use A class diagram is divided up into three sections –The top section contains the class name –The middle section contains the data specification for the class –The bottom section contains the actions or methods of the class

Unit 225 UML Class Diagrams The data specification for each piece of data in a UML diagram consists of its name, followed by a colon, followed by its type Each name is preceded by a character that specifies its access type: –A minus sign (-) indicates private access –A plus sign (+) indicates public access –A sharp (#) indicates protected access –A tilde (~) indicates package access

Unit 226 UML Class Diagrams Each method in a UML diagram is indicated by the name of the method, followed by its parenthesized parameter list, a colon, and its return type The access type of each method is indicated in the same way as for data

Unit 227 A UML Class Diagram

Unit 228 Inheritance Diagrams An inheritance diagram shows the relationship between a base class and its derived class(es) Each base class is drawn above its derived class(es) –An upward pointing arrow is drawn between them to indicate the inheritance relationship

Unit 229 Inheritance Diagram Example

Unit 2210 A Detailed UML Inheritance Hierarchy

Unit 2211 Patterns Patterns are design outlines that apply across a variety of software applications –To be useful, a pattern must apply across a variety of situations –To be substantive, a pattern must make some assumptions about the domain of applications to which it applies

Unit 2212 A Sorting Pattern Patterns are best explained by looking at examples The most efficient sorting algorithms all seem to follow a divide-and-conquer strategy Given an array a, and using the < operator, these sorting algorithms: –Divide the list of elements to be sorted into two smaller lists ( split ) –Recursively sort the two smaller lists ( sort ) –Then recombine the two sorted lists ( join ) to obtain the final sorted list

Unit 2213 A Sorting Pattern The method split rearranges the elements in the interval a[begin] through a[end] and divides the rearranged interval at splitPoint The two smaller intervals are then sorted by a recursive call to the method sort After the two smaller intervals are sorted, the method join combines them to obtain the final sorted version of the entire larger interval Note that the pattern does not say exactly how the methods split and join are defined –Different definitions of split and join will yield different sorting algorithms

Unit 2214 Merge Sort The simplest realization of this sorting pattern is the merge sort The definition of split is very simple –It divides the array into two intervals without rearranging the elements The definition of join is more complicated Note: There is a trade-off between the complexity of the methods split and join –Either one can be made simpler at the expense of making the other more complicated

Unit 2215 Quick Sort In the quick sort realization of the sorting pattern, the definition of split is quite sophisticated, while join is utterly simple –First, an arbitrary value called the splitting value is chosen –The elements in the array are rearranged: All elements less than or equal to the splitting value are placed at the front of the array All elements greater than the splitting value are placed at the back of the array The splitting value is placed in between the two

Unit 2216 Quick Sort Note that the smaller elements are not sorted, and the larger elements are not sorted –However, all the elements before the splitting value are smaller than any of the elements after the splitting value The smaller elements are then sorted by a recursive call, as are the larger elements Then these two sorted segments are combined – The join method actually does nothing

Unit 2217 Exercise public class Parent { int anumber; public void PrintQuiz( ) {} void PrintA( ) {} protected int PrintB( ) {} } class Child1 extends Parent { public char ID; public int getStatus( ){} public void setID( ){} } class Child2 extends Parent { private double Value; private void PrintValues( ) {} public boolean Method1( ) {} }