Object Oriented Analysis Design with UML

Document Sample
Object Oriented Analysis Design with UML Powered By Docstoc
					Dr. R. Nadarajan,
PSG College of Technology
 Object Oriented Analysis & Design With UML
               Introduction
               Object Technology
               Unified Process
               Software Architecture
               Requirement Workflow
               Analysis Workflow
               Design Workflow
               Implementation Workflow
               Test Workflow
Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

       Software – Its Value Today

    • The fuel on which modern businesses are run.

    • The link connecting people and shrinking the world.

    • An indispensable part of our modern world.




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

      Software Engineering Vs …
  • Programming
     – focuses solely on code construction
  • Systems Analysis
     – focuses on solving organizational
       problems
  • Software development
     – Close, but concerned more with product
       than process

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

         Software Engineering ?

     ”Software engineering is the application of
     engineering principles to the creating of
     software systems that meet practical
     objectives, including utility, reliability, and
     effectiveness.”




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
       Software Engineering Crisis


                                              Applications expanding in

       • Many Successes
 World economies are
 increasingly software
 dependent
                                              size, complexity, &
                                              distribution


       • Too many Failures
                         Rapid change in
                         Technology

                                           Business demands increased
 Not enough qualified                      productivity & quality in less time
 people

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

          Root Causes for Failures
   • Insufficient requirements    • Poor testing
   • Ambiguous communications     • Subjective assessment
   • Brittle architectures        • Waterfall development
   • Overwhelming complexity      • Uncontrolled change
   • Undetected inconsistencies   • Insufficient automation




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
       Best Practices in Software
             development

   “A set of commercially proven approaches to
    software development, which, when used in
 combination, strike at the root causes of software
              development problems.”




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
               Six Best Practices
                         Develop Iteratively



       Manage           Use             Model     Verify
     Requirements   Component          Visually   Quality
                    Architectures       (UML)




                         Control Changes




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
An Iterative and Incremental Process




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
                    Best Practices
                         Develop Iteratively



                        Use             Model     Verify
       Manage                          Visually
                    Component                     Quality
     Requirements                       (UML)
                    Architectures



                         Control Changes




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
              Manage Requirements

    • Analyze the Problem
                                             Needs
    • Understand User needs
    • Define the System
                                           Features
    • Manage scope
    • Refine the System Definition       Use Cases &
                                         Software
    • Build the right system
                                         Requirements

                               Design   Test Procedures



Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
                    Best Practices
                         Develop Iteratively



                        Use             Model     Verify
       Manage                          Visually
                    Component                     Quality
     Requirements                       (UML)
                    Architectures



                         Control Changes




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
                     Architecture

     • Resilient – flexibility in the face of change.

     • Enables reuse

     • Encapsulates system dependencies

     • Key techniques are abstraction, encapsulation,
       and object-oriented analysis and design




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
                      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 physical, replaceable part of a system that packages
   Implementation and conforms to and provides
   the realization of interfaces.




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
      Need for Component-based
             Architecture
    • Basis for reuse.

    • Basis for project management.

    • Manage Complexity.

    • Maintain Integrity.




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
                    Best Practices
                         Develop Iteratively



                        Use             Model     Verify
       Manage                          Visually
                    Component                     Quality
     Requirements                       (UML)
                    Architectures



                         Control Changes




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
                 Model Visually

     “A model is a simplification of reality that provides
           a complete description of a system
               from a particular perspective.”




                 “A blueprint of a system”




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
               Aims of Modeling

   • Models help us to visualize a system as we want it to be.

   • Models permit us to specify the structure or behavior of a
   system

   • Models give us a template that guides us in constructing
   a system.

   • Models document the decisions we‟ve made.



Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

             Why do we Model ?
     • Provide structure for problem solving
     • Experiment to explore multiple solutions
     • Furnish abstractions to manage complexity
     • Reduce time-to-market for business problem solutions
     • Decrease development costs
     • Manage the risk of mistakes




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Model, Modeling language & Method
                         Method
        “A means or manner of procedure; especially,
  a regular and systematic way of accomplishing anything. “


            Modeling Language          Method
                                Used to define

                            Model
                                Is an abstraction of

                           System


Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
                    Best Practices
                         Develop Iteratively



                        Use             Model     Verify
       Manage                          Visually
                    Component                     Quality
     Requirements                       (UML)
                    Architectures



                         Control Changes




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
                      Quality

       “The characteristic of having demonstrated the
      achievement of producing a product which meets
          or exceeds agreed upon requirements, as
      measured by agreed upon measures and criteria
        and is produced by an agreed upon process.”




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
             Dimensions of Quality
       Does my
    application do                                   Does my application
        what‟s                                       respond acceptably?
      required?
                                       Reliability

                     Functionality


                                     Performance

                                                        Does the system
                                                         perform under
                                                        production load?

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
                    Best Practices
                         Develop Iteratively



                        Use             Model     Verify
       Manage                          Visually
                    Component                     Quality
     Requirements                       (UML)
                    Architectures



                         Control Changes




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
           Change Management
              •   Multiple developers
              •   Multiple teams
              •   Multiple sites
              •   Multiple iterations
              •   Multiple releases
              •   Multiple projects
              •   Multiple platforms

                  Without explicit control,
         parallel development degrades to chaos

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
     Best Practices Implementation
  • Object technology helps implement these best practices.

  • An object-oriented model aims at reflecting
   the world we experience in reality.

  • Object technology is used for creating models that
   reflect a specific domain, using the terminology of the domain.

  • Implementation of object technology requires a method that
  integrates a development process and a modeling language.



Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

  Introduction to Object Orientation

  • Understand the basic principles of object orientation

  • Define the basic concepts and terms of object
    orientation

  • Discuss the strengths of object orientation




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
         Basic Principles of OO

                        Object Orientation




                        Encapsulation
          Abstraction




                                         Modularity




                                                      Hierarchy
Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

          What is Abstraction?
 • The essential characteristics of an entity that
 distinguish it from all other kinds of entities.

             Professor               Student




                           Vehicle




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

        What is Encapsulation?
• Hide implementation from
  clients.
  – Clients depend on interface




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
              What is Modularity?
  • The breaking up of something complex into
    manageable pieces.
                                          Purchase




   Sales Order Processing
          System                  Sales




                                          Customer



Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

                  What is Hierarchy?
  Increasing                                          Asset
  abstraction




                      BankAccount                   Security                 RealEstate




                Savings          Checking             Stock           Bond




  Decreasing              Classes at the same level of the hierarchy should be at
  abstraction                          the same level of abstraction


Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
  OO Terminology
                  An entity with a well-defined boundary and identity
     Object       that encapsulates state and behavior.

     Class  A description of a set of objects that share the same
             attributes, operations, relationships and semantics.
      Polymorphism The ability to hide many different
                         implementations behind a single interface.

      Association      The semantic relationship between two or more
                       classifiers that specifies connections among
                        their instances.
      Aggregation      Is “ a part of” relationship

     Generalization       Is “a kind of” relationship



Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

 Strengths of Object-Orientation

   •   A single paradigm.
   •   Facilitates architectural and code reuse.
   •   Models more closely reflect the real world.
   •   Stability.
   •   Adaptive to change.




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

  Process
      “A process describes Who is doing What,
       When and How to reach a certain goal.”

 Unified
      A single, consistent development system
              from the most prominent
    software development methods in the industry.


Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

Unified Process
      A Design framework which guides the tasks, people and
products of the design process


                  Who is doing what?
                  When they do it?
                  How to reach certain goal?
                  I/O activity?




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

Unified Process

     Four primary modeling elements

               Workers : the Who
               Activities : the How
               Artifacts : the What
               Workflows : the When



Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Building Blocks
                       Focus on the generation of successive
          Cycle         release of the system.
                                  The span of time between two major
                                  milestones of the process in which
                      Phases       a well-defined set of objectives are met,
                                   artifacts completed and decisions made
                                    as to whether to move to the next phase.

A complete development cycle        Iteration
resulting in an executable release.
                     Describe interaction       Workflows
                     between activities.
                                     A unit of work
                                                            Activities
                                     with a clear purpose.


Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

Overview of the Unified Process

               Iteration and Incremental
               Use case Driven
               Architectural Centric
               Acknowledge Risk




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

Iteration And Incremental

       You Plan a little.
       You Specify, design and Implement little.
       You Integrate, test and run.
       You Obtain feedback before next iteration.




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Use Case Driven
                                    Use case model


                                                                              Test
                 Identifies                              Tested in
  Analysis                                                                Specification
   Model

                                                        Implemented
                                                             By
                 Specifies
  Analysis
  use case                                         Realized by              Source
 realization                  I/O      Organizes                             Code


                 Design               Subsystem                  Design
                use case                Model                    Model
               realization

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Role of use case
     Identify Users and their requirement.
     Aid in creation and validation of systems architecture.
     Help produce the definition of test cases and procedures.
     Direct the planning of iterations.
     Drive the creation of user documentation.
     Direct the deployment of the system.
     Synchronize the content of different models.
     Drive traceability throughout models.

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

Architecture Centric

  Inception   Elaboration   Construction    Transition




                             Architecture




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

Acknowledge Risk
   • Explicitly acknowledges the risk inherent in
   software design and development.

   • Highlights unknown aspects in the system being
   designed and other areas of concern.




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

Inception

    “This phase defines the scope of the project and
   develops the business case for the system. It also
       establishes the feasibility of the system.”




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

Elaboration


     “This phase defines the Functional and Non-
 Functional requirement of the systems. And provides
  the facility to create a architecture, one to be used
          through out the project life cycle.”




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

Construction


 “This phase concentrates on completing the analysis
        and performing majority of design and
  implementation of the system. That is, it essentially
                  binds the system”




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

Transition


       “In this phase system moves into User‟s
     environment. This involves activities such as
       deploying and maintaining the system.”




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Four Phases of the Unified Process

  Inception                  Vision (Feasibility & Scope)


      Elaboration
                                   Baseline Architecture


              Construction
                                         Full beta Version


                    Transition               Final Release


Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
 Inception


               Requirement
Elaboration
                             Analysis



                                        Design
Construction

                                                 Implementation

                  Work flow
                        Vs                                        Test
 Transition
                             Phases
Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
    Work flow     Products

  Requirement       Use case
                     Model


                               Analysis
    Analysis                    Model


                                           Design   Deployment
    Design                                  Model      Model



 Implementation                Implementation
                                    Model



      Test        Test
                  Model

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Implementation                         Requirement
and testing
                                  Inception
                                  Elaboration
                                  Construction
                                  Transition




                                  Spiral

Design                                          Analysis

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
    Work flow       Activities

  Requirement      Find actors and use cases, prioritize use cases, detail use
                  Cases, prototype user interface, structure, the use case model


    Analysis       Architectural analysis, analyze use cases, explore classes,
                                          Find packages


    Design           Architectural Design, trace use cases refine and design
                                    classes, design packages


 Implementation   Architectural implementation, implement classes and interfaces
                  Implement subsystems, perform unit testing, integrate systems


                   Plan and design tests, implement tests, perform integration
      Test                     and System tests, evaluate tests.


Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

   Unified – Result of unifying the information
                  systems and technology industry‟s best
                  engineering practices.

   Modeling – A number of models are used to
                  describe the system.

   Language– Not simply a notation for drawing
                   diagrams, but a complete language
                   for capturing semantics about a
                   subject and expressing the same for
                    purpose of communication.


Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
  UML Evolution
     • Too many “different” methods
        – DOOS from Wirfs-Brock et al 1990
        – OOA/OOD from Coad and Yourdon 1991
        – OMT from Rumbaugh et al 1991
        – Object Lifecycles (OL) from Shlaer and Mellor 1992
        – OOSE from Jacobson et al 1992
        – OOAD from Martin 1993
        – OOSD from de Champeaux et al. 1993
        – MOSES from Henderson-Sellers and Edwards 1994
        – OOADA from Booch 1994
        – Fusion method from Coleman et al 1994

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
  UML Evolution
 • 1987: Ivar Jacobson (Ericsson) lets the world know about
   use cases at the OOPSLA conference.
 • 1992: Jacobson‟s book “Object-Oriented Software
   Engineering: A Use Case Driven Approach.”
 • 1994: Booch (Rational) Method adopts use cases.
 • 1994: Rumbaugh(General Electric)‟s OMT adopts use cases.
 • 1997: The Unified Modeling Language (UML) links the Booch
   Method, OMT and OOSE
 • 1999: Object Management Group (OMG) accepts UML
 • 2001: UML version 1.4
 • 2002: UML version 2.0 expected

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

  Briefly, UML is a language for …
                  Visualizing
                  Specifying
                  Constructing
                  Documenting


                    a Software System.

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

  UML is a language for …
 • Visualizing- it can be used to visually depict a system
 before it is realized.
 • Specifying- it can be used to communicate "what" is
 required of a system, and "how" a system may be realized.
 • Constructing- it can be used to guide the realization of a
 system similar to a "blueprint".
 • Documenting- it can be used for capturing knowledge
 about a system throughout its life-cycle.



Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

 Building Blocks of the UML
   • Things
   • Relationships
   • Diagrams

      – Things are the abstractions in the model.
      – Relationships describe how these things
        relate to each other.
      – Diagrams group a set of things and relationships.



Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

 Things
     – Structural things - nouns(static parts) of an UML
       model (class, interfaces, collaborations, use cases,
       components, nodes);
     – Behavioral things - dynamic parts of an UML model
       (interactions, state machines);
     – Grouping things - organizational parts of an UML
       model (packages);
     – Annotational things – explanatory parts of an UML
       model (notes).



Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

 Relationships
  – Dependency
     • A semantic relationship between two things in which a change to one
       thing may affect the semantics of the other thing.
  – Association
     • A structural relationship that describes a set of links, a link being a
       connection among objects.
  – Generalization
     • is “a kind of” relationship
  – Realization
     • a semantic relationship between classifiers, wherein one classifier
       specifies a contract that another guarantees to carry out.



Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
    Common Mechanisms in UML
   UML provides four common mechanisms that apply
   consistently throughout the language.

      Specifications - provides a textual statement of the
     syntax and semantics of the graphical notation.

      Adornments - textual or graphical items that are added
     to an element‟s basic notation. Eg. The role name
     included above an association.

      Common Divisions - division of class and object,
     separation of interface and implementation.

      Extensibility mechanism
Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
   Extensibility
   UML provides 3 mechanisms for extending the language‟s
   syntax and semantics:

       Stereotypes - represents new modeling elements.
       Tagged values- represent new modeling attributes.
       Constraints - represents new modeling semantics.
                    Stack {author=xxx}
                    Item {integer}
                    tos
                    Push()                {runs in O(1) time}
                    Pop()
                    <<helper function>>
                    IsEmpty()
Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

     UML Diagrams
   • A diagram represents a particular view into the model.

   • UML Diagrams are comprised of model elements.

   • A single model is a complex entity and is difficult to present
     meaningfully within a single diagram.

   • UML defines a number of diagrams so that we can focus
   on different aspects of the system independently.



Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
         Relationship between diagrams and models

    Use Case                     Class              Object




  Sequence                                           Component
                                 Model


   Collaboration

                                                    Deployment

                   State Chart
                                         Activity


Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
                     UML diagrams


Structural Diagrams                Behavioral Diagrams
 (static aspects of the system)   (dynamic aspects of the system)

  • Class Diagram                   • Use Case Diagram

  • Object Diagram                  • Statechart Diagram

  • Component Diagram               • Activity Diagram

  • Deployment Diagram              • Interaction Diagram
                                               Sequence Diagram
                                               Collaboration Diagram

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

  UML diagrams…
     • Class diagrams: Shows a set of classes, interfaces and
     collaborations and their relationships.
     • Object diagrams: Shows a set of objects and their
     relationships.
     • Component diagrams: Serve to model the development
     view of a system.
     • Deployment diagrams: Serve to model the physical
     computing topology upon which a system executes.



Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

  UML diagrams…
     • Use-case diagrams : Serve to organize the use cases
     and actors that encompass a system's behavior.
     • State-chart diagrams: Focuses on the changing state
     of a system driven by events.
     • Sequence diagrams: Focuses on the time ordering of
     messages.
     •,Collaboration diagrams: Focuses on the structural
     organization of objects that send and receive messages.
     • Activity diagrams: Focuses on the flow of control from
     activity to activity.

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Case Study 1 - Problem Statement
   Develop an Online Banking system. The software must cater to the
   following requirements:

   • The name, address etc. of customers must be recorded along with
   their account number and PIN number. Remember customers should
   be given undue importance.

   • Customers should be able to transfer funds, Check their monthly
   statement and also send in applications for loans.

   • A facility should be provided for the direct payment of bills, eg.
   Payment of your mobile phone bills.

   • A good report generator.
   • Security should be guaranteed.
Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

 Architecture


      “The skeleton on which the functionality
    and user interface of the system will be hung.
      It is a description of the subsystems and
     components of a software system and the
              relationship between them.”




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

Why?
            Understand the System
            Organize development
            Promote reuse
            Promote Continued development




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

  Architecture Constrains Design
  & Implementation

                                     Architecture
                                Design

                           Implementation
                    CODE




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

Characteristics
       Initial set of constraints placed on the system
       Resilience
       Simplicity
       Clarity of presentation
       Clear separation of concerns
       Balanced distribution of responsibilities
       Balances economic and technological constraints



Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

Design Vs Architecture                                          Total size of model




  UseCase Analysis   Design     Deployment Implementation Test
  Model    Model     Model       Model         Model             Model

                              Amount of model in architecture


Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

Use Case Vs Architecture
              Use Case              Experience
                                      Drives
                    Drive
       Influences

                       Architecture

                            Drive

                        Constraints

Department of Mathematics and Computer Applications
  Object Oriented Analysis & Design With UML
Inception
                                                   Architecture
               Requirement
Elaboration
                             Analysis



                                        Design
Construction

                                                 Implementation




                 How the Architecture                             Test
 Transition
                 fits in?

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
The “4+1 View“ model

                     Logical View             Implementation View


                          End-user                              Programmers
     Analysts/Designers
                          Functionality
     Structure                                          Software management
                                     Use-Case View


                     Process View             Deployment View
     System integrators                                  System engineering
     Performance                                            System topology
     Scalability                                         Delivery, installation
     Throughput                                               communication

Describes software architecture using five concurrent views.

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Logical View
       Describes the design's object model


       Audience: End-user
       Addresses: Functional requirements
       Method: OMT notation (object and dynamic models)
       (e.g.) class diagrams, E-R, functional decomposition




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Process View
        Describes the design's concurrency and
               synchronization aspects.

       Audience: Integrators
       Addresses: Non - functional requirements
         (concurrency, performance, scalability)
       Method: Sequence diagrams, Collaboration
         diagrams, dynamic behavior




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Development View
     Describes the software's static organization in
            the development environment.

     Audience: Programmers and Software Mgrs.
     Addresses: file layout, production schedule
     Method: dependency graphs and Layered diagrams
       It could be in the form of guidelines or extremely
       detailed. Traditional Design document. It involves
       classic system layering with import/export
       relationships, modules and subsystems.


Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Physical View
      Describes the mapping of the software onto the
   hardware and shows the system's distributed aspects.


      Audience: System Engineers
      Addresses: Topology, Communication
      Method: English or a simple notation that is over the
         process view diagrams.
      Tightly connected to the process view.
      (e.g.) deployment diagrams



Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
+1 Scenarios
    Scenarios show how elements of the four views work
      together. They are instances of a use case. The
   Scenarios view is redundant but helpful to validate and
                 illustrate the architecture.
     Audience: All users of other views and Evaluators.
     Addresses: System consistency, validity
     Method: English, graphical notations, UML use cases.
     • Help Architect during the Architecture design
     • Help illustrate and validate the document




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Relationship among the views
     • Concurrency is not addressed in the logical view, to achieve the
     process view, we need to map classes and their objects onto
     tasks    and     processes   addressing       concurrency     and
     synchronization.

     • The processes and process groups are mapped onto the
     processing nodes of a physical computer network to obtain the
     physical view. For each dependency between components, there
     must be a corresponding link between nodes.

     • The logical view is also the basis for the development view.
     Normally each class corresponds to a module. Large classes may
     be decomposed into packages. Collections of classes are
     grouped into subsystems.


Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

  Modeling a system
   • Decide which views are needed to best express the architecture of the
   system and to expose the technical risks to the project.

   • For each of these views, decide the artifacts(eg. UML Diagrams)
   needed to be created to capture the essential details of that view.

   • As part of process planning, decide which of the UML diagrams
   require frequent reviews and which have to be documented.

   • Allow room for diagrams that are thrown away. Such transitory
   diagrams are useful for exploring the implications of decisions taken
   and for experimenting with changes.




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

  Views – UML Diagrams
 A simple Monolithic Application that runs on a single
 machine requires…
        • Use case view         Use case Diagrams

        • Design view           Class Diagrams
                                Interaction Diagrams

        • Process view          None

        • Implementation view   None

        • Deployment view       None


Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
  Views – UML Diagrams
 A complex, distributed system requires…
        • Use case view         Use case Diagrams
                                Activity Diagrams

        • Design view           Class Diagrams
                                Interaction Diagrams
                                Statechart Diagrams

        • Process view          Class Diagrams
                                Interaction Diagrams

        • Implementation view   Component Diagrams

        • Deployment view       Deployment Diagrams

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

  Patterns and Architecture

  “A pattern is a common solution to a common problem
                    in a given context.”



   “A framework is an architectural pattern that provides
      an extensible template for applications within a
                         domain.”




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Software Patterns
             A Design pattern captures expertise
 describing an architectural design to a recurring
 design problem in a particular context. They capture
 the following:

              Static Structures
              Dynamic Structures
              Collaborations of previous solutions



Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
 Architectural Patterns
        “ Describe the structure of the system. “

      Distributed
      Layered
      Model-View-Controller
      Blackboard
      Subsumption
      Repository-centric


Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
 Constructing the Architecture
     Significant Use Cases
     Identify Systems & Subsystems
     Identify/Extract Classes (Structure, Relationship)
     Identify the potential for Concurrency & Distribution
     Manage the Data Stores
     Implement one or more architectural prototype
     Derive tests from the Use Cases
     Evaluate the architecture


Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Layering Architecture            Case Study 1: Online Banking
  Application Specific

              Bill               User                   Loan
            Payment            Interface              Application




          Analysis       Transaction          Login            Customer
         & Reporting       service          Subsystem         Management
  Application generic



              CRM                          Database
                                           Manager
  Middleware Layer

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

OOAD Life Cycle Products
                                            Exec




              Analysis   Design    Source
  Use Cases   Classes    Classes    Code


Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

        Requirements Workflow

     The Requirements Workflow attempts to express
     the system‟s requirements in terms of Use Cases.
     The Output of this workflow is the UseCase Model.




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

 There are five steps to UseCase Analysis.
       Find and describe the actors in the system.
       Find Use Cases.
       Describe the Use Cases as appropriate.
       Describe the Use Case Model as a whole.           102


       Prepare a glossary of terms.
      This process is iterative. At the end of UseCase
      Analysis only about 80% of the UseCases have
      been uncovered. The remaining 20% will come to
      light during the Analysis and Design Workflows.

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

 What is a Use Case Model?

    ” A view of a system that emphasizes the behavior as it
                   appears to outside users. “

     “A use case model partitions system functionality into
    transactions („use cases‟) that are meaningful to users
                          („actors‟).”




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML


Use Case Model

       Describing particular interactions with system.
       Actors who interact with system.
       Artifacts like   GUI   prototype   and   non-functional
       requirements.




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
                               Actors


                                              Use Cases
   Use Case
    Model
              Contains                     Prototype
                                           interfaces




                                        Glossary of terms



Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

   Actors


 “An Actor can be anything that interacts with the
 system.”
 “An Actor not only represents an user but also the
 role that the user plays at that point in time.”
 “An Actor should have a description that clearly
 specifies the role of the actor in the system.”

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

   Actors


 Actors can also optionally have
 attributes
 operations
 tagged values
 constraints

Department of Mathematics and Computer Applications
                            Actors              Trader

•   actors represent roles people or devices play as the system
    functions. They communicate with the system and are external
    to it.
•   users can play a number of different roles for a given scenario.
     – Example: an operator on a production line might have many
        roles (programmer, tester, monitor, troubleshooter). Each of
        these would represent an actor in the use-case
•   A single actor may perform many use-cases; a use-case may
    have several actors performing it
•   System (non-human) actors should only be shown when they
    are the ones that need the use case
     – Example: If the system generates a file that is later picked
        up by the accounting system then the accounting system is
        a relevant actor.
 Object Oriented Analysis & Design With UML

Finding Actors
      Who is interested in the system?
      Who is likely to use the system?
      Who will benefit from the system?
      Who will supply information to the system?
      Who will receive information from the system?
      Who will maintain information in the system?
      Where in the organization is the system to be used?



Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML



Rule of Thumb

       There should be at least one user for each actor.
       There should be a minimum of overlap in the role
       played




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Example
        Account Holder
        Payment Authorization service
        Administrator
        Bank Manager
        Printer


Note:
      An actor represents a role that a human, a hardware
device or even another system plays with a system.

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Use Case

  “A Use Case specifies a sequence of actions,
 including variants that the system can perform and
 that yields an observable result of value to a
 particular actor”

                                    - Jacobson

                 Use Case


Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

Use Case
     A sequence of actions performed.
     An optional set of one or more alternative
     sequence(s) of actions.
     A brief description of the purpose of the Use Case.
     Communication with one or more actors.
     Constraints on their use.




Department of Mathematics and Computer Applications
     Concrete versus Abstract Use
                Cases
                                    • Abstract use cases:
                                         –Exists only for other use cases.
                                         –Never instantiated on their own.
                                         –Does not have to be complete.

           «extends»    «uses»      • Concrete use cases:
                                           –Has to be complete and
                                           meaningful.
                                           –An instance can follow the
                                           descriptions of more than one use
A use case is either concrete or abstract. case.
 Object Oriented Analysis & Design With UML
Finding Use Case
     What are the main tasks of each actor?
     Will the actor have to read/Write/Change any of the
     system information?
     What use cases will Create,Store,Change,Remove or
     Read the system information?
     Consider each actor in turn
            Will the actor have to inform the system about
                   outside changes?
            Does the actor wish to be informed about outside
           changes?

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML


    What use case will support and maintain the system?
    Can all functional requirements be performed by the current
     set of use cases?
    Interview with the actors of the system.
    Storyboarding to describe how the system will operate.
    Workshops to brainstorm different scenarios
     relating to the system.




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Finding Use Case Events
     Any preconditions on the use case.
     When and how the use case starts and terminates?
     What interaction the use case has with the actors?
     What data is needed by the use case?
     The normal sequence of events.
     Any alternative or exceptional sequence.
     Any Post Conditions.



Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Stereotypes
       There are two stereotypes that apply to dependency
 relationships among use cases.
     <<extend>>
           this relationship is used when you have one use case
         that is similar to another use case but does a bit more.
     <<include>> or <<uses>>
           this relationship occurs when you have behaviors that
         are similar across more than one use case and you
         don‟t want to redundantly copy the behavior in each use
         case.

Department of Mathematics and Computer Applications
                                      <<uses>>


                      Relationships
•   Communication:
     – Flow of data and control between an actor and use-case
                                                           <<uses>>
•   Uses:
     – Use uses when you are repeating yourself in two or more
       separate use cases and you want to avoid repetition
•   Extends:                                              <<Extends>>


     – Use extends when you are describing a carefully controlled
       variation on normal behaviour
     – Useful for identify core and extended functionality
     – Needs to have extension points (specific aspects that are
       extended)
•   Generalizes
     – A casual description of a variation on normal behaviour
    A Use Case is a Sequence of
           Transactions


                                                 A system




... that results in a meaningful, measurable result of value for the user.
     What does the Arrow Direction
              Indicate?
         Lift handset              Each arrow contains messages
         Present dial-tone         and usually return messages.
         Dial first digit

         silence dial-tone
                                       ring phone
                                       lift handset
         dial subsequent digits
                                                             Callee
Caller   stop dialing
         connect call
                                  The communication arrow tells who
                                  started the communication.
             Scenarios

– A Use Case can have many scenarios.
– A scenario describes what happens during
  an actual occurrence of a use case.
                           A Use Case scenario




 Caller      Place Local Call
                                   Callee
      Use Case Vs Scenario
One Scenario                       Another Scenario

1) Caller lift handset             1) Caller lifts handset
2) dials 3 digits (but not 911!)   2) dials 7 digits
3) changes mind, hangs up          3) digits are a valid number
                                   4) system connects Caller and
                                      Callee
                                   5) call continues for some time
                                   6) Caller or Callee hangs up
                                   7) System frees resources,
                                      records billing information
                                   8) Use Case ends
Example: Use-Case Diagram

                  Register for Courses
  Student



                 Select Courses to Teach      Course Catalog

 Professor




             Maintain Professor Information


             Maintain Student Information
 Registrar

                  Close Registration
                                              Billing System
       Sample Flow of Events
•   Flow of events for the Register for Courses Use Case
     1. The Student selects “create schedule.”
     2. The system displays a blank schedule form.
     3. The system retrieves a list of available course
       offerings from the Course Catalog System.
     4. The student selects 4 primary course offerings and 2
       alternate course offerings from the list of available
       offerings. Once the selections are complete the
       student selects “submit.”
     5. The “Add Course Offering” sub-flow is performed at
       this step for each selected course offering.
     6. The system saves the schedule.
       The Anatomy of a Use Case
              Description
                                        Special Requirements

                        Name
Brief Description                                    Associations to
                                                     - Actors
                                                     - Use Cases
                             A Use Case

   Flow of Events


              Pre/Post Conditions, Activation & Termination
Use-Case Description Template
             1. Purpose:               The use case's role in the system.
             2. Scope:
             3. Background:
             4. Actors:                Participating actors and their descriptions.
Describes
     the     5. Description:           The use case's brief description
Use Case's   6. Flow Description       The use case's behavior
   flow of     6.1 Pre-Conditions
 events in     6.2 Activation
 black-box     6.3 Main Flow
   terms.
               6.4 Alternative Flow(s)
               6.5 Exceptional Flow(s)
               6.6 Termination
               6.7 Post-Conditions
             7. Special Requirements Narrow scoped Non-Functional requirements
             8. Reference               References to relevant documents
             9. Terminology             Definition of Glossary items local to use case.
             10. Views                  Diagrams related to the use case
            Flow of Events



•A Use Case:
 – Has one Main flow
 – Several Alternative flows
 – Exceptional flows handling error
   situations
Use of Pre- and Post-Conditions
Using Pre- and Post-Conditions in the flow of events:
     The pre- and/or post-conditions are states of the
      system that are observable to the user

pre-condition:
     A constraint on when the use case can be started
      by the event
     NOT the event that starts the use case
post-condition
     the state the system should be in when the use
      case terminates
     may vary according to actual flow the use case took
Inheritance-Associations Common
              Roles
How many actors does each instance of the use case interact with?
    Actor-Generalization
          • The generalization:
             – Extracting common ways of
A
               two or more actors to use the
               system. Assign these
               common ways of using the
               system to an ancestor actor.
B


          • The ancestor actor, A:
             – Use the system in ways
               common to all its descendant
             – Does not know which its
               descendant actors are
Example of Actor-Generalization
    Actor-Specialization
          • Specialization
A            – Add more specific ways of
               using the system to get the
               descendant actor.
          • The descendant actor, B:
B
             – An instance of B can perform
               all behavior described for A
             – And also perform its own
               behaviors
             – Knows which other actors it
               inherits
Abstract and Concrete

        – A abstract actor contains a
          part of the role. It can not
          be instantiated by itself.

        – A concrete actor can be
          instantiated.
       Why use the “Uses”
         Relationship?
–To show that parts of behavior in several use
 cases are common
–To avoid describing the same behavior,
 several times and in different ways

                         B


                   <<uses>>   <<uses>>

               A
               Uses-Relationship
                         • The used usecase, A:
        A                   – Does not have to be complete
                            – Does not know of the usecase(s) that
                              uses it
                         • The relationship:
                            – The direction goes from the using
    <<uses>>   <<uses>
               >
                              usecase B to the used usecase A
                         • The using usecase, B
B                C          – Knows which usecase to use
                            – Must be complete (together with A)
                            – An instance of B performs all behavior
                              described in A
                            – Knows in which order to use the
                              different parts
         Common Behavior




– Lift receiver           Lift receiver
– Dial the number         Dial the number
– Analyze the number      Analyze the number
– Find corresponding      Send number to other
  subscriber               system
– Connect the             Connect the lines
  subscribers             Disconnect
– Disconnect
      Why use the “Extends”
         Relationship?

– To model optional behavior in a
                                                         A
  separate use case
– To simplify a complex flow of       Temperature Adjustment

  events
                                                  «extends»
– To model behavior that is to be
  developed separately, possibly in                      B
  late iterations
                                        Statistics Collection
– To model behavior that require
  different post conditions.
  (optional)
         The Extends Relationship
                          • The extended usecase A must be
                            complete:
  A                          – Does not know of the extending usecase
                               B, that is is independent of B
                             – When instantiated, the instance may
Temperature Adjustment
                               perform the behavior described for B as
                               well as that of A
            «extends»
                          • The relationship:
  B
                             – Has a probe that tells where in A to extend
                             – Has a condition that tells when to extend
  Statistics Collection      – The direction goes from the extending
                               usecase B to the extended usecases A
                          • The extending usecase, B, knows
                            which usecase to extend
   Examples with Extension
– A use case can extend several other use cases
– A use case can be extended by several other use
  cases




  <<extends>>   <<extends>>   <<extends>>   <<extends>>
Examples with Extension (cont.)

– A use case can extend another use case more than
  once and in different places
– The flow of events for an extending use case can be
  divided and inserted at different places




         <<extends>>                   <<extends>>
              Add functionality

Old
existing
         <<uses>>
system                   <<uses>>




                                 Documents reused “as-is”
           <<extends>>   <<extends>>
New
features



                          New “hot” documents
   Why will not the extended Use
    Case know it is extended?
– You don't want to change an old
  existing Use Case each time you add
  a new feature to the system
                                                  Call waiting
– There maybe hundreds of features
  added to the
  system over the           Phone call               Long-distance call

   years.
– In a Telephone                                      A-number display
  system it would be
                             Call back to    3-part conference
 difficult to read all the previous caller
 description of “Phone
 Call” if all “probes” were included.
 Object Oriented Analysis & Design With UML
Case Study 1:
                         Authentication
Online Banking                                 UseCase
                             Loan
                           Application

 Actor
                            Transfer
     Account                of Funds
     Holder                                        Bank
                   <<include>>


                         Check Balance

                                 <<include>>
 Boundary                                      Payment
  Check                   Bill Payment         Authorization
                                               center
                 Online Banking System
Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Transfer of Funds Use Case

 Primary Actor: Account Holder

 Preconditions: Account Holder must be logged in.

 Other Actors:
    - Bank: Performs the transfer process and records the transaction.

 Overview: A Customer who wishes to transfer funds from his/her
 account to another account, initiates the Transfer of Funds use case.

  Post Conditions: Balance of both the accounts are updated.
                   Record of the transaction is made.




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Transfer of Funds Use Case(contd.)
 Basic Flow(Main Success Scenario):
  1.   Type in the PIN.
  2.   Type in the account number of the account to which transfer
       should be done.
  3.   Enter the amount.
  4.   Verify validity of account number entered.
  5.   The online Banking system verifies the availability of funds.
  6.   Perform Transfer.
  7.   Update balance.




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Transfer of Funds Use Case(contd.)
Alternative Flow:
  a. Invalid PIN is entered.
       1. System signals error.
       2. User is logged out.

 b. Invalid Account number is entered.
      1. System signals a „Invalid Account” message.
      2. User is prompted to re-enter the account number.

 c. Lack of availability of funds
      1. System signals a „Transaction failure‟ message.
      2. The current account balance is displayed along with minimum
         balance requirement.
      3. User is prompted to re-enter the transfer amount.

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Bill Payment Use Case
Primary Actor: Account Holder

Preconditions: Account Holder must be logged in.
               Payment Authorization center should be known to the bank.

Others Actors:
       - Bank: Does the bill payment.
       - Payment Authorization center: Receives the payment.

Overview: A Customer who wishes to pay bills, from his/her account
initiates the Bill Payment use case.

Post conditions: Account Balance should be updated.
                 Record the Transaction.
                 Payment should be received by the particular organization


Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Bill Payment Use Case(contd.)

 Basic Flow(Main Success Scenario):
   1.   Type in the PIN.
   2.   Type in the bill details.
   3.   Verify the Payment Authorization details.
   4.   Enter the amount.
   5.   The online Banking system verifies the availability of funds.
   6.   Pay Bill by transferring amount.
   7.   Update balance.




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Bill Payment Use Case(contd.)
Alternative Flow:
  a. Invalid PIN is entered.
       1. System signals error.
       2. User is logged out.

 b. Invalid Payment Authorization center is entered.
      1. System signals a „Invalid Request” message.
      2. User is prompted to re-enter the Bill details or Exit.

 c. Lack of availability of funds
      1. System signals a „Transaction failure‟ message.
      2. The current account balance is displayed along with minimum
         balance requirement.



Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Refining Use Case Models
     Use Cases should not be two small or too large. You
     should aim for comprehensibility in your Use Case.
     A Use Case should be self-contained and complete. You
     should not need to refer to a great deal of additional
     material in order to determine what the Use Case does?
     Use Case should provide “added Values” to the
     users of the system
     Each Use Case should relate to at least one actor. Any
     Use Case with out an actor is never going to be used.



Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
 When to use Use Cases
        • Capturing Use Cases are first on the “To Do” list
          of the elaboration phase.

        • Use cases are the essential tool in
           • Requirements capture
           • Planning and
           • Controlling Iterative projects.

        • It is needed for all types of projects.

        • Use Cases should be smaller-grained as they
          make understanding easier.

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Additional Documents
     Glossary for the terms used in Use Cases
     Documentation for Non-Functional requirement
     in Natural Language


Interface Description
     Human interface (GUI)
     Non-Human interface (Communication Protocol)



Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Glossary
  1. Introduction

  This document is used to define terminology specific to the problem
  domain, explaining terms, which may be unfamiliar to the reader of the use-
  case descriptions or other project documents. It can be used as an informal
  Data dictionary.

  2. Definitions

  2.1 Account Holder: A person who has opened an account with the bank.

  2.2 Payment Authorization center: The organization that receives their
     customer‟s bill payments via the bank.



Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

OOAD Life Cycle Products

                         Now Here




  Use Cases   Analysis   Design     Source   Exec
              Classes    Classes     Code


Department of Mathematics and Computer Applications
                    Modelling Tips
•   Make sure that each use case describes a significant chunk of
    system usage that is understandable by both domain experts
    and programmers
•   When defining use cases in text, use nouns and verbs
    accurately and consistently to help with later derivation of
    objects.
•   A use case diagram should
     – contain only use cases at the same level of abstraction
     – include only actors who are required
•   Try to describe use cases independent of implementation
     – A common mistake is to use chains of uses and extends to
       describe internal details
•   A use case can have many scenarios (threads of execution)
 Object Oriented Analysis & Design With UML


                 Chapter 5




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

What is this?




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Analysis Workflow
 “What the system needs to do to support the
         user‟s requirement”

Activities
     Architectural Analysis
     Generation of analysis classes
     Generation of analysis Packages
     Analysis of use cases for the generation of
     use case realization
Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

                       Analysis
                        Model

                                     Account
                                                 Use Case
     Analysis
                                                 Realization
                                     Calculate
                       Balance GUI
            Produces                 Balance


                                     Architecture Description

                          Data Dictionary
Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

Analysis Model Construction
    Identify Objects and classes
    Generate use case realization
    Prepare data dictionary
    Identify associations
    Identify attributes of objects at an abstract level
    Organize and simply object classes using inheritance
    Iterate and refine the model
    Group classes into modules

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

Analysis Class
      They have responsibilities, not Operations.
      They have high-level attributes described in domain terms.
      They have concept-oriented relationships.
      All Analysis Class should be directly involved in one or
      more use case realizations.
      They are all one of three types of class.




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

Use Case Realization

    Class Diagram
    Collaboration Diagram
    Textual description of collaboration to help clarify or elucidate
    details within the diagram.




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

Classes : Analysis Model
 Stereotype Class Diagram (Booch & OMT)

          Boundary Class
             Interface between system and actor
          Control Class
             The Event in a Use case
          Entity Class
             Long Live Data Logic

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Case study 1: Online Banking
Initial set of classes
       <<Entity>>
                           <<Entity>>      <<Entity>>         <<Entity>>
        Account
                            Account        Transaction         Balance
         Holder

                 <<Entity>>                     <<Control>>
  <<Entity>>      Payment          <<Entity>>                   <<Entity>>
                                                   Loan
  Statement     Authorization        Loan                         Bank
                                                  Handler
                   center

     <<Boundary>>        <<Boundary>>     <<Control>>        <<Boundary>>
          User               Login          Balance              Bank
        Interface          Interface        Handler

                    <<Entity>>
   <<Entity>>                    <<Control>>    <<Entity>>     <<Entity>>
                     Account
      PIN                          Transfer        Bill         Amount
                     Number


Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Generating Use Case Realization
      Start with Actor interaction with the system (Boundary Class)
      Move through the flow of events
      Identify all analysis classes involved in the Use Case
      Distribute the use cases behavior among the classes
      Note any if there are any special requirement?
      Record interaction between classes
      The basic and alternative path associated will provide different
       collaboration diagrams



Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Use Case Realization- Case study 1
       Online Banking- Analysis Class diagram
              Authentication use case



                     Login     Authen -
                                          Account
                   Interface    ticator


    Account
    Holder




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Use Case Realization- Case study 1
       Online Banking- Analysis Class diagram
              Transfer of Funds use case


                     User      Authen -
                                ticator        Account
                   Interface


    Account
    Holder                     Balance
                               Handler


                                          Transf –
                                            erer


Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Use Case Realization- Case study 1
          Online Banking- Initial Analysis Class diagram

                   User      Authen -
                              ticator        Account
                 Interface


Account
Holder                       Balance
                 Loan        Handler
                handler
                                        Transf –
                                          erer


                 Loan           Bill                      Payment
                              Payment              Bank
                                                          Authorization
                                                          center
Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Use Case Realization- Case study 1
           Online Banking- Analysis Collaboration diagram
           1: Enter Authentication use case
           User name
           & PIN
                                Login
                              Interface
           6: Allow/ Reject
           Access
 Account                             2: Get PIN for
 Holder                              user               3: Get PIN
                                             Authen -                Account
                                              ticator
                         5: Check Login                 4: Return
                         Details                        PIN



Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Use Case Realization- Case study 1
   Online Banking- Textual Description of the collaboration

 In the collaboration diagram, the AccountHolder requests entry to
 the system by inputting the user name and PIN through the Login
 Interface. This is represented by the LoginInterface Boundary object
 which sends the „get PIN for user’ request to the control object
 Authenticator. This object then gets the PIN from the Account entity
 And checks if the user is an authorized client. It then sends the
 Green Signal to the AccountHolder, allowing him access to the
 system.




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

Refining/Rationalizing Classes
     Is the class Cohesive?
     Are any of the classes redundant?
     Are any of the classes irrelevant?
     Are any of the classes vague?
     Are any classes really attributes of other classes?
     Does the name of the class represent its intrinsic nature and not
     its role in the application?
     Is a class really an implementation construct?


Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Case study 1: Online Banking
Final set of classes
       <<Entity>>
                           <<Entity>>     <<Entity>>         <<Entity>>
        Account
                            Account       Transaction         Balance
         Holder

                 <<Entity>>                    <<Control>>
  <<Entity>>      Payment         <<Entity>>                   <<Entity>>
                                                  Loan
  Statement     Authorization       Loan                         Bank
                                                 Handler
                   center

     <<Boundary>>        <<Boundary>>     <<Control>>       <<Boundary>>
          User               Login          Balance             Bank
        Interface          Interface        Handler

                    <<Entity>>
   <<Entity>>                    <<Control>>   <<Entity>>     <<Entity>>
                     Account
      PIN                          Transfer       Bill         Amount
                     Number


Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Identifying Attributes
     Should the attribute be an Object?
     Is an attribute really a name?
     Is an attribute an identifier?
     Is an attribute really a link attribute?
     Does the attribute represent an internal state of the
    object that is not visible outside the Object?
     Does the attributes unlike the others in their class?
     Is there any duplication of attributes?
     With all the attributes in place is a class too big?
     Are all the attribute at the analysis level?
Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Identifying Attributes
Case study 1: Online Banking
             Class Name          Attributes
        Account Holder    Name
                          Address
                          Phone No.
                          Account No.
                          PIN
        Account           Account No.
                          Balance
        Transaction       Account No.
                          Date
                          Transaction type
                          Amount

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Identifying Attributes(contd.)
Case study 1: Online Banking
                Class Name            Attributes
         Statement              Account No.
                                Period
         Payment                Organization Name
         Authorization Center   Account No.

         Loan                   Account No.
                                Amount
         Bank                   Name
                                Customers




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

Data Dictionary

     Provides a definition for each of the terms or word used in the
  evolving analysis models. Each entry precisely describes
            Name
            Scope
            Assumption or Restriction
            Attributes
            Operations



Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Data Dictionary
Case study 1: Online Banking
 Name         Description               Assumptions       Attributes

 Account      Client of the bank with                     Name
 Holder       an account.                                 Address
                                                          Phone No.
                                                          Account No.
                                                          PIN
 Account      Holds information on                        Account no.
              a clients account                           Balance
 Transaction It represents a service    Minimum balance   Account No.
             requested by the           is maintained.    Date
             client. Eg. Bill           Only 3 types of   Type
             Payment.                   transactions.     Amount

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Data Dictionary(contd.)
Case study 1: Online Banking
 Name            Description           Assumptions        Attributes

 Statement       Record of debits      Ordered based on   Account No.
                 and credits to a      Period.            Period
                 account.
 Payment         An Organization       Organization       Org. Name
 Authorization   that receives their   should hold an     Account no.
 Center          customer bill         account.
                 payments via the
                 bank.
 Loan            It represents the     Client holds       Account No.
                 money lent to a       account.           Date
                 client.                                  Amount
                                                          Duration

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

Finding Association
    Physical Location (next to)
    Physically contain each other (Water in kettle, Contained in)
    Composed of each other (Computer System)
    Form a conceptual Collection (Student in a class)
    Directed actions (Drives), related actions
    Communication (talks to)
    Ownership (has, part of)
    Satisfaction of some condition (Work for, married to, manages)
    Relate objects (Work for)
    Apply some operations to all parts
Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

Refining Associations
        Is the association between eliminated classes?
        Are any of the associations irrelevant or
      implementation associations?
        Are any association transient?
        Are any of the associations ternary?
        Are any of the association derivable?
        Are there any missing associations?



Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

Identification of Inheritance
      Identification Shared or Common behavior
                                                 Vehicle
   Animal                  Samples
                      Hierarchy | Multiple
                                             Motor         Water
            Mammals


                  Human                         Water Motor



                       Lectures              Jet Ski   Motor Boat

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Identification of Inheritance
Case study 1: Online Banking


                  Transaction




      Transfer          Bill          Loan
      Of Funds        Payment       Application



Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Use Case Realization- Case study 1
            Online Banking- Final Analysis Class diagram

  Account                 Invokes        Transaction
  Holder                                                                        Loan
            holds
                    Account                                               Updates
Authorized by

          Maintained                              Bill              Loan
                              Transfer                            Application
          by                                    Payment

   Bank         Updated                           Records Contacts
                                Records
                by                                              Payment
                                            Statement         Authorization
                                                                  center


Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Identification of Packages
    Allocate use cases to a package based on
             Same actors, Similar business process
             Relationship between use cases
     Include in the package all classes and collaborations
     associated with the use cases
    Identify all dependencies between packages
    Attempt to localize modifications due to changes in
    process/actors
    If you identify common functionality used in multiple
    packages, extract this functionality into a new package

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML


Special Requirement
          Persistence
          Distribution and concurrency
          Security features
          Fault tolerance
          Transaction management



Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Refining Model
      Are there any missing analysis Objects ?
      Are there any unnecessary classes?
      Are there missing associations?
      Are there any unnecessary associations?
      Are all attribute descriptions in the correct class?
      Are all associations in the correct place?
       Do all operation descriptions fit with the role of the
     class within which they have been defined?



Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
      Requirement Workflow                   Analysis Workflow

         Language of Customer                 Language of Developer

                                           Internal View of system w.r.t
     External View of Functionality
                                                   Functionality
                                        Structured by Stereotypical classes
        Structured by Use Cases
                                                   and Packages
                                        Used to understand what the system
   Used to understand what the system
                                          needs to do to support the user
                should do
                                                    requirements
      May Contain redundancy and        Should not contain redundancy and
              inconsistency                        inconsistency
                                         Outlines the key Concepts which
   Captures Functionality of the System
                                              important to the system
            Define Use Cases               Define Use Case Realization

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

OOAD Life Cycle Products

                                   Now Here




  Use Cases   Analysis   Design      Source   Exec
              Classes    Classes      Code


Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML


                Chapter 6




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Design Workflow
   “How the system should be build, rather than
    trying to rephrase the system requirement”
Activities
         Architectural / Subsystem Design
         Generation of Design Classes
         Generation of Design Interfaces
         Generation of design use cases use case realization
         Generation of Subsystems


Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

                Design
                Model       Deployment
                              Model


   Design        Produces       Design
                              Subsystem
                                       Design Use Case
                                              realization



                             Updated Data Dictionary



Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

          Analysis Workflow                     Design Workflow

            Conceptual Model                       Physical Model

                                          Determines how system will meet
      Describe functional requirement
                                                    requirement

         Only uses 3 type of classes            Classes as appropriate


            Less Complex (1:5)                   More Detailed (5:1)


          Less formal Description              More formal description

                                        Created by prototypes, visual analysis
    Created by workshops, interviews etc
                                                    engineering


Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Design Model
           Analyze Use Cases
           Identify design classes, interfaces and Subsystem
           Identify the dynamic behavior of classes
           Identify attributes and operations
           Design algorithms to implement operations
           Optimize access paths to data
           Implement control for external interaction
           Adjust class structure to increase inheritance
           Design associations and aggregation
           Produce the deployment model

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Design Class Notation

         Representing Attributes
         Representing Operations
         Stereo type Classes
         Composite Classes



Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

Identifying Design Classes
      For Boundary Classes should be implemented with
      appropriate interface class
        For Entity Classes will need to determine what classes,
 files, database etc., to implement these classes.
      Control Classes, will implement the behavior or
      transaction.




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Refining Classes
     Is the class Cohesive?
     Are any of the classes redundant?
     Are any of the classes irrelevant?
     Are any of the classes vague?
     Are any classes really attribute of other classes or operations?
      Does the name of the class represent its intrinsic nature and not its role
    in the application?
      Is a class really an implementation construct?
     Are classes just data/operation?
     Do any subsystem interfaces imply classes?
     Do any other interfaces imply classes

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

Identifying & Refining Attributes
      Should the attribute be an Object?
      Is an attribute really a name?
      Is an attribute an identifier?
      Is an attribute really a link attribute?
       Does the attribute represent an internal state of the object that is not
  visible outside the Objet?
      Does the attributes unlike the others in their class?
      Is there any duplication of attributes?
      With all the attributes in place is a class too big?
      Has the class became too complicated due to attribute?


Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

Identifying Operations
         Operations form analysis classes
         Operations implied by events
         Operations implied by state actions and activities
         Operation form interaction Diagram
         Domain operations
         Simplifying operations




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

Refining Operations
       Look for simplifying operations
       Visibility of operations
       Traceable to a use case realization
       Ensure that all roles played by class are supported
       All operation should be documented
              (Function, I/O, dependency)




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Analyzing Use Cases :
     Generate Class from Use Case
    Look for classes in use case
    Consider the implications of the use case for system interfaces
    Examine control classes and consider functionality
     Add new class when required and include its definition in the data
dictionary




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Case study 1: Online Banking
 Set of classes

       Account
                               Account                 Transaction
        Holder



                              Payment
        Bank                 Authorization                Loan
                                center


                  Transfer                     Bill
                  Of funds                   Payment




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

Design Use Case realization
   A textual flow of events description
   Class diagrams depicting the interacting classes from the viewpoint
   of use case
   Interaction Diagram (collaboration, sequence) should be added at
   this stage if necessary
   The subsystems and system interfaces involved in use cases




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Class Diagram
    “A good class model consists of classes which
  represent enduring classes of domain object, which
 don‟t depend on the particular functionality required”


     Shows a set of classes, interfaces, and collaborations
     and their relationships.

     Addresses the static design view of a system.




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML


Parts of Class Diagram

                 Association
                 Attribute
                 Operations
                 Generalization




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Association
    “A description of a related set of links between
                 objects of two types”
                               Associations


            Class1                Class2




                      has
             Car                   Engine

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Types
              Multiplicity
              Qualified
              Navigability
              Ternary
              Recursive
              Class

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Multiplicity

                 Class2     1
          1..*
                 Class2     1 or more

         0..1
                 Class2     Zero or 1

            *    Class2     Zero or more

          3..*
    {ordered}    Class2     Specifies Ordered

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Qualified Association
   “A Qualifier distinguish the set of object at the far
       end of association based upon the value”
                 To reduce multiplicity

          Class1    Q               Class2

                                             Qualifier

         Bank    Acc. No.               Account

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Association Class
  “Association class allows the addition of attributes,
    operations and other features to associations.”


     Person    *                1 Company



                   Employment
                   Period:
                   DateRange         Association
                                       Class


Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Navigability
  “Association can get hold of objects in both or one
                      direction”

                                        Navigability

      User                        Password


        “Given a user, password is accessible;
   But given a password, the user is not identifiable”

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Recursive Association
             “Association made to itself”


    Boss
                                            Role
                  Person


                       Worker

                                      Recursive
                                     Association

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Aggregation
                 “Physical Whole-part
                            or
          logical assembly-part relationship
                           and
                life-time containment” Aggregation

                      1         n
              Class                   Chair

                      1        3..*
            Polygon                   Point
                          {ordered}

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Composition
            “Whole Solely owns the Part”

          “The part live and die with the whole.”


                          1    0..7
              Hand                    Finger


                          1     64
            Chess Board               Square

                               Composition

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Identifying Association
        Look at the analysis entity class association
        Look at messages in interactions diagram
        Look at the use of interface
        Look at access paths
        Consider association multiplicity, role
         name, association classes, ordering
        Consider whether association is aggregation



Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Refining Association
     Is association between eliminated class
     Are any associations irrelevant or implementation associations?
     Are any associations transient?
     Are there any missing association?
     Attempt to minimize association?
     Are any of the associations derivable?
     Are any association misnamed?
     Add role names where appropriate?
     Are there any qualified associations?
     Specify multiplicity on the associations?


Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

Identifying Interfaces
     Interfaces between subsystems
     Dependencies between layers
     Dependencies between
               Classes
               Classes and subsystem
               Subsystem and subsystem




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML


Identifying Inheritance
       Common operations and attributes between class
       Special case of classes
       Common association and dependencies
       Move functionally and attributes up the hierarchy as high as
   possible




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Class Diagram             : Case study 1: Online Banking
 Authorizes                    1        Bank
      1..*                                                 Maintains
               Account
             1 Holder              Name

              Name                    1     1..*      Account
 Initiates    PIN            Acc. No. holds
                                                   Account No.             2
       1
                          1
  Transaction            applies
                                     Loan              1
  Date                             Date
  Amount                                                         Payment
                            1..*   Amount
                                                                 Authorization
                                   Duration
                                                                 Center
                                                   updates
                                          1                      Organization Name
 Transfer of             Bill Payment
                                          1    updates                 1
 Funds
Acc. No.2                Bill Details
                                                                           updates
         1

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

 When to use Class Diagrams
  • Class Diagrams are the backbone of nearly all OO methods
  so it is indispensable.

  • Class Diagrams can be viewed from three perspectives.
      • Conceptual model: The diagram represents the concepts
         in the domain under study. In the analysis stage,
         this model is drawn.
      • Specification model: Here we are looking at the
         interfaces of the software. When working with the
         software, this model is focused on.
      • Implementation model: When illustrating a particular
         implementation technique, use this perspective.
Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML


Dynamic Behavior

       Collaboration Diagram
       Sequence Diagram




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Collaboration Diagram
    “Illustrate the sequence of messages between
     objects based around the object structure ”

 Elements
        Objects
        Links
        Actors
        Activations (Flow of Control)

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML


   Defines an interaction and is a society of roles and other elements
   that work together to provide some cooperative behavior that’s
   bigger than the sum of all elements.

   Represent the implementation of pattern that makes up a system.

   Have structural as well as behavioral dimensions.

   A given class might behave in several collaborations.




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Objects
     “a thing you can interact with, how it behaves
         depends on the current internal state”

Activation
   “In procedural interactions , exactly one object is
     computing at any one time. An object start to
   compute when it receives message, at moment is
           said to have a live “activation” ”
 Actors
      “A Class, that is, a description of a behavior”

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

Links
  “Links between objects are shown like association
                in the class model ”
Types
           A     Association (Permanent) Link
           F     Object Field
          G      Global Variable
           L     Local Variable
           P     Procedure Parameter
           S     Self reference

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

Format of Message
      A Comma separated list of sequence number in
      bracket “[se1no]”
      A list of sequence elements separated by full stops “.”
      A return value name followed by an assignment
      sign “:=“
      The name of the message which is an event or
      operations name
      The argument list of the message


Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Design Collaboration Diagram: Case study 1: Online Banking
                          Transfer of Funds
                                                 6: UpdateBalance()

: AccountHolder                       :Account                :Transferfunds
         1:Enter PIN()
                                                                           8: Balance
                                                   5: CheckBalance()
                                                                           Deficit
  : LoginForm
                                                             Acc.No.1:Account
       2:check PIN():=find(PIN,Acc No.1)


 : Transaction           Acc.No.2:Account

        3: get Acc. No.2()          4: check Acc. No.2()=find(Acc. No.2)
           get Amount()
                                              7: InvalidAcc.No.2

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Sequence Diagram
   “It pictures, for a particular scenario of a use case,
  the events that external actors generate, their order,
                 and inter system events ”
 Elements
        Objects
        Actors
        Time


Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
               Object1   Object2   Object3
                                               Control
                                                Flow
   Actor

              Object



                                             Modules‟s
  Object‟s                                   Life Time
  Lifetime


Sequence Diagram
Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML



           Symbol              Control flow

                             Synchronous or Call

                                   Return

                                    Flat


                               Asynchronous




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

Generating a Sequence Diagram
      Identify all the classes involved in particular sequence
      Determine life line of the objects
      Identify the initiating event
      Determine the subsequent message(s)
      Identify the focus of control for the objects
      Identify any returned messages
      Identify the deviations



Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
                                             AccNo2            AccNo1           :Transfer
               :Login   :Transaction
                                            :Account          :Account            Funds
 Account
  Holder
       1:PIN                     2:Acc no1()

                   3:Acc no1   4:Acc no2
      Invalid                                     5:Valid()

                                  Invalid

                                                  6:Amount
                                                                         7:okBalance


                                                                    8:updateBalance()

                                                                      DeficitBalance

                                                  9:updateBalance()



Sequence Diagram - Case study 1 : Online Banking-Transfer of Funds
Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
                                               :Payment             :Bill
              :Login    :Transaction          Authorization       Payment            :Account
                                                 center
Account
 Holder
      1:PIN                    2:Acc no1()

                  3:Acc no   4:Bill Details
     Invalid                                       5:Valid()

                                Invalid                                6:CheckBalance()

                                                                        okBalance

                                                                       7:updateBalance()
                                                   8:UpdateBalance()




                                                                        DeficitBalance




Sequence Diagram - Case study 1 : Online Banking-Bill Payment
Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Sequence Vs Collaboration Diagram
  • In Sequence diagram, it is easy to capture the time-ordering
  of events.This diagram is preferred when emphasis is on
  the sequence of the events that occur.

  • Collaboration diagram, on the other hand is used when the
  developer wants an idea of the layout of objects that is how
  objects are statically connected.

  • The principal feature of both the interaction diagrams,
  is its simplicity.



Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
When to use Interaction Diagrams

 • When the developer wants to look at the behavior of
   several objects within a single use case, the interaction
   diagrams serve to be helpful.

 • Interaction diagrams are best suitable when the behavior
   of objects is simple.

 • They are good in showing collaborations among objects;
   but not the precise definition of the behavior.



Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
State Chart
   “It pictures, for a particular scenario of a use case,
  the events that external actors generate, their order,
                 and inter system events ”
 Elements

     Start Point                Set of State Variable
     Events                     Set of States
     Set of Transitions         Set of Exit Points


Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

    Is a behavior that specifies the sequence of states an object or an
    interaction goes through during its lifetime in response to
    events, together with its responses to those events.

    The behavior of an individual class or a collaboration of classes
    may be specified with a state machine.

    Involves a number of other elements, including states, transition
    (the flow from state to state), events (things that trigger a
    transition), and activities (the response to a transition).

    Graphically it is represented as a rounded rectangle, usually
    including its name and sub states, if any


Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Start Point
  “the point at which the state diagram is initialized.
     Only one entry point for the whole diagram”
                                         E.g., Start
 Events
 “Events are one way asynchronous transmissions of
      information from one object to another”
           EventName (param : type, … )


  event (arg) [condition] ^tgt.sendEvent(arg) / Operation(arg)

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
A Set of Transitions
   “The Statement move the system form one state
                 to another state”

Parts of Transitions
         Events
         Conditions
         The initiated Event
         An Operation

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
A Set of State
  “A period of time during which an object is waiting
                 for an event to occur”

 States
          Entry                 E.g., State

          Exit                                State

          Operations
          Events

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Set of State Variable
      “Variable that referred in a state diagram”
                          name : type = Value


A Set of Exit Point

 “A State which terminate execution of state diagram”

                               E.g., Exit

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

Building a State Diagram
     Pick a class
     Pick one sequence diagram involving that class
     Follow the events for the class, gap between are states
     Draw set of states and the event that link
     Find loop of sequence




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML




 State Diagram with internal Concurrency

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML




 State Diagram with external Concurrency

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
  Case study 1 : Online Banking-
                         StateChart for Account Class in Transfer of Funds

                           Valid(Acc.No.1,PIN)[PINentered=PIN]
                           /GrantAccess(Acc.No.1)
                       Initiated

      LoadData(Acc.No.1)                   Logout(Acc.No.)/Commit


RequestBalance/                         TransferFunds
getBalance(Acc.No.1)   Active           ^Transaction.newTransaction(Acc.No.1)
                                        / Accept(AccNo2,Amount)
               UpdateBalance
               ^Transaction.Record
               / updateBalance(Acc.No.1,Balance-Amount),
               updateBalance(Acc.No.2,Balance+Amount),

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Case study 1 : Online Banking-
                                  StateChart for the entire System
                                                           Transaction
                       StartUp/setup(System)               ^ Account. Transfer
                                                           (or BillPayment)

                  Initiated

          LoadData()             Valid(Acc.No.1,PIN)[PINentered=PIN]
                                 /GrantAccess(Acc.No.) UserLogged
                   Ready
      Shutdown                                               On

                               UserLogsOff      RequestBalance
                                                / Account.getBalance(Acc.No.)
            UserLogged
                Off



Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
When to use State Diagrams

 • State Diagrams are good at describing the behavior of
   an object across several Use Cases.

 • They are not good in describing the behavior of several objects
 collaborating together.

 • Use state diagrams only for those classes that exhibit
 interesting behavior, where building the state diagram,
 helps in understanding what is going on.
 (Eg.) UI and control objects.


Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Activity Diagram
    Shows the flow from activity to activity.
    Activities result in some action.



Elements
                   Activity states and action states
                   Transitions
                   Objects



Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
                 ACTIVITY DIAGRAM
                            Decision Activity
     Start




                             Synchronization
     End                          Bar



                                  Activity


Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Case study 1 : Online Banking- Activity Diagram for Transactions
                       Account Holder                           Bank System
                                             Verify
           [BillPayment]      Input         Amount
                           Bill Details
                                            Verify
        [TransferFunds]
                                           Recipient
  Input Transfer
     Details



                                           Check Transfer           Check
                                            Account No.            Amount



                                                                        [Failure]

                                                    [Success]


                                          Update            Record
                                          Balance         Transaction



Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

When to use Activity Diagrams

     • Analyzing a Use Case.

     • Understanding workflow across many Use Cases.

     • Dealing with multi-threaded programming.




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

When Not to use Activity Diagrams

    • Trying to see how objects collaborate:
           Use Interaction diagrams.

    • Trying to see how an object behaves over its lifetime:
           Use State Chart diagram.




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

Remaining Steps
           Optimizing Design
           Testing Access Path
           Implementing Control
           Adjusting class Structure
           Designing Associations
           Object representation



Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

OOAD Life Cycle Products

                                            Now Here




  Use Cases   Analysis   Design    Source      Exec
              Classes    Classes    Code


Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Implementation Workflow
 “How the system should be implemented physically,
           Rather than trying it logically”
Artifact
              Implementation Model
              Deployment model
              Architecture description
              Actual Implementation
              Integration build plan

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML


Activities
        Implement skeleton architecture
        Define implementation model
        Implement subsystem, classes and interfaces
        in any language
        Integrate the systems




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Component Diagram
 “Shows the dependencies between part of the code”


     Shows the organizations and dependencies among a set of
     components.

     Address the static implementation view of a system.

     They are related to class diagrams in that component maps to
     one or more class, interfaces, or collaborations.




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

                           ISpell                   ITherasus
  Interface
                                                component


                                    Wordsmith.dll




         Ifindandreplace




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML


                          <<Link>>    OBankClient
           IOStreams
           <<library>>                 <<executable>>



                                           <<Compile>>



                                     OBankInterface



       Dependency

                         component

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Deployment Diagram
 “Shows the Structure of the runtime system”
    Shows the configuration of runtime processing nodes and the
    component that live on them.

    Addresses the static deployment view of architecture.

    They are related to component diagrams in that node typically
    encloses one or more components.

    Serves helpful in distributed systems.



Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

                    Node(System)


         Mac:
      Workstation
                             <<ISDN>>


                                           Apache
                       <<ISDN>>
                                           Server

         IBM:
      Workstation
                                   Dependency

 Physical Deployment Diagram
Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

                                      Apache
     IBM: Workstation
                                      Server


      M1:OBankClient

                        <<ISDN>>    C1:
                                    OBServer

      L1:
      OBankInterface




 With S/W, Deployment Diagram

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

Refining the Implementation
     Does the implementation match the model?
     Does a class still provide a single role?
     Does a method implement one function?
     Are you increasing the dependency between   classes?
     Have you overdone inheritance?
     Are you using existing classes?
     are you reusing patterns?


Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

OOAD Life Cycle Products




  Use Cases   Analysis   Design    Source   Exec
              Classes    Classes    Code


Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML




Department of Mathematics and Computer Applications
What is this?
Erroneous State (“Error”)
Algorithmic Fault
Mechanical Fault
How do we deal with Errors
      and Faults?
Verification?
Modular Redundancy?
Declaring the
     Bug
as a Feature?
Patching?
Testing?
 Object Oriented Analysis & Design With UML

Purpose
     To plan the tests to be performed for each iteration of
     the system as well as the final deliverable
     To design and implement the test cases by creating
     executable test cases
     To systematically perform the tests and analyze the
     results obtained




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

Testing Plan
              Plan tests
              Design Tests
              Implement Tests
              Perform integration tests
              Perform System tests
              Evaluate Tests


Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

 Types of Testing
                 Usability Test
                 Module Test
                 Integration Test
                 System Test
                 Acceptance Test
                 Performance Test
                 Stress Test
                 Regression Test
Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
                         Professional
                            Tester                         too familiar
                                            Programmer     with code

               Analyst



                            Test                System
        User                Team                Designer




  Test Team                     Configuration
                                Management
                                  Specialist


Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML


   • The Unified Modeling Language (UML) has gained broad
   industry acceptance as the industry-standard language
   for specifying, visualizing, constructing,
   and documenting the artifacts of software systems.

   • It simplifies the complex process of software design,
   making a "blueprint" for construction.

   • The UML definition was led by Rational Software's
   industry-leading methodologists, Grady Booch,
   Ivar Jacobson, and Jim Rumbaugh.



Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
  UML And the E-world
 • Well-suited to the new demands of the brave new e-world,
  the Unified Modeling Language (UML) was designed
 to be distributed, concurrent, and connected.

 • It is based on objects.

 • Objects are distributed -- each one maintains its own state,
  distinct from all others.

 • Objects are concurrent -- each one can potentially execute
  in parallel with all others.

 •Objects are connected -- each one can send messages to
 others through a Web of links.
Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
  UML And the E-world

 • UML is not tied to a single platform or programming language;
  therefore it is well suited to bridge networks of different systems.

 • UML was designed with extensibility in mind,
 so it can adapt to new issues as they arise.

 • UML is a living language that evolves to meet changing needs.




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML




              Case Study- 2
            Elevator Problem




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
 Problem Statement
  A product is to be installed to control elevators in a building with m floors.
  The problem concerns the logic required to move elevators between floors
  according to the following constraints:
      • Each elevator has a set of m buttons, one for each floor.
       These illuminate when pressed and cause the elevator to
       visit the corresponding floor. The illumination is canceled
       when the elevator visits the corresponding floor.
      • Each floor, except the first floor and top floor has two buttons, one to
       request and up-elevator and one to request a down-elevator.
       These buttons illuminate when pressed. The illumination is canceled
       when an elevator visits the floor and then moves in the desired direction.
      • When an elevator has no requests, it remains at its current floor with
       its doors closed.
Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
 Architecturally Significant Use Cases
 They involve
     Some Important and Critical Functionality
     Functionality at the extremes of the Systems
     Some Important requirement that needs to be
      implemented/tested early in the project lifetime
     Importance to users
     Highest risk of failure




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
 Generate Architecture
     Organizing the System into subsystem
     Identifying major system interface
     Identifying concurrency inherent in the problem
     Allocating subsystems to processors and tasks
     Choosing an approach for management of data store
     Handling access to global resource
     Considering generic design issues
     Handling boundary conditions
     Setting trade-offs between competing priorities

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
 Identifying Subsystems
      Look at analysis model
      Look for separation of design concerns
      Look for functionality related classes and interfaces
      Look for classes, interfaces and subsystems
      Look for large grained components
      Look for reusable components
      Look for interfaces
      Look for S/W products that need to be wrapped up as
      subsystem
      Look for legacy system which need to be wrapped up as
      subsystem
Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
 Accessing the Subsystems
      Consider design Criteria and assess subsystems against
      them
             High Cohesion
             Low Coupling
             Fulfillment of a purpose


      Qualify the compliance of the architectures against the
 decision criteria



Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML



 Identifying Key Classes
        Must provide the realization of the architectural
        Use Case
        From the beginning of Analysis Modeling




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

Improve Concurrency
     Estimate performance needs and the resources
     needed to satisfy them
     Choose H/W or S/W implementations for packages
     Allocate package to processors to satisfy
     performance and minimize IPC
     Determine the connectivity of the physical units that
     implement the packages
     Consider connection between nodes (Protocol)
     Consider the need for redundant processing


Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

Identifying Active Class
     Look at performance issues
     Look at resource issues and access to resource
     Distribution implies multiple active classes
     Reliability issues
     Two processes calculate a result simultaneously
     Need to consider dynamics of active classes




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Managing Data Store
    Data persistence
    Purchase Cost          Extensibility
    Life cycle Cost        Concurrent Access
    Amount of Data         Crash recovery
    Performance            Distribution




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
Architectural Concerns
     Choosing the Implementation of Control in S/W
              Procedure Oriented System
              Event-Driven systems
              Concurrent System
     Identify Generic Design Mechanisms
              Persistence of information and objects
              Object distribution philosophy
              Security , Error Detection & Recovery
              Transaction Management

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML
     Handling Boundary Conditions
               Initialization
               Termination
               Failure
     Setting trade-offs between Competing Resource
     Specifying default policies for the Object Design
               Association
               Derived Data
               Role name
               Attribute Name & Null

Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

Boundary Class

    Interaction with the Actors                    Object1
    Sending and Receiving Information
    Abstraction of GUI
    Should be linked with at least one actor   <<boundary>>
                                                cClass Name


    Example:                   GUI


Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

Control Class
               Functionality to Manage
               Co-Ordination and sequencing


                                         <<Control>>
          Object1                        cClass Name



                       Calculate
          Example:      Balance


Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

Entity Class
 Persistence of information over the period         Object
 of time
 Types of Entity Class

              Physical                          <<Entity>>
                                               cClass Name
              Logical
              Soft
                                 Example: Account
              Conceptual


Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML


         Key     Name : type = initial value


     $       Static / Class
                                 / Derived Value
     +       Public           Example
     #       Protected                  Person
                                       Birth_Date
             Private                      / age
                              {Age = currdate – birth_date}
   <blank>   Package



Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

  Key Name( param : type = default value, …) :
                                  Return type




  Example (Java)
  + $ main( argv : String[]) : void
            {Public static void main( String argv[]);}




Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

Stereo Types
         <<interface>>
         <<use>>
         <<type>>
         <<implementation class>>
         <<Persistent>>


Department of Mathematics and Computer Applications
 Object Oriented Analysis & Design With UML

Composite Classes
  “A Class may define a pattern of objects and links
        that exist whenever it is instantiated”




  “A Composition is a kind of pattern or template that
          represents a conceptual cluster”




Department of Mathematics and Computer Applications

				
DOCUMENT INFO