Presentation is loading. Please wait.

Presentation is loading. Please wait.

ADMS-BIS Bouwkundige Informatiesystemen ADMS 2006 UML part 2 Jan Dijkstra - 30 oktober 2006.

Similar presentations


Presentation on theme: "ADMS-BIS Bouwkundige Informatiesystemen ADMS 2006 UML part 2 Jan Dijkstra - 30 oktober 2006."— Presentation transcript:

1 ADMS-BIS Bouwkundige Informatiesystemen ADMS 2006 UML part 2 Jan Dijkstra - 30 oktober 2006

2 ADMS-BIS Subjects

3 ADMS-BIS Exercise 30 October Ga uit van de MKW beschrijving van oefening van UML1 Identificeer enkele klassen Geef zo mogelijk relaties tussen klassen aan

4 ADMS-BIS An object is a thing that can be tangible or intangible. Examples tangible : bike, car, house intangible : order, account Objects An object has properties. Example a Customer has a name and address Customer Name Address

5 ADMS-BIS Property of object = attribute + value (Multiple) Objects Adacs: Customer Name = Adacs Address = Enschede Primo: Customer Name = Primo Address = Grave Multiple objects  unique identity 1247: Customer Custno = 1247 Name = Adacs Address = Enschede 9378: Customer Custno = 9378 Name = Primo Address = Grave

6 ADMS-BIS Link = connection between objects Connection between Objects 1247: Customer Custno = 1247 Name = Adacs Address = Enschede 345T7: Order Orderno = 345T7 dateReceived = 10/10/05 Price = 1987 902U2: Order Orderno = 902U2 dateReceived = 07/04/05 Price = 3789

7 ADMS-BIS Class class is abstract concept each object is instance of a class classes classify objects attribute has no values Class Customer Custno Name Address Order Orderno dateReceived Price Object analysis  than values to attributes

8 ADMS-BIS Attribute has no values Association is relation between classes Class Diagram Customer Custno Name Address Order Orderno dateReceived Price Link is instance of association 1 *

9 ADMS-BIS Advanced Class Features

10 ADMS-BIS Advanced Class Concepts : Visibility Visibility – class members (attributes, operations) may be specified as: {we have feature f, an attribute or operation that is defined on an object O of class C } –+: public {f is public  f is visible to any object and f is inherited by the subclasses of C.} –# : protected {f is protected  f is visible only to objects of class C and to objects of C’s subclasses and f is inherited by the subclasses of C.} - : private {f is private  f is visible only to O and f is not inherited by the subclasses of C.} Restricting visibility is the same as restricting accessibility.

11 ADMS-BIS Advanced Class Concepts : Scope Individual member data (= attributes) may have: –Class scope : a single copy of an attribute is shared by all instances of a class. –Instance scope : each instance of a class would have its own copy of the attribute.

12 ADMS-BIS Advanced Class Concepts : Abstract An operation is abstract if it has no implementation. A abstract class cannot have any direct instances. Abstract classes only occur in the context of an inheritance hierarchy. Abstract operations and classes are specified by writing its name in italics.

13 ADMS-BIS Advanced Class Concepts : Abstract

14 ADMS-BIS Window as Abstract Class

15 ADMS-BIS Characteristics of Object Oriented Design (OOD) objectData and operations (functions) are combined  object Objects arte abstractions of real-world or system entities and manage themselves. Objects are independent and encapsulate state and represent information. System functionality is expressed in terms of object services. Objects communicate by message passing.

16 ADMS-BIS Objects are abstractions of real-world entities. Objects encapsulate state and represent information. Object’s state is protected. Objects have responsibility. Objects interact by interfaces.

17 ADMS-BIS Conceptions Encapsulation Information hiding Responsibility

18 ADMS-BIS Encapsulation Encapsulation is the grouping of related ideas into one unit, which can thereafter be referred to by a single name. –Object-oriented encapsulation is the packaging of operations and attributes representing state into an object type so that state is accessible or modifiable via the interface provided by the encapsulation.

19 ADMS-BIS Information hiding Information hiding is the use of an encapsulation to restrict from external visibility certain information decisions that are internal to the encapsulation structure.

20 ADMS-BIS Responsibility Object oriented design is a responsibility driven design approach. –Objects have responsibilities that they prove oneself. –Therefore, collaboration with other objects is needed.

21 ADMS-BIS Classes and Objects Objects looks like modules in some ways Object = Identity + State + Behaviour Objects provide encapsulation of data object is described by a classAn object is described by a class. A class may define a number of objects with identical properties

22 ADMS-BIS About an Object operationsAn object has a public interface defining the operations (methods) it will support attributesAn object has private data called attributes, which only its own operations can access An object can have private operations for its own use linksAn object may know about other objects by means of links

23 ADMS-BIS Structural modeling essentials

24 ADMS-BIS Look back: Class - operations An operation is the implementation of a service that can be requested from any object of the class in order to affect behaviour. Operations are used to manipulate the attributes or to perform other actions. Operations are normally called functions, but they are inside a class and can be applied only to objects of that class. An operation is described with a return-type, a name and zero or more parameters. Together, the return-type, name, and parameters are called the signature of the operation. The signature describes everything needed to use the operation.

25 ADMS-BIS

26 Aggregation and Composition Aggregation is a special form of association that specifies a whole-part relationship between the aggregate (the whole) and a component (the part); aggregation is the part-of relationship. { it is a special form of association in which a collection of objects, each having an independent existence, is associated with an single object} {unfilled diamond} Composition is a form of aggregation with strong ownership and coincident lifetime of the parts by the whole; the part object may belong to only one whole – the parts are usually expected to live and die with the whole. {usually, any deletion of the whole is considered to cascade to the parts} {filled diamond}

27 ADMS-BIS Aggregation and Composition: Example

28 ADMS-BIS Derived Associations and Attributes Derived associations and attributes can be calculated from other associations and attributes, respectively, on a class diagram. –For example, an age attribute of a Person can be derived if you know that Person’s date of birth.

29 ADMS-BIS Relations and Constraints

30 ADMS-BIS UML for Database Design Database –A database is a collection of data. –Databases can be stored in one or more files, or can be managed by a software system called Database Management System (DBMS) What makes a database –Add Data –Delete Data –Change Data –Lookup or search for data –Organize Data

31 ADMS-BIS Key Terminology Table Column Record Field Primary Key Foreign Key

32 ADMS-BIS Database Diagram Elements Table Column Primary key Foreign key Identifying relationship Non-identifying relationship

33 ADMS-BIS Database Diagram Elements (2) Table (stereotype >) Not used Primary key (stereotype >) Foreign key (stereotype >) Primary/Foreign key (stereotype >) Non-identifying relationship Identifying relationship

34 ADMS-BIS Example 1

35 ADMS-BIS Mapping Logical Design To Database Design Synchronization Classes > Tables Attributes > Columns Associations > Relations Normalization There are more ways to do it

36 ADMS-BIS Mapping Classes To Tables Map persisted classes to tables Many to many associations must be broken down to one to many associations using an association table.

37 ADMS-BIS Mapping Subtype Classes to Tables One table per class One table per concrete class One table per hierarchy

38 ADMS-BIS Mapping Attributes to Columns Map persistent attributes Don’t map calculated attributes Can use Generic Types first, later use database specific types. Generic Types: Boolean, Currency, Date, Double, Integer, Long, Single, String

39 ADMS-BIS Example 2

40 ADMS-BIS Example Projecten

41 ADMS-BIS Database Example

42 ADMS-BIS Normaliseren Het verfijnen van een informatiebehoefte en het verder detailleren van een gegevensmodel wordt normaliseren genoemd. Normaliseren gebeurt in een aantal stappen die leiden tot zogenaamde normaalvormen. Met een denkproces kan men tot hetzelfde komen zonder dat men de specifieke normaalvormen hanteert. Uitgangspunt is een ongenormaliseerde groep, dwz alle gegevens elementen worden geidentificeerd.

43 ADMS-BIS Voorbeeld Het lenen van boeken bij de bibliotheek; er kunnen meerdere exemplaren van een boek zijn. Gegevens: ISBN titel omschrijving boekidentificatie aantal leendatum lener lenernaw

44 ADMS-BIS Normaliseren 1 Allereerst worden procesgegevens verwijderd en wordt een repeterende groep afgesplitst. De oorspronkelijke sleutel wordt overgenomen; deze zorgt voor de koppeling (relatie, associatie) tussen de groepen. Deze sleutel is niet voldoende samen met een ander gegeven vormt het een samengestelde sleutel. (1eNV) boekid isbn titel omschr aantal lenerid leendatum lenernaw boekid isbn titel omschr aantal boekid lenerid leendatum lenernaw

45 ADMS-BIS Normaliseren 2 Daarna geldt dat attributen functioneel afhankelijk moeten zijn van de gehele sleutel. Dat betekent dat de attributen die slechts van een gedeelte van de sleutel afhankelijk zin, in een aparte groep worden opgenomen. (2eNV) boekid lenerid leendatum boekid isbn titel omschr aantal boekid lenerid leendatum lenernaw boekid isbn titel omschr aantal lenerid leennaw

46 ADMS-BIS Normaliseren 3 Daarna worden ook attributen die ook functioneel afhankelijk zijn van andere niet-sleutelattributen in aparte groepen genomen. (3eNV) boekid lenerid leendatum boekid isbn titel omschr aantal lenerid leennaw boekid isbn aantal isbn titel omschr boekid lenerid leendatum lenerid leennaw

47 ADMS-BIS Resultaat BIBBOEK BIBBOEK boekid isbn aantal BOEK isbn titel omschr BOEKLENER boekid lenerid leendatum LENER lenerid leennaw

48 ADMS-BIS Database Desktop Example

49 ADMS-BIS Questionnaire A market research company develops written questionnaires for customers, carries out the market research and presents the results to the customer. The company would like to develop an information system to help them in their work. The information system is based on the following description. A questionnaire consists of a number of questions. Each question can appear in one or more questionnaires. A question always has one or more possible answers and each possible answer can be associated with one or more questions (for example, an answer "Yes" can be given to a large number of questions in the questionnaire). The chosen answer results in a number of points. The number of points depends on the combination of the question for which the answer was given and the questionnaire in which the question was asked. The answers given for a filled-in questionnaire are registered per question. The person filling in a questionnaire can also give a comment with some questions. He or she can also give a comment on the questionnaire as a whole. These comments are all registered in the information system. Comments with questions or on the questionnaire as a whole are not mandatory. Make a class diagram showing the most important object types. State any assumptions that you have made. Only functional relationships are allowed in the class diagram.

50 ADMS-BIS Questionnaire 1 Questionnaire A101 CustomA QuestionsAnswersPoints Question_Aanswer_1points0 answer_3points1 answer_4points7 Comment Question_Banswer_2points9 answer_3points2 Comment ------------------- Comment questionnaire Questionnaire B341 CustomC QuestionsAnswersPoints Question_Aanswer_1points4 answer_4points1 answer_7points2 Comment Question_Danswer_4points9 answer_3points2 Comment ------------------- Comment questionnaire

51 ADMS-BIS Questionnaire 2 Gegevenselementen Qn_id [custom] Qn_com Quest_id Quest_txt Quest_com Answ_id Answ_txt Points Qn_id [custom] Qn_com Quest_id Quest_txt Quest_com Answ_id Answ_txt Points

52 ADMS-BIS Questionnaire 3 Questionnaire Qn_idQuest_id Qn_id [custom]Qn_id Qn_comQuest_txt Quest_com Answ_id Answ_txt Points

53 ADMS-BIS Questionnaire 4 QuestionnaireQuestion Qn_idQuest_idAnsw_id Qn_idQuest_id [custom]Qn_idQuest_id Qn_id Qn_comQuest_txtQn_id Quest_comAnsw_txt Points QuestionnaireQuestionAnswersAnswTxt Qn_idQuest_idAnsw_idAnsw_id Qn_idQuest_id [custom]Qn_idQuest_idAnsw_txt Qn_id Qn_comQuest_txtQn_id Quest_comPoints

54 ADMS-BIS Questionnaire 5

55 ADMS-BIS Map to DataBase Model Design DB use Realize DB system For Example Realization DB system by MS ACCESS

56 ADMS-BIS MS Access DB Design (1 of 5)

57 ADMS-BIS MS Access DB Design (2 of 5)

58 ADMS-BIS MS Access DB Design (3 of 5)

59 ADMS-BIS MS Access DB Design (4 of 5)

60 ADMS-BIS MS Access DB Design (5 of 5)


Download ppt "ADMS-BIS Bouwkundige Informatiesystemen ADMS 2006 UML part 2 Jan Dijkstra - 30 oktober 2006."

Similar presentations


Ads by Google