2.07k likes | 2.64k Views
Introduction to Domain Analysis. Chapter 12 Domain Analysis. Introduction Overview of Analysis Domain Class Model Domain State Model Domain Interaction Model. Topic Covered. During analysis, we build models and begin to understand the requirements deeply.
E N D
Chapter 12 Domain Analysis
Introduction Overview of Analysis Domain Class Model Domain State Model Domain Interaction Model Topic Covered
During analysis, we build models and begin to understand the requirements deeply. To build a domain model, you must interview business expert, examine requirements statements, and study related requirements. Successful analysis model states what must be done, without restricting how it is done and avoid implementation decisions. Introduction
As fig. shows, analysis begin with problem statement during system conception. Problem statement can be incomplete or informal but analysis makes it more precise and expose ambiguities. You must understand real-world system described by the problem statement, and abstract its essential features into a model. Sequence can be problem statement build model (Domain) build model(application). Overview of Analysis
Analysis model addresses the three aspects of objects. Static structure of objects (Class Model) Interaction among objects ( Interaction Model) Life-cycle histories of objects (State Model) Overview of Analysis
Overview of Analysis • First step in analyzing the requirements is to construct a domain model. • Static structure of the real world system is captured. • The domain model describes real-world classes and their relationships to each other.
Domain Class Model • Information for the domain model comes from the • Problem statement, • Artifacts from related systems, • Expert knowledge of the application domain and • General knowledge of the real world. The steps to be performed to construct a domain class model: • Find Classes. • Prepare a data dictionary.
Domain Class Model • 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 Class Model 1. Finding Classes • First Step, find relevant classes for objects from application domain. • It includes houses, person, machines etc. • Classes often correspond to nouns. • Eg- ” a reservation system sell tickets to performances at various theater”- • Tentative classes would be Reservation, System, Tickets, Performance and Theaters.
Domain Class Model • Idea is to capture concepts. not all nouns are concepts, and concepts are also expressed in other parts of speech. • For the Case study of the ATM: The following are the classes extracted from problem statement nouns.
Domain Class Model • Additional classes that do not appear directly in the statement but can be identified from our knowledge of the problem domain
Domain Class Model 2.Keeping the Right classes • Discard unnecessary and incorrect classes according to the following criteria. • Redundant classes: If two classes express the same concept, you should keep the most descriptive name. • ATM example. Customer and user are redundant; we retain customer because it is more descriptive.
Domain Class Model • Irrelevant classes: If class has little or nothing do with application, eliminate it. • ATM Ex. cost is outside the scope of the ATM software. • Vague classes: class should be specific. • ATM Example, System, Security provision, Banking network etc are not specific thing. • Attributes: Names that primarily describe individual objects should be restated as attributes.
Domain Class Model • ATM Example, Account Data, Cash, Transaction data are purely indicating attributes not a class. • Operations: If a name describes an operation that is applied to objects and not manipulated in its own right, then it is not a class. • Eg-if we are simply building telephones, then call is part of the state model and not a class
Domain Class Model • But Billings system for telephone calls a Call would be important class with attributes date, time, origin and destination. • Roles: The name of a class should reflect its intrinsic nature and not a role that it plays in an association. • Ex.Owner of a car in a car manufacturing database, not correct as a class. It can be a person( owner, driver, lessee)
Domain Class Model • Implementation Constructs: Eliminate constructs from the analysis model that are irrelevant to the real world. • We may need them during design and not now. • Ex. Transaction Log class. • Derived classes: As a general rule, omit classes that can be derived from other classes. • Mark all derived classes with a preceding slash(‘/’)in the class name.
Domain Class Model 3. Preparing a Data Dictionary • Prepare a data dictionary for all modeling elements. • Describe the scope of the class within the current problem, including all assumptions or restrictions on its use. • It also describes associations, attributes, operations and enumeration values.
Domain Class Model Data Dictionary for the ATM classes • Account, • ATM, • Bank, • BankComputer, • CashCard, • Cashier, • CashierStation • CentralComputer, • Consortium, • Customer, • Transaction
Domain Class Model 4. Finding Associations • Find A structural relationship between two or more classes is an association. • A reference from one class to another is an association. • Associations often correspond to verbs or verb phrases. • Ex. Physical Location ( part of, NextTo) • Directed Actions (Drives) • Communication (Talks To)
Domain Class Model • Ownership ( Has, Part of) • Satisfaction of condition ( WorksFor, Manages). • Idea here is to capture relationships
Domain Class Model 5. Keeping the Right Associations Discard unnecessary and incorrect associations, using the following criteria: • Associations between eliminated classes:If you have eliminated one of classes then either you eliminate association or restate it. • Ex. Banking Network includes cashier stations and ATMs. • ATM dispenses cash
Domain Class Model • ATM prints receipts • Bank provide software • Cost apportioned to banks • System provides record keeping and • System provides security. • Irrelevant or implementation associations: Eliminate any association that deals with implementation or outer problem statement. • Ex. System handles concurrent access (Implementation)
Domain Class Model • Actions: An association should describe a structural property of the application domain not a transient event. • Ex. ATM accepts Cash card (Interaction cycle) It is not a permanent relationship between ATM and Cash. • Eliminate ATM interact with user. Central computer clears transactions with bank .
Domain Class Model • Ternary associations: You can decompose most association among three or more classes into binary associations. • Always decomposed without losing information. • Ex. Bank computer processes transaction against account can be convert into Bank computer processes transaction and transaction concern accounts.
Domain Class Model • Derived associations : Omit association and attributes, they may be redundant. • Ex. GrandParentOf can be defined in terms of pair of ParentOf. • Ex. youngerThan expresses condition on the birthdate of two person, not additional information. • Derived association don’t add information, they useful for understanding.
Domain Class Model Semantics of Association • Misnamed Association: Name are important to understanding and should be chosen with care. • Ex. Bank computer maintain accounts. Rephrase as Bank hold account. • Association End name: Add association end name where appropriate. • Ex. Person manages person. It would be appropriate to give end names boss and worker
Domain Class Model • Qualified Associations: Most names are not globally unique. So context combines with the name to uniquely identify the object. • Ex. Company name unique within one state but may be duplicated in other state. • So combining State + Company name will uniquely identify company. • Ex. bankCode differentiate bank in a consortium.
Domain Class Model • Multiplicity: Don’t put much effort as it is often changes during analysis. • Missing Association: Add any missing association that are found during analysis. • Transaction entered on cashier station, Customers have accounts and transaction authorized by cash cards. • To perform above, we need to introduce relationship from Cashier to cashier station. So association Cashier authorized on cashier station needed
Domain Class Model • Aggregation: it is specially for mechanical parts or bills of material. • Don’t spend much time trying to defer between association and aggregation. • Ex. Bank is part of Consortium and indicate the relationship with aggregation. • Now combining all things together, class diagram prepare.
Domain Class Model 6. Finding Attributes: • Attributes are data properties of objects like colour, weight etc. • Attributes usually correspond to nouns followed by possessive phrases, such as “the color of the car” • Attributes are less likely to be fully described in problem statement. • Only consider attributes directly relevant to application. Get important attributes then add details to it.
Domain Class Model • Avoid derived attributes. • EX. Age is derived from birthdate and currentTime • Looks for attributes on associations. • Ex. Workfor association attribute can be salary, title etc.
Domain Class Model 7. Keeping the Right Attributes • Eliminate unnecessary and incorrect attributed with the following criteria: • Objects: if element is important rather than just its value, then it is an object. • Ex. Boss refers to a class and Salary is an attributes. • Name: Name often refer as Qualifier rather than attributes. • Name is an attribute when its use does not depend on context,
Domain Class Model • Ex. Names of person are not unique therefore its attributes. • Identifiers: it mean referencing objects used for some work. • Ex. ATM transaction always generate Transaction ID for each operation. So you can count Transaction ID as attributes. • Attributes on Association: • If value require the presence of link then attributes of the association should derived.
Domain Class Model • Ex. Workfor association attribute can be salary, title etc • Internal Values: if an attributes describes internal state of an object then eliminate it. • Fine Detail: Omit minor attributes that are unlikely to affect most operation. • Discordant attributes :- an attribute that seems completely different from and unrelated to all other attributes then remove it.
Domain Class Model • Boolean Attributes: Convert Boolean attributes into enumeration.
Domain Class Model 8. Refining with Inheritance • Next step, to share common structure. • Apply in two directions: • Bottom Up • By Generalizing common aspects of existing classes into a superclass. • Top Down • By Specializing existing classes into multiple classes
Domain Class Model • Bottom Up Generalization: • Searching for classes(from bottom up) with similar attributes, associations and operation. • For each generalization, define a superclass to share common features. • May have to slightly redefine some attributes or classes to fit in. But don’t push too hard it create wrong generalization. • Ex. RemoteTransactiona and CashierTransaction are similar and can be generalized by Transaction.
Domain Class Model • Top-Down Specialization: • It main derived from application domain itself. • Look for noun phrases composed of adjectives: • Fixed menu, sliding menu and text menu. • Avoid excessive refinement.
Domain Class Model • Generalization Vs. enumeration :- • Generalization is all about common structure • Enumeration is all about list of values. • Ex. CurrentAccount and SavingAccount share common structure but it does not affect behavior within the ATM application. So Type can introduces as attributes of account and enumerate it. • Multiple Inheritance: if require then apply because it increasing both conceptual and implementation complexity
Domain Class Model • Similar association: • when the same association name appears more than once with the same meaning, try to generalize the associated class. • Ex. EntryStation generalizes CashierStation and ATM. • Adjusting inheritance Level • Assign attributes and association to specific classes in the class hierarchy. • You may need some adjustment to get everything right.
Domain Class Model 9.Testing Access Paths • Verify that access paths exist for likely queries. • Trace access paths through the class model to see if they yield sensible results. • Make sure you have not overlooked any associations.