Domain Modeling Business Concept Modeling Software Architecture Research
Domain Modeling (Business Concept Modeling) Software Architecture Research Group, Department of Computer and Information Science, University of Mississippi 23 -Feb-21
References This section is based on: Doug Rosenberg and Kendall Scott. “Domain Modeling” in Use Case Driven Object Modeling with UML, Chapter 2, Addison. Wesley, 1999
Domain Modeling n Involves building static conceptual model of the system’s problem domain - Problem domain: real world entities and concepts related to problem to be solved n n Discovers “objects” representing those concepts Creates common vocabulary (glossary of terms) for stating requirements 3
Development Workflow Business requirements Requirements Business concept models Use case models Technical constrains Specification Use case models Components Provisioning Assembly Component specs & architectures Applications Tested applications Deployment 4
Sources of Domain Information n n High-level problem statement Lower-level requirements statement Documentation, reports, outputs, user notes, etc. relating to system being replaced Expert knowledge of the problem domain Existing models or descriptions of the domain or similar domains 5
Steps in Domain Modeling n n n Make a quick pass through the problem statement and other relevant documents List key words and phrases to identify objects and their attributes and relationships Refine lists as work progresses 6
Grammatical Analysis n n Nouns and noun phrases become objects and attributes Verbs, transitive verbs and verb phrases become operations and associations Adjectives, possessive phrases indicate that nouns may be attributes rather than objects Intransitive verbs become associations among objects - Attribute refers to the property of an object n Adjectives may be subclasses or attributes For example, - truck - class fire truck - subclass red truck - attribute 7
Discovering Domain Concepts n n Eliminate duplicate terms, make plural terms singular and sort alphabetically Eliminate unnecessary items from list of candidate classes Retrace the problem statement and requirements, read between lines and discover more classes Do not spend more than a few hours 8
Requirements Statement for a Course Registration System This. project is to develop a new class registration system for the University of Mississippi. A student wishing to register for classes must first enter his identifying information. Once given access, the student may select a term and then build a personal class schedule from among the classes offered that term. A student may add and delete classes from the schedule. A student will not be allowed to create an invalid schedule such as scheduling two classes at the same time or scheduling a class that is full. Once the schedule is complete, the student may then submit the schedule for final processing. The system passes the information about the student's schedule to the tuition billing system. The student may print the schedule if he wishes. At any point, the student may cancel his schedule and exit the registration system without completing registration or being charged tuition. A student may also use the system to subsequently add and delete classes from his schedule. The student billing system will generate any needed bill for tuition or fees required by the schedule change. An instructor may use the registration system to print a listing of his or her classes and the students in those classes. The administrator of the registration system may manage the system as needed, carrying out such operations as adding and deleting classes, updating information about classes, and adding and deleting students or instructors 9
Course Registration System First Set of Candidate Classes project, class registration system, University of Mississippi, student, class, identifying information, access, term, personal class schedule, invalid schedule, student’s schedule, same time, tuition billing system, point, registration, tuition, system, bill, fees, schedule change, instructor, listing, administrator, operations, information about classes 10
Course Registration System Elimination Process n n Student, instructor, and administrator are actors – might only be in use case model, unless system holds information about them Project implies whole system to be built – no need to model explicitly University of Mississippi is the single target for system – no need to model explicitly Access implies action – not modeled as entity 11
Course Registration System Elimination Process n n n Tuition billing system is out of scope of system Identifying information, information about classes are attributes of other entities Same time is too vague to be domain entity Tuition, bill, fees are out of scope Registration, operations are operations System itself represents system to be built 12
Course Registration System Refined Set of Candidate Classes n n n Person Student schedule Instructor schedule Term Course Section 13
Build Generalization Relationships Generalization: kind-of relationship, where one class is a kind of another class. Former class is superclass, or parent while latter class is subclass or child 14
Course Registration System Generalization of Person Class Person Administrator Student Instructor 15
Build Associations Between Classes Association: relationship between classes that are independent of time (state) n Associations show dependencies between classes, not actions n Candidates from verbs, verb phrases, domain knowledge, etc. n Refine list by eliminating actions and other details irrelevant for conceptual model n Represent one-to-one, one-to-many, and many-tomany relationships (multiplicities) 16
Aggregation and Composition Aggregation: association in which one class is made up of other classes (part-of relationship) - Serves as a reference to something Composition: strong form of aggregation - “piece” class is “owned by” one larger class Avoid until detailed design 17
Draw Class Diagram Person 1 1 0. . 1 Administrator 1 Student 1 * Student Schedule * 1 Term 1 Instructor 1 * Instructor Schedule 1 1 * * 1 0. . 1 * * Section * 1 Course 18
Top Domain Modeling Errors n n n Assigning multiplicities to associations Spending too much time on noun and verb analysis Assigning operations to classes without exploring and in interactions Optimizing code for reusability before satisfying user’s requirements Wasting time on aggregation vs. composition issue 19
Top Domain Modeling Errors (contd) n n n Presuming specific implementation strategy without modeling problem space Using hard to understand class names Jumping directly to implementation constructs Creating one-for-one mapping between domain classes and relational database tables Performing ‘premature patternization’ (i. e. using patterns without any valid connection to user problems) 20
Acknowledgement Development of the course materials was supported, in part, by a grant titled “The Acxiom Laboratory for Software Architecture and Component Engineering (ALSACE) ” from Acxiom Corporation
Extra Slides
Unified Modeling Approach Dynamic GUI Prototype Sequence Diagram Use Case Model Robustness Diagram Static C O D E Domain Model Class Diagram
Discover Classes Jim Rumbaugh: Class: a description of group of objects with similar properties, common behavior, common relationships, and common semantics n Find classes representing abstractions of problem domain n Builds solid foundation on which to build the system n Excellent prospects for reuse of system
Course Registration System Nouns project, class registration system, University of Mississippi, student, classes, identifying information, access, student, term, personal class schedule, classes, term, student, classes, schedule, student, invalid schedule, classes, same time, class, schedule, student, schedule, final processing, system, information, student’s schedule, tuition billing system, student, schedule, point, student, schedule, registration system, registration, tuition, student, system, classes, schedule, student, billing system, bill, tuition, fees, schedule change, instructor, registration system, listing, classes, students, classes, administrator, registration system, operations, classes, information about classes, students, instructors
Course Registration System Verbs develop, wishing to register, enter, select, build, add and delete, not be allowed, to create, scheduling, submit, passes, print, wishes, cancel, exit, without completing, being charged, use, add and delete, generate, use, print, manage, carrying out, adding and deleting, updating, adding and deleting
- Slides: 26