View
58
Download
0
Category
Preview:
DESCRIPTION
Requirement Specification Domain Model. Domain Model Classes and Objects Association Structure. Information Need in the IT System. Information need are found by analysing the problem-domain for the IT system Ask the question: What information should be registered by the IT system ? - PowerPoint PPT Presentation
Citation preview
Domain ModelClasses and ObjectsAssociation Structure
Requirement SpecificationDomain Model
Information Need in the IT System
Information need are found by analysing the problem-domain for the IT systemAsk the question: What information should be registered by the IT system ?The building blocks are objects
binds requirements, design and program togetherResult: A model showing the problem-domain – we call it Domain Model
” The most important model in OO analysis”
2
RequirementFunctionalUse case: find customer1. A sales person wants to find
information about customer2. The sales person types the
customers id3. The system returns
information about the customer
Non functionalThe system has to be user friendly
Clarify informationCustomer: id, name, address
Objects binds requirements, design and programming together
33
DesignDesign of architectureDesign of GUIDesign of classes
Design database
ImplementationWriting the code
public class Customer{ private int id, private String name; private String address; public Customer(int id) { this.id = id; } public String getName() { return name; }…..
Testid name address
Customer
Domain object of class
Customer
Class, objects, attributes and valuesCustomer is candidate Object of class ”Customer”for a class
A class describes a collection of objects of the same attributes, structure, and behaviour pattern
4
Domain model
A domain model is the visual representation of conceptual classesWe illustrate it by drawing a UML class diagram:1. Domain objects or conceptual classes2. Associations between the objects3. Each objects attributes
A conceptual class is described by:name (symbol)Definition – the purpose in problem domain (intension)Examples given on objects created from class (extension)
5
6
Example of a conceptual class
Class:
Definition: The customer class is used to describe the company's customers.
An example: Hans Andersen, Eventyrvej 2, 5000 Odense, phone 75 45 67 89,
e-mail: ha@eventyr.dk ……
Attributes: Name, adress, phone, e-mail
Customer
Name
Adress
Phone
Customer
A Domain Model
The classes are connected - here by an associationdrawn as the line between the concepts. Nameable of a verb phrase. Start with Capital
Add the multiplicitydefines how many instances(objects) of a class that can be associated with an instance (object) of another classEx: a student can be enrolled in none or 1 team
Result: A UML class diagram
7
Requirement specification
.
8Try to create this one in UMLet
"Multiplicity" - Diversity or cardinality
9
Association
Relation between a number of objects. AssociationA customer can have more orders at once – an order belongs to one customer only.
Drawn as a simple line like this:
10
Customer Order
0..*1 0..*1
+belongs to+has
Class diagram for order management
Lisa:Customer
10342:OrderPeter:Customer
10343:orderJane:Customer
10349:Order
Object diagram
UML Association withmultiplicity
UMLclass
Generalisation
Used when there are some common attributes shared by several classes (it is implemented as inheritance)
11
Aggregation
Used when there is a stronger relation between two classes than association can express
12
Patterns
A pattern is defined as a generic solution to a problem often encountered in the real world
Not a theoretical solutionBased on empirical data and what works
When we construct a domain model then we will often use patternsNext time we will look at several patterns
13
Recommended