UML diagrams for dynamic analysis
They form part of the final project documentation. Perform a detailed dynamic analysis of the selected use case using an activity and interaction (sequence) diagram. The state diagram will usually describe a wider context - the changing state of an object throughout the entire business process, consisting of multiple use cases.
Dynamic analysis, like the entire design phase (which results in design documentation), should be done before starting the implementation of the selected use case of the final project.
Based on the detailed activity diagram, you can design a user interface for a given use case.
Activity diagram for a use case
- The activity diagram is to refer to a single use case (and not e.g. the entire business process) - i.e. a single interaction of one user with the system.
- If a given use case combines with others (through the «include» or «extends» relation) then for the readability of the diagram they should not be drawn, but only marked as individual activities (with an appropriate annotation).
- Present all relevant (from the programmer’s point of view) activities - both the user (e.g. selection of options from the menu, input of data on the form, pressing the button) and the application (e.g. display of the form, validation of entered data, display of the message, save to database, etc.).
- Due to the division of activities into those performed by the user and the application, the use of “swimming lanes” (swimlanes) to improve the readability of the diagram may be considered.
- A decision node means just making a decision. If the decision depends on the verification or calculations preceding it, this should be expressed in the form of activity before the decision node.
Exercise
Draw an activity diagram for the following requirements:
The company “Prof. Edker” deals in running the auction site smoking ovens *. One of the system’s functionalities is creating a new auction.
In order to start creating a new auction, the registered user selects the appropriate function in the menu. The auction can be created based on one of the user’s previous auctions (if present), or created from scratch. If the user creates an auction based on an existing one, the user should first select it from the list, after which the form for creating the auction will be filled with data from the existing auction. Otherwise, a blank form will be displayed. The form data includes: name of the furnace, type (electric or wood-fired), capacity, year of manufacture (cannot be from the future), condition of the device, additional description. After entering the data and the system validating successfully, the user selects the available delivery options for an auction. Delivery options are: courier delivery, personal pickup, and for sellers with a premium account also pickup at the “Prof. Edker” headquarters. After selection delivery options user should pick available payment options. Payments can be made by prepayment to the account, online payment or on delivery. In the case of prepayment or online payment, the user should choose one of his bank accounts saved in the system, or add a new account. After that the data is saved in the database. The seller can publish the auction immediately or save it as a draft.
*Smoking ovens are devices for conducting food processing at moderate temperatures with high smoke of organic origin :-)
//: # (For the “Create Auction” use case described above, draw a sequence diagram. Include the main use case scenario.)
State diagram
- For this diagram you must first specify which class of objects you will analyze. Select one of the entity classes for the project.
- Usually it covers more than one use case.
- There are no decision nodes in this diagram, but there can be many transitions from one state to another.
- Initial state means creation of the object, and final state its permanent removal from the database. We don’t always want objects of the class to be deleted, so the diagram may not have the final state. In this case, the final state can be replaced with a state, e.g. Archived.
Exercise
Suggest a state diagram for the “Auction” class in the auctioning system. Include use cases other than those described above.