












Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!













CS 487 Analysis Modeling Chapter 8 Overview of Database Design Data modeling What are the objects and associations in the enterprise? What information about these objects and associations should we store in the database? What are the integrity constraints or business rules that hold? A database `schema’ in the ER Model can be represented pictorially using UML notation. Can map this model into a relational schema. This will give us our "first cut" of the conceptual schema. (Show you how to build the tables in the database.) Data Modeling Basics Data Objects: Real-world object distinguishable from other objects. A data object is described (in DB) using a set of attributes. Has only data, no operations. Can be represented as a table. Each data object has a key. Each attribute of the data object has a domain. Association: The relationship among two or more data objects. Example: Wallace works in Pharmacy department. Cardinality ratios or Key Constraints Expresses the number of occurrences of one object that can be related to the number of occurrences of another object. One-to-one Data object A is associated with at most one data object B, and data object B is associated with at most one data object A.
One-to-many Data object A is associated with any number of data object B's. Data object B, however, can only be associated with at most one data object A. Many-to-many Data object A is associated with any number of data object B's, and data object B is associated with any number of data object A's. Note: With UML notation, this can be refined to express a specific number of associations (N) that are allowed. Modality (or Participation Constraints) Tells us if participation in the association is optional or mandatory. Total participation - an entity must have the relationship. It is mandatory. (Shown with a lower bound of 1.) Partial participation - an entity may or may not have the relationship. It is optional. (Shown with a lower bound of 0.) Example: Every loan account at a bank must have a customer. Not every customer of a bank takes out a loan. UML Notation for Data modeling basics: Model data only, no operations are modeled. UML Class diagrams are used to show data objects and their associations. Only a small subset of the notation is needed to draw: objects, attributes and their relationships. A partitioned rectangle is used for a data object. Primary Key - The attribute in the data object that uniquely identifies an occurrence or instance of the data object. Name
attributes
This is shown with a diamond and a line to all participating data objects.
Bahavioral Modeling: The goal is to show the dynamic behavior of the system with respect to specific events and time. It shows how the software will respond to external events or stimuli. The analyst must identify the states of the system, the events of the system and how the events will trigger a transition. These are shown using a UML statechart diagram. The statechart diagram will show the legal flows through the system. It shows how the states are linked with transitions. While in a particular state, work may or may not be going on. A statediagram is sometimes called a state machine. How to model a statechart diagram:
Action - A state can trigger actions. Actions are atomic computational procedures (non-interruptible). Five ways an action can be triggered: On Entry: As soon at the state is entered. Do: During the lifetime of the state. On Event: Triggered by an event. On Exit: Just before the state exits. Include: Invokes a submachine (another statechart diagram). The action must be implemented as a operation on classes (either this class, or on related classes). Actions when in the state are placed in this compartment. Other things are placed in the third: nested state diagrams, s sub-region name… Form for action line: Action label / action - used for entry, exit, do and include Event-name (parameters) [guard-condition] / action - used for events. The parameters may be a comma-separated list. The guard condition must be true for the event to trigger the action. Tips: If single exit out of state, the action is best expressed as an exit action on the state. Multiple exits, that have different actions, attach them to the appropriate transitions. The same event can be handled within the state, or trigger a transition, depending on the guards. Name
Internal transition compartment
Scenario Based Modeling: The goal is to understand how the users will interact with the system. Use Case a verbal description of a usage scenario. It is written from the perspective of a defined actor of the system. May be written as a paragraph or as an ordered sequence of user actions. If an ordered sequence is used, exceptions (alternate interactions) must be shown. A set of use cases should be developed to define all the actors, operational goals, objects and functionality of the system. In UML, this information may be shown with a diagram. Use Case diagram: A use case is a description of a scenario by the user. These are used to clearly communicate the requirements of the system to the developers. Defines the functional and operational requirements of the system. Takes the place of the DFD in flow oriented modeling. Models the system from the end-user's perspective. Use case diagrams show different levels of abstraction, just like DFDs. Objectives:
Relationship Actors are connected to use cases with a line. This line represents an interaction or association between the two. What this really means is eventually, the use case will be implemented with software and the actor will use it. A single actor may be associated with more than one use case and a use case may be associated with more than one actor. (actor role name) Rate IPRO Presentation IPRO judge Four other kinds of relationships:
Class Diagram and Object Diagrams Describes the static, or structural, aspects of the system. It describes how it is structured, not how it behaves. In the beginning of a project, you will model analysis classes. These are used to understand and model the problem domain classes. Later, as design advances, classes that are necessary for implementation will be added. Class diagrams contain classes , entities with attributes and operations, and associations. The associations represent the relationships that relate two or more classes. Object diagrams show the static structure of a system at a particular time. Object diagrams contain objects , instances of classes, and links, which are the instances of associations. Object diagrams show the actual values for the attributes. Object diagrams must follow the rules of the class model. Note: Object diagrams are often used to validate the class model of a system. If a problem occurs, then the object diagram is wrong or the class model has an error. How to draw a class: The class symbol includes compartments for the name, attributes and operations. All or any combination may be used. B is an attribute of A C is an operation of A Second example:
manufacturer model A
C()
year license plate number
start car() stop car() drive car() reverse car() brake car() turn on lights() turn off lights()
In the analysis phase general information will be included. By the design phase, details required for implementation will be provided, such as the parameters for the operations and how they should be defined. Attribute and Operation names: Basic form the same for both:
Associations: OO systems are constructed from class types that work together to accomplish the tasks of the system. They collaborate with each other by passing messages and receiving responses. When instances of one class pass messages to instances of another class, there is an implied association between the two classes. Association Names: An association is shown as a solid line. Between two classes is called a binary association. Remember, there can be more, but this is the most common type. The association can be labeled with a name to describe the relationship. An arrow-head can be used to show the direction of the description. ◄ owns Multiplicity: This describes how many instances of a class and object may be associated with. (In terms of data modeling, this is the cardinality.) Note: m..n, where m is the lower bound and n is the upper bound. 1, is short for 1..1. 0..* , means there may be zero and an unlimited maximum. * is short for 0..*. Aggregation & Composition: Home Person
Sometimes, the association between two classes describe the relationship that one class is made up or composed of objects of another class. UML has two special associations, that are part of the class diagram, to show these types of associations. They are not different associations, they just describe the nature of the association. Aggregation: Typically described as a "part of" relationship. An aggregation association is used to show that as well as having attributes of its own, an instance of one class, includes instances of another class. UML uses an unfilled diamond to show this. It is placed at the aggregate, the class that is made up of something else. ◊ (Shown with converging paths. May be shown with separate paths and four diamonds.) Composition: Typically described as a "whole-part" relationship. Book
Name Author
Topic Pagenumber
Activity Diagram Used to describe a workflow. Similar to statechart diagrams. They can be used throughout the lifecycle of a project. A few examples are listed below: In the beginning of a project, to during business analysis, to model high level business requirements and business workflows. High level workflows are examined to help identify candidate use cases. They are used to model workflow within and between use cases. They are used to model complex workflows in operations on objects. Terms: Activities, states and transitions. Activity: A unit of work that must be accomplished by the system. Drawn as a rectangle with rounded ends. The name is placed inside. The name should describe the actions to take place. Actions may be listed in the activity or they may also be documented separately in a text document. Similar to statechart diagrams, there are four ways to trigger actions: On Entry: actions are triggered as soon as the activity starts. Do: action takes place during the life time of the activity. On Event: actions take place in response to an event. On Exit: actions take place just before the activity completes. Actions may be simple English statements or programming statements. See example. A second form is: ^target.event(arguments) target - some object that needs to respond to the event. event - name of the event arguments - information passed with the event
State: A point where some event needs to take place before the flow can continue. Activities and states are roughly the same thing. Both have actions. Activities must complete all actions, before exiting normally. States are used to imply waiting, not doing. A state is drawn as a rectangle with rounded corners. Special states: Special State: ● - Start state. Only one allowed/diagram. ● - End State. Several allowed/diagram. Transitions: Used to show movement from one activity to the next, from one state to another or from one state to an activity… Drawn as an arrowed line. There may be different paths out of a state or activity. Decision Point: May be used to show a possible branch. A diamond shape is used to indicate the decision point. Swimlanes: Notation used to show where the activity takes place. They vertical columns that may show actors, objects, use cases… See page 193.