Presentation is loading. Please wait.

Presentation is loading. Please wait.

Executable UML The Models are the Code - Executable UML Lecture 3 - Modelling with Domains and Classes Paul Krause.

Similar presentations


Presentation on theme: "Executable UML The Models are the Code - Executable UML Lecture 3 - Modelling with Domains and Classes Paul Krause."— Presentation transcript:

1 Executable UML The Models are the Code - Executable UML Lecture 3 - Modelling with Domains and Classes Paul Krause

2 Executable UML Lecture 3 - Modelling with Domains and Classes v Partitioning complex projects v Domains and Domain Charts v Class Modelling within Domains

3 Executable UML One Thousand Classes and Beyond v We have to partition the problem. But how? v Functional decomposition is a traditional option v But typically a function represents a “vertical”slice through a system requiring  application expertise  knowledge of service functions - security, logging, …  understanding of database functionality  software architecture and implementation knowledge v In general, there are too many dependencies

4 Executable UML Subject Matter Partitioning v Sally Shlaer and Stephen Mellor established the foundations for this approach in 1988  Object-oriented Systems Analysis - Modelling the World in Data v Recognises that a system consists of a set of subject matters - domains  Each domain consists of a set of classes  Domains are represented as packages in UML v A Domain Chart captures the dependencies between domains

5 Executable UML Air Traffic Control System Air Traffic Control Equipment Configuration AlarmsUser Interface Radar Data Processing

6 Executable UML What is a Domain? v A domain is an autonomous, real, hypothetical or abstract world inhabited by a set of conceptual entities that behave according to characteristic rules and policies  Mellor and Balcer, p30 v Real Worlds  Air traffic control, patient administration, banking, … v Hypothetical Worlds  3D geometry, statistical analysis, … v Abstract Worlds  User interface, messaging, workflow, …

7 Executable UML Domain Policies Aircraft Air Traffic Control Domain “Aircraft” Class represents a real world concept Domain Policy: An Aircraft must remain at least 3 miles horizontally and 100 vertically from all other Aircraft Icon User Interface Domain “Icon” Class represents an abstract concept Domain Policy: An icon must become opaque if it is in front of another icon

8 Executable UML Advantages of Subject Matter Partitioning v Reuse v Well-defined interfaces v Effective use of subject-matter knowledge v Stability to changing requirements v Stability to changing technology v Incorporation of third party software v Effective integration with Use-Case driven development

9 Executable UML Domain Types Command and Control Application Domains Represents the purpose of the system from the end-user’s perspective Recording Service Domains Providing generic services to support the application domains User Interface Software Architecture Architecture Domain Representing the globally applied design and coding strategies Oracle Implementation Domains Representing pre-existing software components - either bought-in or ‘legacy’ Unix

10 Executable UML Domain Partitioning Flight Plan AircraftRunway Icon Pop-up Menu 1 has filed has been filed for 0..* 0..1 is being used by is using 0..1 represents 1 is represented by 1 1 is linked to has 1

11 Executable UML Air Traffic ControlUser Interface Domain Partitioning Flight Plan AircraftRunway Icon Pop-up Menu 1 has filed has been filed for 0..* 0..1 is being used by is using 0..1 1 is linked to has 1

12 Executable UML Lecture 3 - Modelling with Domains and Classes v Partitioning complex projects v Domains and Domain Charts v Class Modelling within Domains

13 Executable UML Class Modelling within Domains v A class is an abstraction of some set of conceptual entities with common characteristics and common behaviour v Note the two activities  Classification  Abstraction v There are various kinds of “conceptual entities”, not just tangible things

14 Executable UML Kinds of Classes v Tangible things  Aircraft, Book, Car, Pet, … v Roles  Doctor, Clerk, Employee, Department, … v Incidents  Flight, Performance, Accident, Service Call, … v Interactions  Purchase, Credit Card Charge, Database Transaction, … v Specifications  Insurance Product, Book Product, Credit Card Type, …

15 Executable UML Classes and Objects An Object v Is a chunk of structured data in a running software system v Has properties that represent its state  Its behaviour may depend on its state v Has behaviour  how it acts and reacts to events and messages

16 Executable UML Classes and Objects A Class v Is an abstraction of a set of objects that are similar in some useful way  its instances v Film is a class v “Anger Management” is an instance of Film

17 Executable UML Classes and Objects Film title director producer duration : Film title: Anger Management director producer duration

18 Executable UML Identifying classes v Think about general properties of the domain in which you are working v Identify the nouns v These form candidate classes A Publisher produces and markets a Book A Customer purchases a Book An Author writes a Book

19 Executable UML PublisherBookCustomerAuthor

20 Executable UML Publisher name address webSite Book bookNumber title unitPrice Customer name email shippingAddress Author name address webSite

21 Executable UML Associations Publisher name address webSite Book bookNumber title unitPrice R1 publisherpublication Publisher name address webSite Book bookNumber title unitPrice R1 is produced and marketed by produces and markets

22 Executable UML Association Meanings v Name the association so that it can be unambiguously identified (e.g. R1) v The “association ends” express meaning v An association end may be a role or a verb phrase v Each class in an association has a role  (e.g. a Book has the role of a publication) v But writing meaning in terms of a verb phrase is more descriptive

23 Executable UML Publisher name address webSite Book bookNumber title unitPrice Customer name email shippingAdd Author name address webSite R1R3 R2 is produced and marketed by produces and markets purchases is sold to wrote was written by

24 Executable UML Multiplicity v We can also characterise an association by the number of instances (objects) that participate in each instance of the domain relationship v UML allows specific numbers in a multiplicity relation v Recommend you only use four kinds:  unconditional;1, or 1..*  conditional;0..1, or 0..*

25 Executable UML Publisher name address webSite Book bookNumber title unitPrice Customer name email shippingAdd Author name address webSite R1R3 R2 is produced and marketed by produces and markets purchases is sold to wrote was written by 10..*1..* 0..* 1..* There are books not sold to any customer To be a customer you must have purchased at least one book But where do I put the number of books a customer purchased?

26 Executable UML Publisher name address webSite BookProduct bookNumber title unitPrice Customer name email shippingAdd Author name address webSite R1R3 R2 is produced and marketed by produces and markets is a purchase of is sold as wrote was written by 10..*1..* 0..* 1..* Order quantity salePrice date makes1..* is made by 1


Download ppt "Executable UML The Models are the Code - Executable UML Lecture 3 - Modelling with Domains and Classes Paul Krause."

Similar presentations


Ads by Google