Docstoc

Object model and event trace

Document Sample
Object model and event trace Powered By Docstoc
					Georgia State University, Computer Information Systems Department




         Parts of the OMT Model explored

                                  Object Model
                                   Event Trace
                                 State Transistion



©Duane Truex, 1997 CIS813 Object Oriented Specifications                        page 1




Georgia State University, Computer Information Systems Department



   The Object Model
 x   Start Simple
     – only those essential object classes within the clear scope of
       the system
          » initially without inheritance and associations
          » e.g. ATM System




                 AM Machine                          Transaction



                 Authorization                         Account

©Duane Truex, 1997 CIS813 Object Oriented Specifications                        page 2




Georgia State University, Computer Information Systems Department



   The Object Model
 x   Build adding detail
     – associations and eventually cardinality and type of
       participation
          » focus remains on major business classes
              x multiple interface, data classes etc. wait until design phase




                 AM Machine                          Transaction




                 Authorization                         Account

©Duane Truex, 1997 CIS813 Object Oriented Specifications                        page 3
Georgia State University, Computer Information Systems Department



   The Object Model w/attributes
 x   adding attributes

                    ATM Machine
                                                             Transaction
                     ATM ID                                  TransType
                     Card No                                 Time
                     PinNO                                   Date




                    Authorization                            Account
                    PinNos                                   Type
                    LinkedAccts                              Balance
©Duane Truex, 1997 CIS813 Object Oriented Specifications                                 page 4




Georgia State University, Computer Information Systems Department

  Dynamic Model--Event Trace
 x   Provides interaction between the major classes of the
     system
     – prepared from the use cases and scenarios
 x   Very useful in refining the object model
     – for if an object receives a message it must have a method/
       operation to interpret the message
     – by examining event trace diagrams we can develop a lis tof
       operations needed by each object class in the object diagram
     – more scenarios==> more event traces==>more refined object
       models

     Scenario                          Event                    Object
                                       Trace                    Diagram

©Duane Truex, 1997 CIS813 Object Oriented Specifications                                 page 5




Georgia State University, Computer Information Systems Department


 Event Trace
 x   describes instances of objects and scenarios
     – one per scenario
     – vertical lines as objects
     – arrows as the event interactions between objects

       Customer        ATM Machine           Transaction:      Authorization   Account
       John Jones      35 broad St.          deposit
             inserts ATM card
                                    checks validityof card

                                     card is valid
              request PIN
              keys PIN
                                    aks to validate PIN
                                     PIN Invalid

©Duane Truex, 1997 CIS813 Object Oriented Specifications                                 page 6
Georgia State University, Computer Information Systems Department



     State Transition Diagram
 x   Emphasizes use of events and states to specify system
     control
      – only needed when we have a dynamic class
          » and then one diagram per dynamic class
 x   Each state represents some instance of an object
      – only the value of the state changes

                       Light switch class
                      switch changed
            off                      on
                      switch changed do:power on




©Duane Truex, 1997 CIS813 Object Oriented Specifications                          page 7




Georgia State University, Computer Information Systems Department

 State Transition Diagram
 x   behavior of a class and transition to-from different states
      – captures temporal evaluationof an object instance of an object
        class
 x   it is the formal specification of the behavior of a class
      – Looks at the object’s perspective e.g. what happens to ‘me’,
        object D when event 1 occurs
  Ev1
                                                                   D
                  A                              do m1

                          C                       do m2
                  B

                         D


©Duane Truex, 1997 CIS813 Object Oriented Specifications                          page 8




Georgia State University, Computer Information Systems Department


 States
 x   What is a state?
      – value of the attribute(s) of an object
 x   What does it mean to change state?
 x   Does the order of an event/message response matter?
 x   e.g Customer                  Payment received message (1000)
                                                 state after message?
              Customer
                                                 Place order (2000) response?
         balance (6000)
         credit limit (5000)
                                                 Payment receiveed (3000)
         name
                                                 Order?
                                            Order matters: how a class behaves
                                            depends on state (attribute values)

©Duane Truex, 1997 CIS813 Object Oriented Specifications                          page 9
Georgia State University, Computer Information Systems Department


 When are state transition diagrams needed?

  x   If, based on a given method or given method order, the
      behavior will be different, then a state transition
      diagramis needed
  x   If not use a table to represent responss to messages
        message              action
        m1                 decrease balance by x
        m2                 increase balance by x
        m3                 accept order


©Duane Truex, 1997 CIS813 Object Oriented Specifications                    page 10




Georgia State University, Computer Information Systems Department



   state transition example                              (states of customer acct)



                                          exceed credit limit
                 Solvent




                                                  insolvent
                      reduce bal. below
                      credit limit

  transitions are assumed to be all or none-at-all
  and they are considered instantanious

©Duane Truex, 1997 CIS813 Object Oriented Specifications                    page 11




Georgia State University, Computer Information Systems Department



   Team Exercise--
  x   build candidate state transition diagram for an elevator




©Duane Truex, 1997 CIS813 Object Oriented Specifications                    page 12

				
DOCUMENT INFO
Shared By:
Stats:
views:88
posted:10/10/2011
language:English
pages:4
Description: Object model;event trace;OOM;Object Oriented Methodologies