MCS 270 Spring 2014 Object-Oriented Software Development
GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Today’s schedule Chapters 12-13: (Part I) Domain Analysis Application Analysis MCS 270 Object-Oriented Software Development
GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Domain Analysis (Chap 12) MCS 270 Object-Oriented Software Development Domain Analysis: devising a precise, concise, understandable and correct model of the domain of the application. Flows from requirements statement Entails identification of classes, associations between classes, and attributes of classes Create model of (mostly) static components Intrinsic Analysis
GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Application Analysis (Chap 13) MCS 270 Object-Oriented Software Development Application Analysis: devising a precise, concise, understandable and correct model of the interactions of the application. Flows from Use Case analysis Entails identification of actors, use cases, external events, flow – Activity Diagrams Create model of (mostly) interactive components Extrinsic Analysis Note: We have done some of this work already for GusList
GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Domain Class Analysis Find classes Prepare a data dictionary 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. MCS 270 Object-Oriented Software Development
GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Finding Classes Classes arise from the problem domain Some may be concrete Others may be abstract Some may be stated explicitly Others may be implicit General rule: look for nouns MCS 270 Object-Oriented Software Development
GUSTAVUS ADOLPHUS COLLEGEgustavus.edu MCS 270 Object-Oriented Software Development
GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Don’t worry about superclass-subclass relationships at first Just try to identify base classes that may be in horizontal relationships with each other The book uses a banking example based on ATM transactions MCS 270 Object-Oriented Software Development Finding Classes
GUSTAVUS ADOLPHUS COLLEGEgustavus.edu MCS 270 Object-Oriented Software Development
GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Eliminating/Reducing Classes Redundant classes: Customer and User are redundant Customer is kept because it’s more descriptive Irrelevant classes: Cost is outside scope of app Vague classes: RecordKeepingProvision, System, Banking Network, Security Provision Attributes: AccountData is attribute of Account, Receipt, Cash are attributes of Transaction MCS 270 Object-Oriented Software Development
GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Eliminating/Reducing Classes Operations: things that you identify as nouns, but which are really methods within classes. E.g. LogOn Roles: User is really a role, Customer is better choice Implementation: TransactionLog is a record of transactions – will be implemented as some ADT, but depends on prog. language (List, Array, etc) Derived Classes: E.g. Buyer, Seller are sub-classes of Customer MCS 270 Object-Oriented Software Development
GUSTAVUS ADOLPHUS COLLEGEgustavus.edu MCS 270 Object-Oriented Software Development
GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Domain Class Analysis Find classes Prepare a data dictionary 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. MCS 270 Object-Oriented Software Development
GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Data Dictionary Precise (paragraph) description of each class. Scope of current problem. Associations, Attributes, Operations, enumeration values, assumptions and restrictions. Example: Account: A single account at a bank against which transactions can be applied. Accounts can be of various types, including checking and saving. A customer can hold more than one account. MCS 270 Object-Oriented Software Development
GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Domain Class Analysis Find classes Prepare a data dictionary 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. MCS 270 Object-Oriented Software Development
GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Domain Class Analysis Association: structural relationship between two or more classes. Eg. Relate PERSON and COMPANY with the association ‘WORKFOR’ Keeping the right Association Discard unnecessary and incorrect associations: Association between eliminated classes, Irrelevant or implementation associations (Creating a List), Actions, Derived association (subclass). -- More detail can be found in textbook. MCS 270 Object-Oriented Software Development
GUSTAVUS ADOLPHUS COLLEGEgustavus.edu MCS 270 Object-Oriented Software Development
GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Domain Class Analysis Find classes Prepare a data dictionary 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. MCS 270 Object-Oriented Software Development
GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Domain Class Analysis Attributes: Data properties of individual objects. Keeping the Right Attribute Only consider attributes directly relevant to the application. MCS 270 Object-Oriented Software Development
GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Domain Class Analysis Incorrect Attributes: Object: Should be represented as association Qualifier: Person has employyeNumber attribute. Should be new class called Employee Unique Name or Identifier: Not part of design Internal values: Not visible/useful outside class Fine detail: int used in loop, etc. Note: These are most important cases -- book has others that are somewhat esoteric MCS 270 Object-Oriented Software Development
GUSTAVUS ADOLPHUS COLLEGEgustavus.edu MCS 270 Object-Oriented Software Development
GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Architectural design Architecture is a high-level representation of S/W Architectural styles are templates, e.g., Data-centered Data-flow Call and return Object-oriented Layered Note: Choice of architecture has implications for domain class model MCS 270 Object-Oriented Software Development
GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Architectural Styles Data-centered – subsystems interact through single repository Model / View / Controller Call and return (Client / Server) Layered (three-tier, four-tier) Data-flow (pipe and filter) MCS 270 Object-Oriented Software Development
GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Model / View / Controller (MVC) MVC: Model maintains domain knowledge (data) View subsystems display it to the user Controller subsystems manage sequence of interactions with user Note: M doesn’t depend upon V or C Well-suited for interactive systems MCS 270 Object-Oriented Software Development
GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Domain Model Exercise Groups of 3-4: Create a Domain Model analysis of “GusList” – an on-line classified ad service for the Gustavus community. Task: Identify Classes Associations Attributes Assumptions: We will use the MVC architecture Assignment: By next Thursday (March 6), prepare (group) a Domain Model Class Diagram with all associations and attributes, plus a Data Dictionary. MCS 270 Object-Oriented Software Development
GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Assignments Tuesday – In Lab for Project: Homework: GusList Use Case Report Due: Tuesday, Feb. 25 GusList Domain Class Model Due: Thursday, March 6 MCS 270 Object-Oriented Software Development