Presentation is loading. Please wait.

Presentation is loading. Please wait.

Domain Model Classes and Objects Association Structure Requirement Specification Domain Model.

Similar presentations


Presentation on theme: "Domain Model Classes and Objects Association Structure Requirement Specification Domain Model."— Presentation transcript:

1 Domain Model Classes and Objects Association Structure Requirement Specification Domain Model

2 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 ? The building blocks are objects binds requirements, design and program together Result: A model showing the problem-domain – we call it Domain Model ” The most important model in OO analysis” 2

3 Requirement Functional Use case: find customer 1.A sales person wants to find information about customer 2.The sales person types the customers id 3.The system returns information about the customer Non functional The system has to be user friendly Clarify information Customer: id, name, address Objects binds requirements, design and programming together 3 3 Design Design of architecture Design of GUI Design of classes Design database Implementation Writing 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; } ….. Test idnameaddress Customer Domain object of class Customer

4 Domain model A domain model is the visual representation of conceptual classes We illustrate it by drawing a UML class diagram: 1.Domain objects or conceptual classes 2.Associations between the objects 3.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) 4

5 5 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.dkha@eventyr.dk …… Attributes: Name, adress, phone, e-mail Customer Name Adress Phone E-mail Customer

6 Requirement specification. 6 Try to create this one in UMLet

7 "Multiplicity" - Diversity or cardinality 7

8 Association Relation between a number of objects. Association A customer can have more orders at once – an order belongs to one customer only. Drawn as a simple line like this: 8 UML Association with multiplicity UML class

9 Associations names 9

10 Multiple associations 10

11 A pattern in a domain model Called the agreement pattern A customer makes an agreement with regard to some item Car rental Customer, rentcontract, the car Education student, class, subjects Library borrower, loan, book copy 11

12 Relateringsmønstret (relational pattern) En associering har selv nogle egenskaber (data) 12 Den nederste er den vi typisk anvender. Er også bedre at bruge i forbindelse med databaser

13 Aggregation Used when there is a stronger relation between two classes than association can express Here we have the Item-Descriptor pattern 13

14 Generalisation Used when there are some common attributes shared by several classes (it is implemented as inheritance) 14

15 Domain model: Role Pattern I 15 Generalization: A Person is either a Student or a Lecturer

16 Domain model: Role Pattern II 16 Role pattern: A Person can be Student as well as Lecturer at the same time

17 Composite Pattern – the problem A major building market 1.Items has different measurement units -> generalisation 2.An item can be composed of other items i.e. a kitchen -> reflexive aggregation (recursion) 17 How to model the fact that an item can be composed of other items with different measurement units?

18 Composite pattern General implementation and example Problem How to treat composite objects the same way as atomic (simple) objects? Solution Define classes for both composite and atomic (simple) objects so they implement the same interface 18


Download ppt "Domain Model Classes and Objects Association Structure Requirement Specification Domain Model."

Similar presentations


Ads by Google