Subsections
First guess at domain objects.
- A class is a template for creating objects.
- A class defines the attributes and behaviors an object will have.
- An object is a specific instance of a class.
- If an object has no attributes, is it really a valid object?
- A data variable with object scope.
- Examples: book attributes: title, author, publisher, ISBN
- The value of an object's attributes define its state.
- Attributes should not be accessible to entities outside the object.
- If an object has no attributes, is it really a valid object?
- Method: a function with object scope.
- Methods can operate on that object's attributes.
- Defines the objects behaviors - how it does what it does.
- Methods define the objects responsibilities.
- If an object has no methods, is it really a valid object?
- Work outward from data requirements to build a static model.
- Jump start with grammatical inspection: Make a quick pass through the available material, making lists of the nouns, verbs, and possessive phrases.
- Nouns become classes.
- Noun phrases becomes class attributes.
- Verbs become operations (behaviors) and associations.
- Possessive phrases may indicate that nouns should be attributes rather than objects.
- Create this list of "class candidates".
- Best sources of classes: high-level problem statement, lower-level requirements, expert knowledge of the problem space.
- Go through the candidate classes and eliminate the items that are unnecessary (redundant or irrelevant) or incorrect (too vague, represent concepts outside the model).
- Tangible things - cars, telemetry data, pressure sensors
- Roles - mother, teacher, politician, manager
- Events - interrupt, request
- Interactions - loan, meeting, intersection
- People - humans who carry out some function
- Places - areas set aside for people or things
- Things - physical objects, devices
- Organizations - formally organized collections of people
- Concepts - principles or ideas that are not tangible
- Generalization - one class is a refinement of another class.
- Define Is-a relationships.
- Break into (1) superclass/parent, and (2) subclass/child.
- Child inherits attributes and behaviors of the parent.
- Sometimes discover classes "ahead of schedule".
- Association: A static relationship between two classes.
- Show dependencies between classes but not between actions.
- Should be a true statement about the problem space, independent of time (i.e., static).
- Build the list of candidate associations from the list of verbs and verb phrases and knowledge of the problem domain.
Examples:
- Order generates Trade.
- Portfolio places Orders.
- Posting involves GLAccount.
- Trade generates TradeLot.
- Some associations are one-to-one, some are one-to-many. These are referred to as multiplicities.
- Don't worry about being more specific about numbers of one-to-many associations at this time.
- Aggregation: an association in which one class is made up of other classes. "Has-a" or "part-of" relationships.
- Relational database tables are an excellent source of domain classes.
- Helper classes: contain attributes and operations that are relevant to more significant classes.
- Draw an analysis-level class diagram
- The user's wants and needs are the reason your project team exists.
- Establish a time budget for building your initial domain model.
- The diagram you draw during domain modeling is just a skeleton of your object model.
- Work inward from user requirements.
- Work outward from data requirements.
- Drill down from high-level models to detailed design.
Next: Use case modeling
Up: A sample process
Previous: A sample process
  Contents
|