SlideShare ist ein Scribd-Unternehmen logo
1 von 63
Object Oriented Analysis and Design
           Using the UML


Introduction to Object Orientation
Objectives: Introduction to Object Orientation
  • Understand the basic principles of object
    orientation
  • Understand the basic concepts and terms of
    object orientation and the associated UML
    notation
  • Appreciate the strengths of object
    orientation
  • Understand some basic UML modeling
    mechanisms
Introduction to Object Orientation Topics
  •   Basic Principles of Object Orientation
  •   Basic Concepts of Object Orientation
  •   Strengths of Object Orientation
  •   General UML Modeling Mechanisms
Basic Principles of Object Orientation

                     Object Orientation



      Abstraction
                    Encapsulation
                               Modularity
                                            Hierarchy
What is Abstraction?



                       Salesperson
                       Not saying
                       Which
                       salesperson –
                       just a
                       salesperson
                       in general!!!

                                        Product
      Customer


                   Manages Complexity
What is Encapsulation?
  • Hide implementation from clients
    o   Clients depend on interface




                                  How does an object
                                  encapsulate?
                                  What does it encapsulate?

                      Improves Resiliency
What is Modularity?
  • The breaking up of something complex into
    manageable pieces
                                                    Order
                                                    Entry

    Order Processing
        System                          Order
                                      Fulfillment



                                                    Billing

                       Manages Complexity
What is Hierarchy?
                                                 Asset
  • Levels of abstraction
 Increasing
 abstraction




                  BankAccount                  Security                RealEstate




               Savings Checking          Stock           Bond

 Decreasing       Elements at the same level of the hierarchy should
 abstraction             be at the same level of abstraction
Introduction to Object Orientation Topics
  •   Basic Principles of Object Orientation
  •   Basic Concepts of Object Orientation
  •   Strengths of Object Orientation
  •   General UML Modeling Mechanisms
Basic Concepts of Object Orientation
  •   Object
  •   Class
  •   Attribute
  •   Operation
  •   Interface (Polymorphism)
  •   Component
  •   Package
  •   Subsystem
  •   Relationships
Basic Concepts of Object Orientation
  •   Object
  •   Class
  •   Attribute
  •   Operation
  •   Interface (Polymorphism)
  •   Component
  •   Package
  •   Subsystem
  •   Relationships
What is an Object?
  • Informally, an object represents an entity,
    either physical, conceptual, or software
  •
  • Physical entity
  •                           Truck

  • Conceptual entity

  •
  • Software entity     Chemical Process




                                Linked List
A More Formal Definition
  • An object is a concept, abstraction, or thing
    with sharp boundaries and meaning for an
    application
  • An object is something that has:
    o   State
    o   Behavior
    o   Identity
Representing Objects
  • An object is represented as rectangles with
    underlined names
    : Professor
                                             a + b = 10

                         ProfessorClark
   Class Name Only
                                             Professor Clark
 ProfessorClark :
    Professor             Object Name Only



 Class and Object Name
                                              (stay tuned for classes)
Basic Concepts of Object Orientation
  •   Object
  •   Class
  •   Attribute
  •   Operation
  •   Interface (Polymorphism)
  •   Component
  •   Package
  •   Subsystem
  •   Relationships
What is a Class?
  • A class is a description of a group of objects
    with common properties (attributes),
    behavior (operations), relationships, and
    semantics
    o   An object is an instance of a class
  • A class is an abstraction in that it:
    o   Emphasizes relevant characteristics
    o   Suppresses other characteristics



                 OO Principle: Abstraction
Sample Class

                          Class
                          Course
   Properties                           Behavior
     Name                             Add a student
    Location                         Delete a student
  Days offered   a + b = 10         Get course roster
  Credit hours                     Determine if it is full
   Start time
    End time
Representing Classes
  • A class is represented using a
    compartmented rectangle


                           a + b = 10
         Professor


                           Professor Clark
Class Compartments
  • A class is comprised of three sections
    o The first section contains the class name
    o The second section shows the structure
      (attributes)
    o The third section shows the behavior
      (operations)

         Class Name      Professor
                         name
          Attributes     empID
          Operations     create( )
                         save( )
                         delete( )
                         change( )
Classes of Objects
  • How many classes do you see?
The Relationship Between Classes and Objects
  • A class is an abstract definition of an object
      o It defines the structure and behavior of each
        object in the class
      o It serves as a template for creating objects
  • Objects are grouped into classes
                     Objects                              Class

                                                        Professor

 Professor Smith                     Professor Mellon



                   Professor Jones
Basic Concepts of Object Orientation
  •   Object
  •   Class
  •   Attribute
  •   Operation
  •   Interface (Polymorphism)
  •   Component
  •   Package
  •   Subsystem
  •   Relationships
What is an Attribute?

                                       Object
Class

 Attribute                Attribute Value
                                                 :CourseOffering
                                                number = 101
                                                startTime = 900
         CourseOffering                         endTime = 1100
        number
        startTime
        endTime                                  :CourseOffering
                                                number = 104
                                                startTime = 1300
                                                endTime = 1500
Basic Concepts of Object Orientation
  •   Object
  •   Class
  •   Attribute
  •   Operation
  •   Interface (Polymorphism)
  •   Component
  •   Package
  •   Subsystem
  •   Relationships
What is an Operation?


                   CourseOffering
     Class
                 addStudent
                 deleteStudent
                 getStartTime
     Operation   getEndTime
Basic Concepts of Object Orientation
  •   Object
  •   Class
  •   Attribute
  •   Operation
  •   Interface (Polymorphism)
  •   Component
  •   Package
  •   Subsystem
  •   Relationships
What is Polymorphism?
  • The ability to hide many different
    implementations behind a single interface




                        Manufacturer B
       Manufacturer A                    Manufacturer C



      OO Principle:
      Encapsulation
What is an Interface?
  • Interfaces formalize polymorphism
  • Interfaces support “plug-and-play”
    architectures
                                                            Tube
               <<interface>>
                 Shape
                                                           Pyramid
      Draw
      Move
      Scale
      Rotate                                                Cube




                      Realization relationship   (stay tuned for realization relationships)
Interface Representations
                                                                        Tube
Elided/Iconic
Representation
(“lollipop”)
                                                                      Pyramid



                       Shape                                            Cube



Canonical                                                               Tube
(Class/Stereotype)        <<interface>>
Representation                Shape
                                                                      Pyramid
                     Draw
                     Move
                     Scale
                     Rotate
                                                                        Cube

                                          (stay tuned for realization relationships)
Basic Concepts of Object Orientation
  •   Object
  •   Class
  •   Attribute
  •   Operation
  •   Interface (Polymorphism)
  •   Component
  •   Package
  •   Subsystem
  •   Relationships
What is a Component?
  • A non-trivial, nearly independent, and
    replaceable part of a system that fulfills a
    clear function in the context of a well-
    defined architecture
  • A component may be
    o   A source code component         OO Principle:
    o   A run time components or        Encapsulation
    o   An executable component

     Source File     <<EXE>>                    <<DLL>>
     Name            Executable                 Component
                     Name          Component    Name
                                   Interface
Basic Concepts of Object Orientation
  •   Object
  •   Class
  •   Attribute
  •   Operation
  •   Interface (Polymorphism)
  •   Component
  •   Package
  •   Subsystem
  •   Relationships
What is a Package?
  • A package is a general purpose mechanism
    for organizing elements into groups
  • A model element which can contain other
    model elements

                                    OO Principle:
                   Package Name      Modularity

  • Uses
    o   Organize the model under development
    o   A unit of configuration management
Basic Concepts of Object Orientation
  •   Object
  •   Class
  •   Attribute
  •   Operation
  •   Interface (Polymorphism)
  •   Component
  •   Package
  •   Subsystem
  •   Relationships
What is a Subsystem?
    • A combination of a package (can contain
      other model elements) and a class (has
      behavior)
    • Realizes one or more interfaces which
      define its behavior
            Realization
                                                              Subsystem
                                 <<subsystem>>
Interface                        Subsystem Name
                     Interface

            OO Principles: Encapsulation and Modularity
                                          (stay tuned for realization relationship)
Subsystems and Components
 • Components are the physical realization of
   an abstraction in the design
 • Subsystems can be used to represent the
   component in the design
                 Design Model          Implementation Model



                <<subsystem>>                    Component
                Component Name                   Name
 Component                        Component
 Interface                        Interface


             OO Principles: Encapsulation and Modularity
Basic Concepts of Object Orientation
  •   Object
  •   Class
  •   Attribute
  •   Operation
  •   Interface (Polymorphism)
  •   Component
  •   Package
  •   Subsystem
  •   Relationships
Relationships
  • Association
     o Aggregation
     o Composition
  • Dependency
  • Generalization
  • Realization
Relationships: Association
  • Models a semantic connection among
    classes
         Association Name



   Professor         Works for        University



                    Association
                                       Role Names

     Class                                               University
                 Professor
                                  Employee    Employer
Relationships: Aggregation
  • A special form of association that models a
    whole-part relationship between an
    aggregate (the whole) and its parts
  Whole                                      Part




          Student                 Schedule



                    Aggregation
Relationships: Composition
  • A form of aggregation with strong ownership
    and coincident lifetimes
    o   The parts cannot survive the whole/aggregate
   Whole                                         Part




           Student                    Schedule



                        Aggregation
Association: Multiplicity and Navigation
  • Multiplicity defines how many objects
    participate in a relationships
    o The number of instances of one class related to
      ONE instance of the other class
    o Specified for each end of the association
  • Associations and aggregations are bi-
    directional by default, but it is often
    desirable to restrict navigation to one
    direction
    o   If navigation is restricted, an arrowhead is added
        to indicate the direction of the navigation
Association: Multiplicity
  • Unspecified
  • Exactly one                   1
  • Zero or more (many, unlimited)
                                  0..*

  •   One or more                 *

  •   Zero or one                 1..*

  •   Specified range             0..1

  •   Multiple, disjoint ranges   2..4

                                  2, 4..6
Example: Multiplicity and Navigation


                        Multiplicity


       Student      1                  0..*   Schedule



                   Navigation
Relationships: Dependency
  • A relationship between two model elements
    where a change in one may cause a
    change in the other
  • Non-structural, “using” relationship
                Client                        Supplier       Component
Class


Package                                             Client                  Supplier
                         Dependency
                         relationship

        ClientPackage                   SupplierPackage
                                                             Dependency
                                                             relationship
Relationships: Generalization
  • A relationship among classes where one
    class shares the structure and/or behavior
    of one or more classes
  • Defines a hierarchy of abstractions in which
    a subclass inherits from one or more
    superclasses
    o   Single inheritance
    o   Multiple inheritance
  • Generalization is an “is-a-kind of”
    relationship
Example: Single Inheritance
  • One class inherits from another
                             Ancestor

                           Account
                       balance
                       name
     Superclass        number
      (parent)
                       Withdraw()
                       CreateStatement()
                                                        Generalization
                                                         Relationship



                  Checking                Savings

     Subclasses   Withdraw()            GetInterest()
                                        Withdraw()

                         Descendents
Example: Multiple Inheritance
  • A class can inherit from several other
    classes
          FlyingThing                            Animal


                              multiple
                            inheritance



   Airplane    Helicopter    Bird         Wolf            Horse



        Use multiple inheritance only when needed, and
                      always with caution !
What Gets Inherited?
  • A subclass inherits its parent’s attributes,
    operations, and relationships
  • A subclass may:
    o Add additional attributes, operations,
      relationships
    o Redefine inherited operations (use caution!)
  • Common attributes, operations, and/or
    relationships are shown at the highest
    applicable level in the hierarchy

     Inheritance leverages the similarities among classes
Example: What Gets Inherited


                              GroundVehicle
                                                           owner         Person
    Superclass            weight
     (parent)             licenseNumber        0..*            1

                          register( )
                                                        generalization



                        Car                    Truck                      Trailer
     Subclass    size                         tonnage
                                              getTax( )
Relationships: Realization
  • One classifier serves as the contract that the other classifier
    agrees to carry out
  • Found between:
     o Interfaces and the classifiers that realize them
     o Use cases and the collaborations that realize them



             Class                                             Component
                               Subsystem
Interface                                       Interface
                       Interface
                               Elided form


                              Canonical form


            Use Case                            Use-Case Realization
In
     •   Basic Principles of Object Orientation
     •   Basic Concepts of Object Orientation
     •   Strengths of Object Orientation
     •   General UML Modeling Mechanisms
Strengths of Object Orientation
  • A single paradigm
  • Facilitates architectural and code reuse
  • Models more closely reflect the real world
    o More accurately describe corporate data and
      processes
    o Decomposed based on natural partitioning
    o Easier to understand and maintain
  • Stability
    o   A small change in requirements does not mean
        massive changes in the system under
        development
Class Diagram for the Sales Example


                                        Sale




          seller           buyer                    item sold        shipping mechanism
     Salesperson           Customer                Product            Vehicle




                   Corporate          Individual             Truck              Train
Effect of Requirements Change
   Suppose you need a new
   type of shipping vehicle
   ...                               Sale




      seller            buyer                    item sold     shipping mechanism
  Salesperson           Customer                Product          Vehicle




                Corporate          Individual        Truck       Train         Airplane




                                                Change involves adding a new subclass
Introduction to Object Orientation Topics
  •   Basic Principles of Object Orientation
  •   Basic Concepts of Object Orientation
  •   Strengths of Object Orientation
  •   General UML Modeling Mechanisms
Stereotypes
  • Classify and extend the UML notational
    elements
  • Define a new model element in terms of
    another model element
  • May be applied to all modeling elements
  • Represented with name in guillemets or as
    a different icon

                                <<boundary>>
                               MyBoundaryClass

     MyBoundaryClass
Example: Stereotypes

                                          <<boundary>>



  <<boundary>>
                                               Sample boundary class
             <<trace>>                         (stereotype)
                            DesignClass        Stereotype of ‘dependency
                                               relation’
                                               Stereotype of <<Processor>>

                                               These create new symbols using
                                               accustomed graphics.

            <<Processor>>
             Processor #1
                                             Processor #1
Notes
  • A note can be added to any UML element
  • Notes may be added to add more
    information to the diagram
  • It is a ‘dog eared’ rectangle
  • The note may be anchored to an element
    with a dashed line
                           There can be up to one
                           MaintainScheduleForm per
    MaintainScheduleForm   user session.
Tagged Values
  • Extensions of the properties, or specific
    attributes, of a UML element
  • Some properties are defined by UML
    o   Persistence
    o   Location (e.g., client, server)
  • Properties can be created by UML modelers
    for any purpose

               PersistentClass
                {persistence}             anObject : ClassA
                                          {location=server}
Constraints
  • Supports the addition of new rules or
    modification of existing rules



                        Member                               1
     Professor                                                   Department
                        1..*
                                                      {subset}
                        Department Head
                         1                                   1

   This notation is used to capture two relationships between Professor-type
   objects
   and Department-type objects; where one relationship is a subset of
   another….

   Shows how UML can be tailored to correctly modeling exact relationships….
Review: Introduction to Object Orientation
  • What are the four basic principles of object
    orientation? Provide a brief description of
    each.
  • What is an Object and what is a Class?
    What is the difference between them?
  • What is an Attribute?
  • What is an Operation?
  • What is an Interface? What is
    Polymorphism?
  • What is a Component?
                                        (continued)
Review: Introduction to Object Orientation (cont.)
  • What is a Package?
  • What is Subsystem? How does it relate to a
    Component? How does it relate to a
    package? How does it relate to a class?
  • Name the 4 basic UML relationships and
    describe each.
  • Describe the strengths of object orientation.
  • Name and describe some general UML
    mechanisms.
  • What are stereotypes? Name some
    common uses of stereotypes.

Weitere ähnliche Inhalte

Was ist angesagt?

WINDA ARIKA SKRIPSI
WINDA ARIKA SKRIPSIWINDA ARIKA SKRIPSI
WINDA ARIKA SKRIPSI
mrifqis
 
Java (Netbeans) - Exception handling - Object Oriented Programming
Java (Netbeans) - Exception handling - Object Oriented ProgrammingJava (Netbeans) - Exception handling - Object Oriented Programming
Java (Netbeans) - Exception handling - Object Oriented Programming
Melina Krisnawati
 
Logical Agents
Logical AgentsLogical Agents
Logical Agents
Yasir Khan
 
Operating System--Memory
Operating System--MemoryOperating System--Memory
Operating System--Memory
Everhythm Past
 

Was ist angesagt? (20)

Logika matematika
Logika matematikaLogika matematika
Logika matematika
 
Representasi Pengetahuan
Representasi PengetahuanRepresentasi Pengetahuan
Representasi Pengetahuan
 
Unix system programming
Unix system programmingUnix system programming
Unix system programming
 
Maximum Matching in General Graphs
Maximum Matching in General GraphsMaximum Matching in General Graphs
Maximum Matching in General Graphs
 
Representasi Pengetahuan
Representasi PengetahuanRepresentasi Pengetahuan
Representasi Pengetahuan
 
Matematika Logika - Kalkulus Proposisi bagian 2 Oleh Yeni Fatman, ST
Matematika Logika - Kalkulus Proposisi bagian 2 Oleh Yeni Fatman, STMatematika Logika - Kalkulus Proposisi bagian 2 Oleh Yeni Fatman, ST
Matematika Logika - Kalkulus Proposisi bagian 2 Oleh Yeni Fatman, ST
 
Middleware and Middleware in distributed application
Middleware and Middleware in distributed applicationMiddleware and Middleware in distributed application
Middleware and Middleware in distributed application
 
Lecture3 - Machine Learning
Lecture3 - Machine LearningLecture3 - Machine Learning
Lecture3 - Machine Learning
 
Learning in AI
Learning in AILearning in AI
Learning in AI
 
Np hard
Np hardNp hard
Np hard
 
WINDA ARIKA SKRIPSI
WINDA ARIKA SKRIPSIWINDA ARIKA SKRIPSI
WINDA ARIKA SKRIPSI
 
Java (Netbeans) - Exception handling - Object Oriented Programming
Java (Netbeans) - Exception handling - Object Oriented ProgrammingJava (Netbeans) - Exception handling - Object Oriented Programming
Java (Netbeans) - Exception handling - Object Oriented Programming
 
Final Exam OS fall 2012-2013 with answers
Final Exam OS fall 2012-2013 with answersFinal Exam OS fall 2012-2013 with answers
Final Exam OS fall 2012-2013 with answers
 
Logical Agents
Logical AgentsLogical Agents
Logical Agents
 
Grid computing
Grid computingGrid computing
Grid computing
 
Operating System--Memory
Operating System--MemoryOperating System--Memory
Operating System--Memory
 
Ch 6 final
Ch 6 finalCh 6 final
Ch 6 final
 
Distributed systems scheduling
Distributed systems schedulingDistributed systems scheduling
Distributed systems scheduling
 
Deadlock Detection in Distributed Systems
Deadlock Detection in Distributed SystemsDeadlock Detection in Distributed Systems
Deadlock Detection in Distributed Systems
 
05c neural network-mlp
05c neural network-mlp05c neural network-mlp
05c neural network-mlp
 

Andere mochten auch

Uml Presentation
Uml PresentationUml Presentation
Uml Presentation
mewaseem
 
An introduction to uml
An introduction to umlAn introduction to uml
An introduction to uml
Tony Huynh
 
Presentation - Rational Unified Process
Presentation - Rational Unified ProcessPresentation - Rational Unified Process
Presentation - Rational Unified Process
Sharad Srivastava
 
INTRODUCTION TO UML DIAGRAMS
INTRODUCTION TO UML DIAGRAMSINTRODUCTION TO UML DIAGRAMS
INTRODUCTION TO UML DIAGRAMS
Ashita Agrawal
 
Rosinesita
RosinesitaRosinesita
Rosinesita
galcec
 
Inventions: The computer
Inventions: The computerInventions: The computer
Inventions: The computer
andreasupertino
 
On The Day the Last Nuclear Weapon is Destroyed
On The Day the Last Nuclear Weapon is DestroyedOn The Day the Last Nuclear Weapon is Destroyed
On The Day the Last Nuclear Weapon is Destroyed
kenleybutler
 

Andere mochten auch (20)

UML- Unified Modeling Language
UML- Unified Modeling LanguageUML- Unified Modeling Language
UML- Unified Modeling Language
 
UML Diagrams
UML DiagramsUML Diagrams
UML Diagrams
 
Uml - An Overview
Uml - An OverviewUml - An Overview
Uml - An Overview
 
Uml Presentation
Uml PresentationUml Presentation
Uml Presentation
 
Uml diagrams
Uml diagramsUml diagrams
Uml diagrams
 
Introduction to UML
Introduction to UMLIntroduction to UML
Introduction to UML
 
Introduction to UML
Introduction to UMLIntroduction to UML
Introduction to UML
 
An introduction to uml
An introduction to umlAn introduction to uml
An introduction to uml
 
Iterative Incremental development
Iterative Incremental developmentIterative Incremental development
Iterative Incremental development
 
Sequence diagram- UML diagram
Sequence diagram- UML diagramSequence diagram- UML diagram
Sequence diagram- UML diagram
 
Iterative model
Iterative modelIterative model
Iterative model
 
Presentation - Rational Unified Process
Presentation - Rational Unified ProcessPresentation - Rational Unified Process
Presentation - Rational Unified Process
 
Unified process
Unified processUnified process
Unified process
 
INTRODUCTION TO UML DIAGRAMS
INTRODUCTION TO UML DIAGRAMSINTRODUCTION TO UML DIAGRAMS
INTRODUCTION TO UML DIAGRAMS
 
27 NP Completness
27 NP Completness27 NP Completness
27 NP Completness
 
Rosinesita
RosinesitaRosinesita
Rosinesita
 
Inventions: The computer
Inventions: The computerInventions: The computer
Inventions: The computer
 
Hemp History China
Hemp History ChinaHemp History China
Hemp History China
 
On The Day the Last Nuclear Weapon is Destroyed
On The Day the Last Nuclear Weapon is DestroyedOn The Day the Last Nuclear Weapon is Destroyed
On The Day the Last Nuclear Weapon is Destroyed
 
WWI 5 Weapons
WWI 5 WeaponsWWI 5 Weapons
WWI 5 Weapons
 

Ähnlich wie Ooad Uml

M01 Oo Intro
M01 Oo IntroM01 Oo Intro
M01 Oo Intro
Dang Tuan
 
Lecture#01, object orientation
Lecture#01, object orientationLecture#01, object orientation
Lecture#01, object orientation
babak danyal
 
Object Oriented Programming_combined.ppt.pdf
Object Oriented Programming_combined.ppt.pdfObject Oriented Programming_combined.ppt.pdf
Object Oriented Programming_combined.ppt.pdf
AshutoshKumar211882
 
Framework Engineering_Final
Framework Engineering_FinalFramework Engineering_Final
Framework Engineering_Final
YoungSu Son
 

Ähnlich wie Ooad Uml (20)

object oriented programming(PYTHON)
object oriented programming(PYTHON)object oriented programming(PYTHON)
object oriented programming(PYTHON)
 
introduction of Object oriented programming
introduction of Object oriented programmingintroduction of Object oriented programming
introduction of Object oriented programming
 
Cascon2011_5_rules+owl
Cascon2011_5_rules+owlCascon2011_5_rules+owl
Cascon2011_5_rules+owl
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
M01 Oo Intro
M01 Oo IntroM01 Oo Intro
M01 Oo Intro
 
Intro to oop.pptx
Intro to oop.pptxIntro to oop.pptx
Intro to oop.pptx
 
Lecture#01, object orientation
Lecture#01, object orientationLecture#01, object orientation
Lecture#01, object orientation
 
Introduction to Object Oriented Concepts
Introduction to Object Oriented Concepts Introduction to Object Oriented Concepts
Introduction to Object Oriented Concepts
 
M01_OO_Intro.ppt
M01_OO_Intro.pptM01_OO_Intro.ppt
M01_OO_Intro.ppt
 
Scala: functional programming for the imperative mind
Scala: functional programming for the imperative mindScala: functional programming for the imperative mind
Scala: functional programming for the imperative mind
 
Introduction of object oriented analysis &amp; design by sarmad baloch
Introduction of object oriented analysis &amp; design by sarmad balochIntroduction of object oriented analysis &amp; design by sarmad baloch
Introduction of object oriented analysis &amp; design by sarmad baloch
 
Object oriented programming concepts
Object oriented programming conceptsObject oriented programming concepts
Object oriented programming concepts
 
Object oriented programming concepts
Object oriented programming conceptsObject oriented programming concepts
Object oriented programming concepts
 
M01_OO_Intro.ppt
M01_OO_Intro.pptM01_OO_Intro.ppt
M01_OO_Intro.ppt
 
Object Oriented Programming_combined.ppt.pdf
Object Oriented Programming_combined.ppt.pdfObject Oriented Programming_combined.ppt.pdf
Object Oriented Programming_combined.ppt.pdf
 
Object Oriented Concepts in Real Projects
Object Oriented Concepts in Real ProjectsObject Oriented Concepts in Real Projects
Object Oriented Concepts in Real Projects
 
Framework Engineering_Final
Framework Engineering_FinalFramework Engineering_Final
Framework Engineering_Final
 
OOPS in Java
OOPS in JavaOOPS in Java
OOPS in Java
 
Oot
OotOot
Oot
 
Intro to Object Oriented Programming with Java
Intro to Object Oriented Programming with Java Intro to Object Oriented Programming with Java
Intro to Object Oriented Programming with Java
 

Mehr von Dang Tuan

Javascript for php developer
Javascript for php developerJavascript for php developer
Javascript for php developer
Dang Tuan
 
Power your web skills
Power your web skillsPower your web skills
Power your web skills
Dang Tuan
 
Ube Databases
Ube DatabasesUbe Databases
Ube Databases
Dang Tuan
 
Session02 Part Ii
Session02 Part IiSession02 Part Ii
Session02 Part Ii
Dang Tuan
 
PHÂN TÍCH VÀ THIẾT KẾ HỆ THỐNG DÙNG UML
PHÂN TÍCH VÀ THIẾT KẾ HỆ THỐNG DÙNG UMLPHÂN TÍCH VÀ THIẾT KẾ HỆ THỐNG DÙNG UML
PHÂN TÍCH VÀ THIẾT KẾ HỆ THỐNG DÙNG UML
Dang Tuan
 
M02 Uml Overview
M02 Uml OverviewM02 Uml Overview
M02 Uml Overview
Dang Tuan
 
UML for OOAD
UML for OOADUML for OOAD
UML for OOAD
Dang Tuan
 
Object-Oriented Analysis & Design (OOAD) Domain Modeling Introduction
  Object-Oriented Analysis & Design (OOAD)  Domain Modeling Introduction  Object-Oriented Analysis & Design (OOAD)  Domain Modeling Introduction
Object-Oriented Analysis & Design (OOAD) Domain Modeling Introduction
Dang Tuan
 
Introduction to Modeling Java and UML
Introduction to Modeling Java and UMLIntroduction to Modeling Java and UML
Introduction to Modeling Java and UML
Dang Tuan
 
Information Systems Analysis and Design Overview of OOAD, UML, and RUP
 Information Systems Analysis and Design Overview of OOAD, UML, and RUP Information Systems Analysis and Design Overview of OOAD, UML, and RUP
Information Systems Analysis and Design Overview of OOAD, UML, and RUP
Dang Tuan
 
Ooad Overview
Ooad OverviewOoad Overview
Ooad Overview
Dang Tuan
 
M03 2 Behavioral Diagrams
M03 2 Behavioral DiagramsM03 2 Behavioral Diagrams
M03 2 Behavioral Diagrams
Dang Tuan
 
M05 Metamodel
M05 MetamodelM05 Metamodel
M05 Metamodel
Dang Tuan
 
M04 Design Patterns
M04 Design PatternsM04 Design Patterns
M04 Design Patterns
Dang Tuan
 
M03 1 Structuraldiagrams
M03 1 StructuraldiagramsM03 1 Structuraldiagrams
M03 1 Structuraldiagrams
Dang Tuan
 

Mehr von Dang Tuan (20)

Javascript for php developer
Javascript for php developerJavascript for php developer
Javascript for php developer
 
Power your web skills
Power your web skillsPower your web skills
Power your web skills
 
Ube Databases
Ube DatabasesUbe Databases
Ube Databases
 
Chapter1
Chapter1Chapter1
Chapter1
 
Chapter9
Chapter9Chapter9
Chapter9
 
Chapter3
Chapter3Chapter3
Chapter3
 
Chapter7
Chapter7Chapter7
Chapter7
 
Chapter5
Chapter5Chapter5
Chapter5
 
Session02 Part Ii
Session02 Part IiSession02 Part Ii
Session02 Part Ii
 
PHÂN TÍCH VÀ THIẾT KẾ HỆ THỐNG DÙNG UML
PHÂN TÍCH VÀ THIẾT KẾ HỆ THỐNG DÙNG UMLPHÂN TÍCH VÀ THIẾT KẾ HỆ THỐNG DÙNG UML
PHÂN TÍCH VÀ THIẾT KẾ HỆ THỐNG DÙNG UML
 
M02 Uml Overview
M02 Uml OverviewM02 Uml Overview
M02 Uml Overview
 
UML for OOAD
UML for OOADUML for OOAD
UML for OOAD
 
Object-Oriented Analysis & Design (OOAD) Domain Modeling Introduction
  Object-Oriented Analysis & Design (OOAD)  Domain Modeling Introduction  Object-Oriented Analysis & Design (OOAD)  Domain Modeling Introduction
Object-Oriented Analysis & Design (OOAD) Domain Modeling Introduction
 
Introduction to Modeling Java and UML
Introduction to Modeling Java and UMLIntroduction to Modeling Java and UML
Introduction to Modeling Java and UML
 
Information Systems Analysis and Design Overview of OOAD, UML, and RUP
 Information Systems Analysis and Design Overview of OOAD, UML, and RUP Information Systems Analysis and Design Overview of OOAD, UML, and RUP
Information Systems Analysis and Design Overview of OOAD, UML, and RUP
 
Ooad Overview
Ooad OverviewOoad Overview
Ooad Overview
 
M03 2 Behavioral Diagrams
M03 2 Behavioral DiagramsM03 2 Behavioral Diagrams
M03 2 Behavioral Diagrams
 
M05 Metamodel
M05 MetamodelM05 Metamodel
M05 Metamodel
 
M04 Design Patterns
M04 Design PatternsM04 Design Patterns
M04 Design Patterns
 
M03 1 Structuraldiagrams
M03 1 StructuraldiagramsM03 1 Structuraldiagrams
M03 1 Structuraldiagrams
 

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Kürzlich hochgeladen (20)

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 

Ooad Uml

  • 1. Object Oriented Analysis and Design Using the UML Introduction to Object Orientation
  • 2. Objectives: Introduction to Object Orientation • Understand the basic principles of object orientation • Understand the basic concepts and terms of object orientation and the associated UML notation • Appreciate the strengths of object orientation • Understand some basic UML modeling mechanisms
  • 3. Introduction to Object Orientation Topics • Basic Principles of Object Orientation • Basic Concepts of Object Orientation • Strengths of Object Orientation • General UML Modeling Mechanisms
  • 4. Basic Principles of Object Orientation Object Orientation Abstraction Encapsulation Modularity Hierarchy
  • 5. What is Abstraction? Salesperson Not saying Which salesperson – just a salesperson in general!!! Product Customer Manages Complexity
  • 6. What is Encapsulation? • Hide implementation from clients o Clients depend on interface How does an object encapsulate? What does it encapsulate? Improves Resiliency
  • 7. What is Modularity? • The breaking up of something complex into manageable pieces Order Entry Order Processing System Order Fulfillment Billing Manages Complexity
  • 8. What is Hierarchy? Asset • Levels of abstraction Increasing abstraction BankAccount Security RealEstate Savings Checking Stock Bond Decreasing Elements at the same level of the hierarchy should abstraction be at the same level of abstraction
  • 9. Introduction to Object Orientation Topics • Basic Principles of Object Orientation • Basic Concepts of Object Orientation • Strengths of Object Orientation • General UML Modeling Mechanisms
  • 10. Basic Concepts of Object Orientation • Object • Class • Attribute • Operation • Interface (Polymorphism) • Component • Package • Subsystem • Relationships
  • 11. Basic Concepts of Object Orientation • Object • Class • Attribute • Operation • Interface (Polymorphism) • Component • Package • Subsystem • Relationships
  • 12. What is an Object? • Informally, an object represents an entity, either physical, conceptual, or software • • Physical entity • Truck • Conceptual entity • • Software entity Chemical Process Linked List
  • 13. A More Formal Definition • An object is a concept, abstraction, or thing with sharp boundaries and meaning for an application • An object is something that has: o State o Behavior o Identity
  • 14. Representing Objects • An object is represented as rectangles with underlined names : Professor a + b = 10 ProfessorClark Class Name Only Professor Clark ProfessorClark : Professor Object Name Only Class and Object Name (stay tuned for classes)
  • 15. Basic Concepts of Object Orientation • Object • Class • Attribute • Operation • Interface (Polymorphism) • Component • Package • Subsystem • Relationships
  • 16. What is a Class? • A class is a description of a group of objects with common properties (attributes), behavior (operations), relationships, and semantics o An object is an instance of a class • A class is an abstraction in that it: o Emphasizes relevant characteristics o Suppresses other characteristics OO Principle: Abstraction
  • 17. Sample Class Class Course Properties Behavior Name Add a student Location Delete a student Days offered a + b = 10 Get course roster Credit hours Determine if it is full Start time End time
  • 18. Representing Classes • A class is represented using a compartmented rectangle a + b = 10 Professor Professor Clark
  • 19. Class Compartments • A class is comprised of three sections o The first section contains the class name o The second section shows the structure (attributes) o The third section shows the behavior (operations) Class Name Professor name Attributes empID Operations create( ) save( ) delete( ) change( )
  • 20. Classes of Objects • How many classes do you see?
  • 21. The Relationship Between Classes and Objects • A class is an abstract definition of an object o It defines the structure and behavior of each object in the class o It serves as a template for creating objects • Objects are grouped into classes Objects Class Professor Professor Smith Professor Mellon Professor Jones
  • 22. Basic Concepts of Object Orientation • Object • Class • Attribute • Operation • Interface (Polymorphism) • Component • Package • Subsystem • Relationships
  • 23. What is an Attribute? Object Class Attribute Attribute Value :CourseOffering number = 101 startTime = 900 CourseOffering endTime = 1100 number startTime endTime :CourseOffering number = 104 startTime = 1300 endTime = 1500
  • 24. Basic Concepts of Object Orientation • Object • Class • Attribute • Operation • Interface (Polymorphism) • Component • Package • Subsystem • Relationships
  • 25. What is an Operation? CourseOffering Class addStudent deleteStudent getStartTime Operation getEndTime
  • 26. Basic Concepts of Object Orientation • Object • Class • Attribute • Operation • Interface (Polymorphism) • Component • Package • Subsystem • Relationships
  • 27. What is Polymorphism? • The ability to hide many different implementations behind a single interface Manufacturer B Manufacturer A Manufacturer C OO Principle: Encapsulation
  • 28. What is an Interface? • Interfaces formalize polymorphism • Interfaces support “plug-and-play” architectures Tube <<interface>> Shape Pyramid Draw Move Scale Rotate Cube Realization relationship (stay tuned for realization relationships)
  • 29. Interface Representations Tube Elided/Iconic Representation (“lollipop”) Pyramid Shape Cube Canonical Tube (Class/Stereotype) <<interface>> Representation Shape Pyramid Draw Move Scale Rotate Cube (stay tuned for realization relationships)
  • 30. Basic Concepts of Object Orientation • Object • Class • Attribute • Operation • Interface (Polymorphism) • Component • Package • Subsystem • Relationships
  • 31. What is a Component? • A non-trivial, nearly independent, and replaceable part of a system that fulfills a clear function in the context of a well- defined architecture • A component may be o A source code component OO Principle: o A run time components or Encapsulation o An executable component Source File <<EXE>> <<DLL>> Name Executable Component Name Component Name Interface
  • 32. Basic Concepts of Object Orientation • Object • Class • Attribute • Operation • Interface (Polymorphism) • Component • Package • Subsystem • Relationships
  • 33. What is a Package? • A package is a general purpose mechanism for organizing elements into groups • A model element which can contain other model elements OO Principle: Package Name Modularity • Uses o Organize the model under development o A unit of configuration management
  • 34. Basic Concepts of Object Orientation • Object • Class • Attribute • Operation • Interface (Polymorphism) • Component • Package • Subsystem • Relationships
  • 35. What is a Subsystem? • A combination of a package (can contain other model elements) and a class (has behavior) • Realizes one or more interfaces which define its behavior Realization Subsystem <<subsystem>> Interface Subsystem Name Interface OO Principles: Encapsulation and Modularity (stay tuned for realization relationship)
  • 36. Subsystems and Components • Components are the physical realization of an abstraction in the design • Subsystems can be used to represent the component in the design Design Model Implementation Model <<subsystem>> Component Component Name Name Component Component Interface Interface OO Principles: Encapsulation and Modularity
  • 37. Basic Concepts of Object Orientation • Object • Class • Attribute • Operation • Interface (Polymorphism) • Component • Package • Subsystem • Relationships
  • 38. Relationships • Association o Aggregation o Composition • Dependency • Generalization • Realization
  • 39. Relationships: Association • Models a semantic connection among classes Association Name Professor Works for University Association Role Names Class University Professor Employee Employer
  • 40. Relationships: Aggregation • A special form of association that models a whole-part relationship between an aggregate (the whole) and its parts Whole Part Student Schedule Aggregation
  • 41. Relationships: Composition • A form of aggregation with strong ownership and coincident lifetimes o The parts cannot survive the whole/aggregate Whole Part Student Schedule Aggregation
  • 42. Association: Multiplicity and Navigation • Multiplicity defines how many objects participate in a relationships o The number of instances of one class related to ONE instance of the other class o Specified for each end of the association • Associations and aggregations are bi- directional by default, but it is often desirable to restrict navigation to one direction o If navigation is restricted, an arrowhead is added to indicate the direction of the navigation
  • 43. Association: Multiplicity • Unspecified • Exactly one 1 • Zero or more (many, unlimited) 0..* • One or more * • Zero or one 1..* • Specified range 0..1 • Multiple, disjoint ranges 2..4 2, 4..6
  • 44. Example: Multiplicity and Navigation Multiplicity Student 1 0..* Schedule Navigation
  • 45. Relationships: Dependency • A relationship between two model elements where a change in one may cause a change in the other • Non-structural, “using” relationship Client Supplier Component Class Package Client Supplier Dependency relationship ClientPackage SupplierPackage Dependency relationship
  • 46. Relationships: Generalization • A relationship among classes where one class shares the structure and/or behavior of one or more classes • Defines a hierarchy of abstractions in which a subclass inherits from one or more superclasses o Single inheritance o Multiple inheritance • Generalization is an “is-a-kind of” relationship
  • 47. Example: Single Inheritance • One class inherits from another Ancestor Account balance name Superclass number (parent) Withdraw() CreateStatement() Generalization Relationship Checking Savings Subclasses Withdraw() GetInterest() Withdraw() Descendents
  • 48. Example: Multiple Inheritance • A class can inherit from several other classes FlyingThing Animal multiple inheritance Airplane Helicopter Bird Wolf Horse Use multiple inheritance only when needed, and always with caution !
  • 49. What Gets Inherited? • A subclass inherits its parent’s attributes, operations, and relationships • A subclass may: o Add additional attributes, operations, relationships o Redefine inherited operations (use caution!) • Common attributes, operations, and/or relationships are shown at the highest applicable level in the hierarchy Inheritance leverages the similarities among classes
  • 50. Example: What Gets Inherited GroundVehicle owner Person Superclass weight (parent) licenseNumber 0..* 1 register( ) generalization Car Truck Trailer Subclass size tonnage getTax( )
  • 51. Relationships: Realization • One classifier serves as the contract that the other classifier agrees to carry out • Found between: o Interfaces and the classifiers that realize them o Use cases and the collaborations that realize them Class Component Subsystem Interface Interface Interface Elided form Canonical form Use Case Use-Case Realization
  • 52. In • Basic Principles of Object Orientation • Basic Concepts of Object Orientation • Strengths of Object Orientation • General UML Modeling Mechanisms
  • 53. Strengths of Object Orientation • A single paradigm • Facilitates architectural and code reuse • Models more closely reflect the real world o More accurately describe corporate data and processes o Decomposed based on natural partitioning o Easier to understand and maintain • Stability o A small change in requirements does not mean massive changes in the system under development
  • 54. Class Diagram for the Sales Example Sale seller buyer item sold shipping mechanism Salesperson Customer Product Vehicle Corporate Individual Truck Train
  • 55. Effect of Requirements Change Suppose you need a new type of shipping vehicle ... Sale seller buyer item sold shipping mechanism Salesperson Customer Product Vehicle Corporate Individual Truck Train Airplane Change involves adding a new subclass
  • 56. Introduction to Object Orientation Topics • Basic Principles of Object Orientation • Basic Concepts of Object Orientation • Strengths of Object Orientation • General UML Modeling Mechanisms
  • 57. Stereotypes • Classify and extend the UML notational elements • Define a new model element in terms of another model element • May be applied to all modeling elements • Represented with name in guillemets or as a different icon <<boundary>> MyBoundaryClass MyBoundaryClass
  • 58. Example: Stereotypes <<boundary>> <<boundary>> Sample boundary class <<trace>> (stereotype) DesignClass Stereotype of ‘dependency relation’ Stereotype of <<Processor>> These create new symbols using accustomed graphics. <<Processor>> Processor #1 Processor #1
  • 59. Notes • A note can be added to any UML element • Notes may be added to add more information to the diagram • It is a ‘dog eared’ rectangle • The note may be anchored to an element with a dashed line There can be up to one MaintainScheduleForm per MaintainScheduleForm user session.
  • 60. Tagged Values • Extensions of the properties, or specific attributes, of a UML element • Some properties are defined by UML o Persistence o Location (e.g., client, server) • Properties can be created by UML modelers for any purpose PersistentClass {persistence} anObject : ClassA {location=server}
  • 61. Constraints • Supports the addition of new rules or modification of existing rules Member 1 Professor Department 1..* {subset} Department Head 1 1 This notation is used to capture two relationships between Professor-type objects and Department-type objects; where one relationship is a subset of another…. Shows how UML can be tailored to correctly modeling exact relationships….
  • 62. Review: Introduction to Object Orientation • What are the four basic principles of object orientation? Provide a brief description of each. • What is an Object and what is a Class? What is the difference between them? • What is an Attribute? • What is an Operation? • What is an Interface? What is Polymorphism? • What is a Component? (continued)
  • 63. Review: Introduction to Object Orientation (cont.) • What is a Package? • What is Subsystem? How does it relate to a Component? How does it relate to a package? How does it relate to a class? • Name the 4 basic UML relationships and describe each. • Describe the strengths of object orientation. • Name and describe some general UML mechanisms. • What are stereotypes? Name some common uses of stereotypes.