Objected Oriented Modeling and Design with UML

Document Sample
Objected Oriented Modeling and Design with UML Powered By Docstoc
					Objected-Oriented Modeling and
       Design with UML

          Chapter 11
        Domain Analysis
                 Contents

   Overview of Analysis
   Domain Class Model
   Domain State Model




                   Domain Analysis   2
             Domain analysis

   Understanding the real-world essence of a
    problem
   Clarify the requirements
   Provide a basis for agreement between
    the stakeholders and the developers
   Become the staring point for design and
    implementation

                    Domain Analysis         3
Overview of Analysis




       Domain Analysis   4
            Overview of Analysis

   Three aspects of objects:
       Static structure of objects (class model)
       Interactions among objects (interaction model)
       Life-cycle histories of objects (state model)




                        Domain Analysis             5
            Overview of Analysis

   Application analysis
       Build on the domain model
       Add major application artifacts visible to users
        Must be approved by users




                         Domain Analysis               6
            Domain Class Model
   Find classes
   Prepare a data dictionary
   Find associations
   Find attributes of objects and links
   Organize and simplify classes using inheritance
   Verify that access paths exist for likely queries
   Iterate and refine the model
   Reconsider the level of abstraction
   Group classes into packages
                        Domain Analysis                 7
               Find classes

   consider nouns




                     Domain Analysis   8
ATM Case Study




    Domain Analysis   9
Domain Analysis   10
                 Find classes
   Redundant classes
   Irrelevant classes
   Vague classes
   Attributes
   Operations
   Roles
   Implementation constructs
   Derived classes
                      Domain Analysis   11
             ATM Case Study

   Data Dictionary




                      Domain Analysis   12
                Find Associations
From verb phrases in the problem statement:
     Physical location
          NextTo , part of, ContainedIn
     Directed actions
          Drives
     Communication
          TalksTo
     Ownership
          Has, part of
     Satisfaction of some condition
          WorkFor, MarriedTo, Manages

                           Domain Analysis   13
ATM Case Study




    Domain Analysis   14
    Keeping the Right Associations

   Associations between eliminated classes
   Irrelevant or implementation associations
   Actions
   Tenary associations
   Derived associations
   Misnamed associations


                    Domain Analysis             15
    Keeping the Right Associations

   Non-redundant associations




                   Domain Analysis   16
    Keeping the Right Associations

   Association end names
   Qualified associations
   Multiplicity
   Missing associations
   Aggregation



                    Domain Analysis   17
ATM Case Study




    Domain Analysis   18
                 Find Attributes

   Attributes usually correspond to nouns
    followed by possessive phrases.
   E.g.
       The color of the car
       The position of the cursor




                        Domain Analysis      19
     Keeping the Right Attributes
   Objects
   Qualifiers
   Names
   Identifiers
   Attributes on associations
   Internal values
   Find detail
   Discordant attributes
   Boolean attributes

                       Domain Analysis   20
ATM Case Study




    Domain Analysis   21
       Refining with Inheritance

   Bottom-up generalizaiton
   Top-down specialization
   Generalization vs. enumeration
   Multiple inheritance
   Similar associations
   Adjusting the inheritance level


                    Domain Analysis   22
Domain Analysis   23
         Testing Access Paths

   Trace access path through the class model
    to see if they yield sensible results.
   Are there useful questions that cannot be
    answered ?




                    Domain Analysis         24
          Iterating a Class Model
   Signs of missing classes
       Asymmetries in associations and
        generalizations
       Disparate attributes and operations on a class
       Difficulty in generalizing cleanly
       Duplicate associations with the same name
        and purpose
       A role that substantially shapes the semantics
        of a class

                        Domain Analysis              25
          Iterating a Class Model

   Look out for missing associations:
       Missing access paths for operations
       Lack of attributes, operations, and
        associations on a class
       Redundant information




                        Domain Analysis       26
          Iterating a Class Model

   Adjust the placement of attributes and
    associations:
       Association end names that are too broad or
        too narrow for their classes.
       Need to access an object by one of its
        attribute values.—qualified associations




                        Domain Analysis               27
Shifting the Level of Abstraction

   An example:




                  Domain Analysis   28
Shifting the Level of Abstraction

   Pattern
       A pattern distills the knowledge of experts
        and provides a proven solution to a general
        problem.
       E.g. the class Person is a kind of pattern
       The use of tried and tested patterns gives us
        the confidence of a sound approach and
        boosts our productivity in building models.

                        Domain Analysis                 29
Grouping Classes into Packages
   A package is a group of elements with a
    common theme.
   ATM example:
       Tellers– cashier, entry station, cashier station,
        ATM
       Accounts –account, cash card, card
        authorization, customer, transaction, update,
        cashier transaction, remote transaction
       Banks—consortium, bank

                         Domain Analysis                30
          Domain State Model

   Identity domain classes with states
   Find states
   Find events
   Build state diagrams
   Evaluate state diagrams



                    Domain Analysis       31
ATM Case Study




    Domain Analysis   32