Fundamentals of Computer Science The Object-Oriented Paradigm and UML.

Slides:



Advertisements
Similar presentations
Ch:8 Design Concepts S.W Design should have following quality attribute: Functionality Usability Reliability Performance Supportability (extensibility,
Advertisements

IMS1805 Systems Analysis Topic 3: Doing Analysis (continued from previous weeks)
Object-Oriented Application Development Using VB.NET 1 Chapter 5 Object-Oriented Analysis and Design.
Systems Analysis and Design 8th Edition
Chapter 22 Object-Oriented Systems Analysis and Design and UML Systems Analysis and Design Kendall and Kendall Fifth Edition.
Unified Modeling Language
Classes and Object- Oriented... tMyn1 Classes and Object-Oriented Programming The essence of object-oriented programming is that you write programs in.
UML Class and Sequence Diagrams Violet Slides adapted from Marty Stepp, CSE 403, Winter 2012 CSE 403 Spring 2012 Anton Osobov.
2008/03/25 Unified Modeling Lanauage 1 Introduction to Unified Modeling Language (UML) – Part One Ku-Yaw Chang Assistant Professor.
Object-Oriented Analysis and Design
Department of Computing
Chapter 15: System Modeling with UML
Irwin/McGraw-Hill Copyright © 2004 The McGraw-Hill Companies. All Rights reserved Whitten Bentley DittmanSYSTEMS ANALYSIS AND DESIGN METHODS6th Edition.
7M701 1 Class Diagram advanced concepts. 7M701 2 Characteristics of Object Oriented Design (OOD) objectData and operations (functions) are combined 
Unified Modeling Language (UML)
Systems Analysis & Design Sixth Edition Systems Analysis & Design Sixth Edition Toolkit Part 5.
Chapter 1 Principles of Programming and Software Engineering.
© Copyright Eliyahu Brutman Programming Techniques Course.
WEL COME PRAVEEN M JIGAJINNI PGT (Computer Science) MCA, MSc[IT], MTech[IT],MPhil (Comp.Sci), PGDCA, ADCA, Dc. Sc. & Engg.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
Object Oriented Concepts. Movement toward Objects Instead of data-oriented or process-oriented Analysis, many firms are now moving to object-oriented.
C++ fundamentals.
Chapter 7: The Object-Oriented Approach to Requirements
Objects What are Objects Observations
OO Analysis and Design CMPS OOA/OOD Cursory explanation of OOP emphasizes ▫ Syntax  classes, inheritance, message passing, virtual, static Most.
UML Unified Modeling Language. What is UML? Unified Modeling Language (UML) is a standardized, general-purpose modeling language in the field of software.
Interactions. 2 Objects communicate with each other by sending messages. Sending a message is another name for a member function call. –Some C++ examples.
1 A Student Guide to Object- Orientated Systems Chapter 4 Objects and Classes: the basic concepts.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 20 Object-Oriented.
Unified Modeling Language, Version 2.0
Presented by: CHAN LAI SAN ( ) REBAH DAW SARREB ( ) FIDA AL-OBAISI ( ) 08 April 2008 (Tuesday 6pm – 7:30pm)
1 UML Basic Training. UML Basic training2 Agenda  Definitions: requirements, design  Basics of Unified Modeling Language 1.4  SysML.
Systems Analysis and Design in a Changing World, 3rd Edition
CS3773 Software Engineering Lecture 04 UML Class Diagram.
Chapter 5 Models and UML Notation for The Object-Oriented Approach.
Systems Analysis & Design 7 th Edition Chapter 5.
Programming Logic and Design Fourth Edition, Comprehensive Chapter 15 System Modeling with the UML.
Systems Analysis and Design 8 th Edition Chapter 6 Object Modeling.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 14 Slide 1 Object-oriented Design.
UML Use Case Diagramming Guidelines. What is UML? The Unified Modeling Language (UML) is a standard language for specifying, visualizing, constructing,
1 Class Diagrams: The Essentials. 2 Terms and Concepts A class is... The most important building block of any object-oriented system. A description of.
1 Class Diagrams: Advanced Concepts. 2 Overview Class diagrams are the most commonly used diagrams in UML. Class diagrams are the most commonly used diagrams.
Fall 2010 CS4310 Requirements Engineering A Brief Review of UML & OO Dr. Guoqiang Hu Department of Computer Science UTEP 1.
1 Introduction to UML. 2 What is UML? UML is an acronym for Unified Modeling Language. Unified –Combines the best from existing object- oriented software.
Object-Oriented Modeling: Static Models. Object-Oriented Modeling Model the system as interacting objects Model the system as interacting objects Match.
Learners Support Publications Object Oriented Programming.
1 Class Diagrams. 2 Overview Class diagrams are the most commonly used diagrams in UML. Class diagrams are for visualizing, specifying and documenting.
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
1 Introduction to Classes. 2 Terms and Concepts A class is... –The most important building block of any object- oriented system. –A description of a set.
Object-Oriented Application Development Using VB.NET 1 Chapter 5 Object-Oriented Analysis and Design.
Banaras Hindu University. A Course on Software Reuse by Design Patterns and Frameworks.
Object Oriented Programming and Data Abstraction Earl Huff Rowan University.
UML Fundamental Elements. Structural Elements Represent abstractions in our system. Elements that encapsulate the system's set of behaviors. Structural.
COP 4331 – OOD&P Lecture 7 Object Concepts. What is an Object Programming language definition: An instance of a class Design perspective is different.
Basic Characteristics of Object-Oriented Systems
Introduction to Unified Modeling Language (UML) By Rick Mercer with help from The Unified Modeling Language User Guide, Grady Booch, James Rumbaugh, Ivar.
Slide 1 Unified Modeling Language, Version 2.0 Object-Oriented SAD.
Object-oriented programming (OOP) is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their.
Interactions.
The Movement To Objects
Course Outcomes of Object Oriented Modeling Design (17630,C604)
CHAPTER 5 GENERAL OOP CONCEPTS.
Object-Oriented Analysis and Design
Unified Modeling Language
Software Design Lecture : 14.
Class Diagrams.
Copyright 2007 Oxford Consulting, Ltd
Chapter 5.
UML  UML stands for Unified Modeling Language. It is a standard which is mainly used for creating object- oriented, meaningful documentation models for.
Chapter 4 Sequence Diagrams
Presentation transcript:

Fundamentals of Computer Science The Object-Oriented Paradigm and UML

Object-Oriented versus Structured Paradigm nThe object-oriented paradigm is a response to shortcomings in the structured paradigm. n The structured approach does not work as well for large projects. nThe structured approach requires that you focus on the system’s data or actions individually. nThe object-oriented approach integrates actions and data so that they are both viewed at the same level of importance.

nObjects/Classes are superior because … n They have low coupling and high cohesion. n Data and actions are packaged together. Objects are self-contained. Integrity of the data is easier to maintain. n They support information hiding. They have a well-defined interface. Member data is inaccessible outside of object. n They are easy to reuse. For all the above reasons. Inheritance further enhances reusability. Object-Oriented versus Structured Paradigm

The Object-Oriented Paradigm nObject-oriented programming is a logical extension of the concept of modularity. nThe concept of objects was introduced in nObject-oriented programming began to gain wide spread acceptance in the mid-80’s. nThe object-oriented paradigm facilitates the construction of large systems by promoting high cohesion and low coupling.

The Object-Oriented Paradigm nThe primary benefit of object-oriented design/programming is that it facilitates software reusability. n Inheritance plays an important role in software reusability. nThe transition from the analysis phase and the implementation phase is less severe when the object-oriented approach is used. n Many of the same diagrams used in the analysis phase may also be used, with modification, in the design phase.

nThe object-oriented approach to software design is generally agreed to be superior to the structured approach; especially for large projects. nThe object-oriented paradigm is based on the following four principles: n Abstraction n Encapsulation n Inheritance n Polymorphism nFor a programming language to be object-oriented it must support the above principles. The Object-Oriented Paradigm

Abstraction nWhat is an abstraction? A simplification of reality in which essential features are extracted from a conceptual or real-world entity. nModels are types of abstractions. nWhat are models/abstractions used for? n To represent some physical or conceptual thing that is to be built. n As a plan of attack for solving a problem. n As a blueprint of the desired system. n As a means of communicating complex ideas to others. n As a means of viewing the “big picture”.

Encapsulation nEncapsulation is the act of combining data and the subroutines that act on that data in one entity, usually a class. nThe data is, in most cases, only directly accessible to the subroutines encapsulated with the data. nThe purpose of the subroutines is to protect the integrity of the accompanying data.

Object-Oriented Paradigm for a Bank Account System

Classes and Objects nAn objects is an instances of a class. nA class is... n The most important building block of any object- oriented system. n A description of a set of objects that share the same attributes and behaviors. n A blueprint for creating an object. n An abstraction (simplification) of reality. n A representation of a software thing, a hardware thing, or even a conceptual thing. n Graphically represented in UML as a rectangle.

nAll classes have … n Names - Used to distinguish one class from another. A class must have a name. n Attributes - Member data. n Operations (behaviors) - Member functions. nAttributes and operations are the most important features of a class definition. nA class usually collaborate with other classes. Classes and Objects

Inheritance nThere are different types of relationships that can exist between collaborating classes. nInheritance is … n A type of relationship that can exist between two classes. One of the classes is the base (or parent) class; the other class is the derived (or child) class. n Used to show a ‘kind-of’ relationship. n All OO programming languages support single inheritance; some (C++) also support multiple inheritance. n Graphically represented in UML by a solid line with an open triangular arrowhead on the base class end.

Association nAn association is … n A type of relationship that can exist between one or more classes. n Used to show a ‘knows-a’ relationship. n Either unidirectional or bi-directional. n Graphically represented in UML by a solid line which may optionally be labeled and have a name direction indicator. nAssociation names are verbs or verb phrases. nThe same class can be on both ends of a binary association.

Aggregation nAggregation is … n A relationship between two classes. n A form of association. n Used to show a ‘has-a’ relationship. n Graphically represented in UML as a solid line with an open diamond on the ‘whole’ end. nAggregations and associations are implemented in exactly the same way. The difference is entirely conceptual.

Composition nComposition is … n A relationship between two classes. n A strong form of association. n Used to show a ‘contains-a’ or a ‘whole-part’ relationship. n Graphically represented in UML as a solid line with a solid diamond on the ‘whole’ end. nComposition relationships and associations are not implemented in exactly the same way. nIf the ‘whole’ object is destroyed, the part object will also be destroyed.

Polymorphism nPolymorphism … n Is used in the context of inheritance, where each class in the inheritance hierarchy has a function (or functions) with the same signature. n Is also known as dynamic binding. n Is the technique of deferring until run-time the decision on the function within the hierarchy to call. n Promotes software reusability. n Reduces code complexity.

Class Modeling nHow are the classes that comprise a system chosen? n From scenarios. n From a problem statement. n From CRC (Class, Responsibility, Collaboration) cards. CRC cards are often derived from scenarios and problem statements. n From past experience working with similar systems.

nNoun extraction is a valuable tool in obtaining an initial list of potential classes. n Underline all of the nouns in the problem statement or scenarios. n Refine the list of nouns (potential classes) Remove redundant classes Remove vague classes Remove things best modeled as attributes. Remove irrelevant classes. Class Modeling

Class Modeling - CRC Cards

Overview of the Unified Modeling Language

Overview of UML nUML is a language. n Conforms to specific rules. n Allows the creation of various models. n Does not tell the designer which models need to be created. nUML is a language for visualizing. n UML is a graphical language. n Pictures facilitate communication (a picture is worth a thousand words). nUML is a language for constructing and understanding. n UML supports both forward and reverse engineering.

nUML is a language for documenting design n Provides a record of what has been built. n Useful for bringing new programmers up to speed. n Useful when developing new releases of product. nUML is intended primarily for software- intensive systems Overview of UML

UML Relationship Syntax

UML Class Icon Syntax

nSequence diagrams... n Are one technique used by UML to model the dynamic aspects of a system. n Emphasize the time ordering of message traffic between objects. n Aid the developer visualize the system as it is running. n Are storyboards of selected sequences of message traffic between objects. nAfter class diagrams, sequence diagrams are the most widely used diagrams in UML. nSequence diagrams commonly contain objects and messages. Dynamic Modeling Using UML

nSequence diagrams are build around an X-Y axis. n Objects are aligned (in most cases) at the top of the diagram, parallel to the X axis. n Messages travel (in most cases) parallel to the X axis. n Time passes from top to bottom along the Y axis. n Where a message arrow appears relative to the Y axis and other message arrows, determines the relative time the message is sent. n Sequence diagrams most commonly show relative timings, not absolute timings. n Links between objects are implied by the existence of a message. Sequence Diagrams

UML Sequence Diagram Syntax