650 likes | 819 Views
Chapter 12 Analysis Modeling. Analysis Modeling: Where to Begin?. Use the statement of scope and other SRS documents already created to guide you to building an analysis model. The analysis model will include acquired from: the working document A set of use-cases Other items
E N D
Analysis Modeling:Where to Begin? • Use the statement of scope and other SRS documents already created to guide you to building an analysis model. • The analysis model will include acquired from: • the working document • A set of use-cases • Other items • the statement of scope must be “parsed” to extract data, function and behavioral domain information
Statement of Scope • a relatively brief description of the system to be built • indicates data that are input and output and basic functionality • indicates conditional processing (at a high level) • implies certain constraints and limitations
Identifying Object and Operations Noun/Verb Approach • define “objects” by underlining all nouns in the written statement of scope • producers/consumers of data • places where data are stored • “composite” data items • define “operations” by double underlining all active verbs • processes relevant to the application • data transformations • consider other “services” that will be required by the objects
Identifying Object and Operations Discovery Approach • define all “potential objects” by thinking about the system. Consider everything. • Add attributes identifying those potential objects which are duplicates, attributes themselves, operations, services. • Add operations again identifying those potential objects which are duplicates, attributes, operations, and services.
Identifying Object and Operations Data Approach • define all data entities and consider them as the potential objects of the system. • Add attributes identifying those potential objects which are duplicates, attributes themselves, operations, services and adding any new objects needed to support attributes. • Add operations again identifying those potential objects which are duplicates, attributes, operations, and services and adding any new objects needed to support operations.
Video Rental Example • A video store offers rental of videos to members. To become a member you have to have a drivers license and a credit card. You may rent up to 3 videos. Corporate keeps up with trends and orders the tapes for rental. • Members check out and return videos due in one day. Overdue fees of 1 dollar a day is charged for late videos. • Upon rental a rental slip is made for customers which contains name, addr, city, and iterations of movies with tape id, movie id, title, length, etc.
Video Rental System • Use the noun approach - Grady Booch • Use discovery approach – Linda Northrup • Use the data approach – Steven Mellor, Sally Schaler • Use the responsibility driven design approach – Rebecca Wirth Brock • Use one of above and Analysis Patterns Approach – Joe Yoeder
Video Rental System Remember these techniques identify the domain (conceptual) classes, not design classes, not programming classes, and not implementation classes.
Video Rental System noun/verb • A video store offers rental of videos to members. To become a member you have to have a drivers license and a credit card. You may rent up to 3 videos. Corporate keeps up with trends and orders the tapes for rental. • Members check out and return videos due in one day. Overdue fees of 1 dollar a day is charged for late videos. • Upon rental a rental slip is made for customers which contains name, addr, city, and iterations of movies with tape id, movie id, title, length, etc.
Video Rental System noun/verb • A video store offers rental of videos to members. To become a member you have to have a drivers license and a credit card. You may rent up to 3 videos. Corporate keeps up with trends and orders the tapes for rental. • Members check out and return videos due in one day. Overdue fees of 1 dollar a day is charged for late videos. • Upon rental a rental slip is made for customers which contains name, addr, city, and iterations of movies with tape id, movie id, title, length, etc.
Video Rental System noun/verb NOUNS Store Video Member License Card Corporate Trends Tapes Slip Customers Name Addr City Iterations Tape Movie id Title length VERBS Offers Becomes Rents Orders Checkout Return Charged Made contains
Video Rental System noun/verb Lay the nouns out on a table, 3X5 cards, chalk board, ppt file NOUNS Store Video Member License Card Corporate Trends Tapes Slip Name Customers Addr Iterations Movie id Tape Title length
Video Rental System noun/verb Begin adding attributes NOUNS Store Video Member License Card name, addr.. name,length name, addr num, name num,name, Corporate Trends Tapes Slip Name Customers Addr Iterations Movie id Tape name, addr.. Id num\ Title length
Video Rental System noun/verb Begin clustering the potential objects - Singletons NOUNS Store Video Member License Card name, addr.. name,length name, addr num, name num,name, Corporate Trends Tapes Slip Name Customers Addr Iterations Movie id Tape name, addr.. Id num\ Title length Same as store only one instance
Video Rental System noun/verb Begin clustering the potential objects - attributes NOUNS Store Video Member License Card name, addr.. name,length name, addr num, name num,name, Corporate Trends Tapes Slip Name Customers Addr Iterations Movie id Tape name, addr.. Id num\ Title length attribute Same as store only one instance attribute attribute
Video Rental System noun/verb Begin clustering the potential objects – more attributes NOUNS Store Video Member License Card name, addr.. name,length name, addr lic num, card num Trends Tapes Slip Customers Addr name, addr.. Iterations Movie id Tape ID Id num\ attribute attribute attribute attribute attribute
Video Rental System noun/verb Begin clustering the potential objects - duplicates / descriptors NOUNS Store Video Member name, addr.. name,length name, addr lic num, card num Trends Tapes Slip Customers name, addr.. Iterations` = to member descriptor
Video Rental System noun/verb Begin clustering the potential objects - I/O NOUNS Store Video Member name, addr.. name,length name, addr lic num, card num Trends Tapes Slip tape id, name, addr.. I/O
Video Rental System noun/verb So how did we do this clustering • Identified all potential domain (conceptual classes) using the noun approach --discovery, data methods, or responsibility driven also work. • Identified potential attributes and perhaps operations of the potential classes.
Video Rental System noun/verb • 4. Eliminated some potential classes by clustering • Input/Outputs (never domain classes) • Singletons (rarely classes) • Potential objects that turned out to be attributes • Potential objects that turned out to be behaviors • Duplicates • Items that only described other things ( no attributes or methods) • Constructed the Class Diagram and the network helped to cluster even more. • Identify M:M and resolved
Video Rental System noun/verb Begin clustering the potential objects by their attributes and methods Store Video Trends VERBS Offers Becomes Rents Orders Checkout Return Charged Made contains Tape Member Now lets see if we can model this……. Now add cardinality, names of relationships…resolve M:M… then add attributes and methods
Why Data Modeling? • examines data objects independently of processing • focuses attention on the data domain • creates a model at the customer’s level of abstraction • indicates how data objects relate to one another
What is a Data Object? Object —something that is described by a set of attributes (data items) and that will be manipulated within the software (system) instance each of an object (e.g., a book) can be identified uniquely (e.g., ISBN #) each plays a necessary role in the system i.e., the system could not function without access to instances of the object each is described by attributes that are themselves data items
Typical Objects external entities (printer, user, sensor) things (e.g, reports, displays, signals) occurrences or events (e.g., interrupt, alarm) roles (e.g., manager, engineer, salesperson) (e.g., division, team) organizational units places (e.g., manufacturing floor) structures (e.g., employee record)
Data Objects and Attributes A data object contains a set of attributes that act as an aspect, quality, character-istic, or descriptor of the object object: automobile attributes: make model body type price options code
What is a Relationship? • several instances of a relationship can exist • objects can be related in many different ways relationship —indicates “connectedness”; a "fact" that must be "remembered" by the system and cannot or is not computed or derived mechanically
ERD Notation One common form: (0, m) object object relationship 1 2 (1, 1) attribute Another common form: relationship object object 1 2 (1, 1) (0, m)
Building an ERD • Level 1—model all data objects (entities) and their “connections” to one another • Level 2—model all entities and relationships • Level 3—model all entities, relationships, and the attributes that provide further depth
The ERD: An Example request for service Customer places (1,1) (1,m) (1,1) standard task table (1,n) work order generates (1,1) (1,1) (1,1) (1,w) work tasks selected from consists of (1,w) (1,i) materials lists
The Flow Model Every computer-based system is an information transform .... computer based system input output
The Flow Model Every computer-based system is an information transform .... computer based system input output
Flow Modeling Notation external entity process data flow data store
External Entity A producer or consumer of data Examples: a person, a device, a sensor Another example: computer-based system Data must always originate somewhere and must always be sent to something
Process b A data transformer (changes input to output) Examples: compute taxes, determine area, format report, display graph Data must always be processed in some way to achieve system function
Data Flow Data flows through a system, beginning as input and be transformed into output. base compute triangle area area height
Data Stores Data is often stored for later use. sensor # sensor #, type, location, age look-up sensor data report required type, location, age sensor number sensor data
Data Flow Diagramming:Guidelines • icons must be labeled with meaningful names • DFD evolves through a number of levels of detail • always begin with a context level diagram (also called level 0) • always show external entities at level 0 • always label data flow arrows • do not represent procedural logic
Constructing a DFD—I • review ERD to isolate data objects and grammatical parse to determine “operations) • determine external entities (producers and consumers of data • create a level 0 DFD
Level 0 DFD Example processing request user requested video signal digital video processor monitor video source NTSC video signal
Constructing a DFD—II • write a narrative describing the transform • parse to determine next level transforms • “balance” to maintain data flow continuity • develop a level 1 DFD • use a 1:5 (approx.) expansion ratio
The Data Flow Hierarchy a b P x y level 0 c p2 a f p1 b p4 d 5 g p3 e level 1
Flow Modeling Notes • each bubble is refined until it does just one thing • the expansion ratio decreases as the number of levels increase • most systems require between 3 and 7 levels for an adequate flow model • a single data flow item (arrow) may be expanded as levels increase (data dictionary provides information)
DFDs: A Look Ahead analysis model Maps into design model
The Use Case Model Every computer-based system is a series of actions, subsystems that interact with outside actors (external entities). use case
Use Case Notation actor relationship (usually trigger) use case
Actor A Examples: a person, a device, a sensor Another example: computer-based system Something must trigger the action in the use case.