conceptual model or domain models chapter10 applying uml and pattern

40
Conceptual Model or Domain Models Chapter10 Applying UML and pattern

Upload: walter-stafford

Post on 04-Jan-2016

226 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Conceptual Model or Domain Models Chapter10 Applying UML and pattern

Conceptual Model or Domain Models

Chapter10 Applying UML and pattern

Page 2: Conceptual Model or Domain Models Chapter10 Applying UML and pattern

OUTLINES

• UML overview, where are we now?• Conceptual model:

– Concepts– Attributes– Associations

Page 3: Conceptual Model or Domain Models Chapter10 Applying UML and pattern

UML Process (OVERVIEW)1- Use Cases

– Define user interaction with the system. 2//- Conceptual Model (we are here right

now!!!!) Underline nouns to identify concepts in the problem

domain. Use the underlined nouns from the use cases to create the

concepts in the conceptual model. Some of the nouns, if they identify simple data types, are

used to create attributes of these concepts. Create associations between the concepts.

Page 4: Conceptual Model or Domain Models Chapter10 Applying UML and pattern

2//- System Sequence Diagram (We have done this it can be done before or after conceptual model or in parallel with it)– Create system sequence diagrams for each use

case scenario. – Each sequence event in the diagram corresponds

to a user interaction with the system specified by the expanded use case.

Page 5: Conceptual Model or Domain Models Chapter10 Applying UML and pattern

3- System Contracts– Specify post-conditions for each system event in

the system sequence diagrams. – Use the conceptual model to identify objects

created, associations formed, and attributes modified.

4- Collaboration Diagram– Create a collaboration diagram for each system

event. – Apply patterns

Page 6: Conceptual Model or Domain Models Chapter10 Applying UML and pattern

5- Class Diagram– Add methods and additional attributes which

were discovered in the collaboration diagrams to the classes in the conceptual model.

6- Code– Create classes with their names, attributes and

method signatures taken from the class diagram. – For each method on a class, use the collaboration

diagrams to find the sequence of messages generated when the method is called and create at least one line of code for each message.

Page 7: Conceptual Model or Domain Models Chapter10 Applying UML and pattern

Conceptual model

• is also named domain model• is an analysis-level activity - a model of real-

world objects - and not an attempt to design the actual software.

Page 8: Conceptual Model or Domain Models Chapter10 Applying UML and pattern
Page 9: Conceptual Model or Domain Models Chapter10 Applying UML and pattern
Page 10: Conceptual Model or Domain Models Chapter10 Applying UML and pattern
Page 11: Conceptual Model or Domain Models Chapter10 Applying UML and pattern
Page 12: Conceptual Model or Domain Models Chapter10 Applying UML and pattern
Page 13: Conceptual Model or Domain Models Chapter10 Applying UML and pattern
Page 14: Conceptual Model or Domain Models Chapter10 Applying UML and pattern

Advantages of noun phrase identification

• Narrative language is well understood by everyone on a project

• An effective communication medium for both technical and non-technical project staff.

• Usually, one-to-one mapping from nouns to objects or classes or interfaces.

• No learning curve.

Page 15: Conceptual Model or Domain Models Chapter10 Applying UML and pattern

Disadvantages of noun phrase identification

• The imprecision of natural language. – Different noun phrases may represent the same conceptual class

or attribute, among other ambiguities.

• Nouns do not always result in classes, or objects in the problem domain.

Page 16: Conceptual Model or Domain Models Chapter10 Applying UML and pattern

Recommended Approach

• Noun phrase technique• Interview the domain experts• Conceptual Class Category List

Page 17: Conceptual Model or Domain Models Chapter10 Applying UML and pattern
Page 18: Conceptual Model or Domain Models Chapter10 Applying UML and pattern
Page 19: Conceptual Model or Domain Models Chapter10 Applying UML and pattern

The Need for Specification or Description Conceptual Classes

Add a specification or description conceptual class (for example, ProductSpecification)when:1.There needs to be a description about an item or service, independent of the current existence of any examples of those items or services.

Page 20: Conceptual Model or Domain Models Chapter10 Applying UML and pattern

The Need for Specification or Description Conceptual Classes

2. Deleting instances of things they describe (for example, Item) results in a loss of information that needs to be maintained, due to the incorrect association of information with the deleted thing.

3. It reduces redundant or duplicated information.

Page 21: Conceptual Model or Domain Models Chapter10 Applying UML and pattern

Domain Modeling GuidelinesHow to Make a Domain Model

Apply the following steps to create a domain model:1. List the candidate conceptual classes using the Conceptual Class Category List and noun phrase identification techniques related to the currentrequirements under consideration.2. Draw them in a domain model.3. Add the associations necessary to record relationships for which there is a need to preserve some memory 4. Add the attributes necessary to fulfill the information requirements

Page 22: Conceptual Model or Domain Models Chapter10 Applying UML and pattern
Page 23: Conceptual Model or Domain Models Chapter10 Applying UML and pattern
Page 24: Conceptual Model or Domain Models Chapter10 Applying UML and pattern
Page 25: Conceptual Model or Domain Models Chapter10 Applying UML and pattern
Page 26: Conceptual Model or Domain Models Chapter10 Applying UML and pattern
Page 27: Conceptual Model or Domain Models Chapter10 Applying UML and pattern
Page 28: Conceptual Model or Domain Models Chapter10 Applying UML and pattern
Page 29: Conceptual Model or Domain Models Chapter10 Applying UML and pattern
Page 30: Conceptual Model or Domain Models Chapter10 Applying UML and pattern

We are not finished with the attributes yet

• We still need to discuss – class-based types– attribute visibility

• These issues require deeper knowledge of modelling. Hence, they will be discussed later on as the course progresses.

Page 31: Conceptual Model or Domain Models Chapter10 Applying UML and pattern
Page 32: Conceptual Model or Domain Models Chapter10 Applying UML and pattern

Case study

University Case StudyNote: We have only text description no use case

scenarios

Page 33: Conceptual Model or Domain Models Chapter10 Applying UML and pattern

University Case Study: Identifying classes

We need write an application supporting us in managing the information about university operation. Right now, at Stockholm University we have a substantial amount of students - 35 000 students. To manually manage all information about students is simply impossible. Hence, SU needs some automated support. In addition to this, we need handle information on courses and lecturers giving these courses. Recently, SU has taken over the library and book shops. They want to provide better service to their students, and they want to better integrate the management of course literature with all other courses given at SU. Hence, they wish to automate the book management as well.

This gives them better insight into the education on the course level, and provides a solid basis for evaluating the courses and a basis for establishing the incremental educational programme. The knowledge of which books are utilised on which course helps them identify the overlapping in the educational material.

To be able to provide high quality education, SU must have highly competent lecturers. SU wishes to store information about their lecturers and their state of competence and its development. By competence, SU means professional, pedagogical and administrative competence.

Underline concepts (or maybe attributes) , red means association or transaction category conceptUnderline concepts (or maybe attributes) , red means association or transaction category concept

Page 34: Conceptual Model or Domain Models Chapter10 Applying UML and pattern

University Case Study : Classes

Student

Book

Lecturer

Course

Book shop

Library

University Do we need a class called University?

CourseEvaluation

CourseOverlapping

Competence

CompetenceEvaluation

Page 35: Conceptual Model or Domain Models Chapter10 Applying UML and pattern

Advice when finding attributes

• How is the object described in general?• What parts of the general description are

applicable to this problem domain?• What is the minimal description needed for

this application?

Page 36: Conceptual Model or Domain Models Chapter10 Applying UML and pattern

University Case Study: Attributes

Student

pnr: Integerstudent_name: Stringaddress: Stringnationality: Stringdegree_level: Stringgrade: IntegerIQ Integer$average_age: Integer

Teacher

pnr: Integerteacher_name: Stringrole: Stringped_competence: Stringadmin_competence: Stringprof_competence: Stringpercentage_of_full_time: Integersalary: Integermartial_state: Stringresearch_engagement: String

Course

course_number: Integercourse_name: Stringcourse_description: Stringno_of_students: Integerteacher_name: Stringequipment_type: String

Book

book_number: IntegerISBN_number: Stringtitle: Stringprice: Real

Page 37: Conceptual Model or Domain Models Chapter10 Applying UML and pattern

University Case Study: Identifying associations

Students at SU may take many different courses. The students however, should not take more than five courses during one semester. A course may only start if there are at least 15 students registered. Otherwise, the course has to be cancelled. Teaching for less than 15 students would be too expensive. The courses are taught by lecturers. The fact that you are a lecturer does not hinder you from taking courses at university. There may be cases that a lecturer takes and teaches on one and the same course simultaneously. This is in cases when the lecturer is a PhD student. The work he has put into developing and teaching on a course will give him credit point within his PhD studies. So lecturers may take courses as well. Each university course is based on some book. One course may be based on at least one book. However, many books may be read on one and the same course.

Blue means constraint, many to many will be implemented by adding a transaction class. Blue means constraint, many to many will be implemented by adding a transaction class.

Page 38: Conceptual Model or Domain Models Chapter10 Applying UML and pattern

University Case Study: Associations

Student

pnr: Integerstudent_name: Stringnationality: Stringdegree_level: StringIQ Integer$average_age: Integer

Teacher

pnr: Integerteacher_name: Stringrole: Stringped_competence: Stringadmin_competence: Stringprof_competence: Stringpercentage_of_full_time: Integersalary: Integermartial_state: Stringresearch_engagement: String

Course

course_number: Integercourse_name: Stringcourse_description: StringNo_of_students: intteacher_name: String

Book

book_number: IntegerISBN_number: Stringtitle: Stringcourse_description: Stringprice: Real

1..5

15..*

reads

taught_by reads

0..*

0..*

1..* 0..*uses_book

0..* 0..*teaches

0..*

0..5

Page 39: Conceptual Model or Domain Models Chapter10 Applying UML and pattern

University Case Study: Associations

Student

pnr: Integerstudent_name: Stringnationality: Stringdegree_level: StringIQ Integer$average_age: Integer

Teacher

pnr: Integerteacher_name: Stringrole: Stringped_competence: Stringadmin_competence: Stringprof_competence: Stringpercentage_of_full_time: Integersalary: Integermartial_state: Stringresearch_engagement: String

Course

course_number: Integercourse_name: Stringno_of_students: Integerteacher_name: String

Book

book_number: IntegerISBN_number: Stringtitle: Stringprice: Real

0..* 0..*teaches

1..5

15..*

reads

taught_by reads

0..5

0..*

1..* 1..*uses_book

We do not need these any more!

Page 40: Conceptual Model or Domain Models Chapter10 Applying UML and pattern