Conceptual Model or Domain Models OUTLINES UML overview

  • Slides: 39
Download presentation
Conceptual Model or Domain Models

Conceptual Model or Domain Models

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

OUTLINES • UML overview, where are we now? • Conceptual model: – Concepts – Attributes – Associations

UML Process (OVERVIEW) 1 - Use Cases – Define user interaction with the system.

UML Process (OVERVIEW) 1 - Use Cases – Define user interaction with the system. 2//- Conceptual Model (we are here right now!!!!) n n 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.

2//- System Sequence Diagram (We have done this it can be done before or

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.

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

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

5 - Class Diagram – Add methods and additional attributes which were discovered in

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.

Conceptual model • is also named domain model • is an analysis-level activity -

Conceptual model • is also named domain model • is an analysis-level activity - a model of realworld objects - and not an attempt to design the actual software.

Advantages of noun phrase identification • Narrative language is well understood by everyone on

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.

Disadvantages of noun phrase identification • The imprecision of natural language. – Different noun

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. – Many sentences in a functional specification may be in the wrong form for easy identification of the objects, and classes. For example, ” roll back the transaction” or “the software will compute the average salary”. – In many cases, the nouns, especially subjects to sentences, refer to (1) an entire assembly or a computer software configuration, (2) a subassembly or a software component, (3) an attribute, (4) service.

Recommended Approach • • Noun phrase technique Interview the domain experts Conceptual Class Category

Recommended Approach • • Noun phrase technique Interview the domain experts Conceptual Class Category List Consider whether: – – it is any real-life entity it is important to the requirement discussion – Additional steps: – Use the use cases to generate scenarios – Use the scenarios to find missing categories and interfaces – Record the scenarios.

We are not finished with the attributes yet • We still need to discuss

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.

Case study University Case Study Note: We have only text description no use case

Case study University Case Study Note: We have only text description no use case scenarios

University Case Study: Identifying classes We need write an application supporting us in managing

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 concept

University Case Study : Classes Student Lecturer Course Book shop Competence Evaluation Library Course

University Case Study : Classes Student Lecturer Course Book shop Competence Evaluation Library Course Overlapping University Course Evaluation Do we need a class called University? Competence

Advice when finding attributes • How is the object described in general? • What

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?

University Case Study: Attributes Student pnr: Integer student_name: String address: String nationality: String degree_level:

University Case Study: Attributes Student pnr: Integer student_name: String address: String nationality: String degree_level: String grade: Integer IQ Integer $average_age: Integer Teacher pnr: Integer teacher_name: String role: String ped_competence: String admin_competence: String prof_competence: String percentage_of_full_time: Integer salary: Integer martial_state: String research_engagement: String Course course_number: Integer course_name: String course_description: String no_of_students: Integer teacher_name: String equipment_type: String Book book_number: Integer ISBN_number: String title: String price: Real

University Case Study: Identifying associations Students at SU may take many different courses. The

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 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 Ph. D student. The work he has put into developing and teaching on a course will give him credit point within his Ph. D 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.

Student pnr: Integer student_name: String nationality: String degree_level: String IQ Integer $average_age: Integer University

Student pnr: Integer student_name: String nationality: String degree_level: String IQ Integer $average_age: Integer University Case Study: Teacher Associations pnr: Integer 0. . * teaches 0. . * 15. . * teacher_name: String role: String ped_competence: String admin_competence: String prof_competence: String percentage_of_full_time: Integer salary: Integer martial_state: String research_engagement: String reads 0. . * taught_by 0. . * 0. . 5 Book book_number: Integer ISBN_number: String title: String course_description: String price: Real reads Course 1. . 5 1. . * uses_book 0. . * course_number: Integer course_name: String course_description: String No_of_students: int teacher_name: String

Student pnr: Integer student_name: String nationality: String degree_level: String IQ Integer $average_age: Integer University

Student pnr: Integer student_name: String nationality: String degree_level: String IQ Integer $average_age: Integer University Case Study: Teacher Associations pnr: Integer 0. . * teaches 0. . * 15. . * teacher_name: String role: String ped_competence: String admin_competence: String prof_competence: String percentage_of_full_time: Integer salary: Integer martial_state: String research_engagement: String reads 0. . * taught_by reads 0. . 5 We do not need these any more! Book book_number: Integer ISBN_number: String title: String price: Real 1. . * uses_book Course 1. . 5 1. . * course_number: Integer course_name: String no_of_students: Integer teacher_name: String