Presentation is loading. Please wait.

Presentation is loading. Please wait.

E-Business Modelling with UML

Similar presentations


Presentation on theme: "E-Business Modelling with UML"— Presentation transcript:

1 E-Business Modelling with UML
Module P00801 E-Business Information Systems Lecture 6 E-Business Modelling with UML March 2011 Prof. Hong Zhu Department of Computing and Electronics P00801: E-Business Information Systems

2 Outline Principles of Software Modelling United Modelling Language UML
Roles of models in e-business software development Principles of object-oriented modelling Types of models United Modelling Language UML Functional models Use case diagram Activity diagram Structural models Class diagram Object diagram Behaviour models Sequence diagrams Collaboration diagrams State machine March 2011 P00801: E-Business Information Systems

3 What is a Model Irrelevant details are omitted. Model is an abstract description of a system under study In scientific disciplines, we often use a set of statements For example, Newtonian physics models objects by three laws In engineering disciplines, we often use small scale objects (also in different material, etc.) For example, in architecture design, architectures use structural models of buildings For software modelling, we often use a set of diagrams For example: SSADM uses dataflow diagrams, control flow diagrams, entity relationship diagrams March 2011 P00801: E-Business Information Systems

4 Relationship between system and model
A system is an instance of model, if the description is correct the statements are true the structure and operation of the system is as the meaning of the diagrams Model as the specification, system as the implementation One model, many instances different ways of implementations One system, many models different ways of abstraction March 2011 P00801: E-Business Information Systems

5 Modelling in E-Business Software Development
Activity Roles of Modelling Requirements Elicitation Guide the analyst to obtain the information in the process of model construction Requirements Clarification Force the analyst to explicitly express obtained information clearly in well-defined notations in model construction Req. & Design Documentation Represent information in the form of models in well-defined notation without ambiguity Validation, Verification and Testing Support VV&T by readable representations of models at a suitable level of abstraction that are easy to understand by users and developers Analysis and transformation Support automated and semi-automated analysis and transformation by representing systems in machine readable models March 2011 P00801: E-Business Information Systems

6 Model-Driven Software Development
General ideas: Develop a model is the main goal of the development at early stage; Use the model as the baseline for later development activities; Use automated tool to construct analyse and process models. Platform Independent Model (PIM) Use automated modelling tool March 2011 Platform Specific Model (PSM) Automated code generation tool Executable code P00801: E-Business Information Systems

7 Types of Models Type What are modelled Focus UML Functional models
The functionality of the SW as its roles in the business process and its interaction with the user and environment How the system works from the external point of view Use case diagram, activity diagram Structural models The structure of the data that supports the business process in an organisation and their representation and process in the SW The logic organisation of data at RE and technical details such as how the data are stored, created or manipulated in design and implementation Objects and class diagrams Packages, deployment and component diagrams Behaviour models The internal dynamic aspects of an IS that supports the business processes in an organisation The internal logic of processes and how the processes are implemented Sequence, communication, behavioural state machine March 2011 P00801: E-Business Information Systems

8 Relationships Between Types of Models
External view Internal view Functional model Use case diagram Activity diagram Static view Dynamic view Structural model Class Diagram Object Diagram Behavioural model Sequence diagram Communication diagram Behavioural state machine March 2011 Interaction view Individual view P00801: E-Business Information Systems

9 Underlying Principles of OO Modelling (1)
An information system should be structured in such a way that it reflects the structure of the real world system Easier to understand the information system Metaphor: using the same vocabulary to describe the entities in the information system as the users describes the things, ideas and concepts in the real world Easier to modify the information system Users’ requirements tend to change much more frequently than the structure of their organisation and the domain Changes in organisation system can be relatively easily reflected in the modification of the information system March 2011 P00801: E-Business Information Systems

10 Underlying Principles of OO Modelling (2)
‘Everything in the world is object’. Hence, The real world can be modelled by objects Everything in an information system should be an object in order to satisfy principle 1 All information systems can be modelled in OO approach March 2011 Semantic gap Real world World of software Design phase Analysis phase Model of the real world Model of the SW world P00801: E-Business Information Systems

11 The Meta-Model of Object-Orientation
A set of attributes: The states of real world objects are reflected by the values of the attributes A set of methods: The changes of states are reflected in the collection of methods that changes the states of objects The set of attributes and the set of methods are encapsulated into one computational entity March 2011 P00801: E-Business Information Systems

12 Class is called the classifier of objects, similar to data type is the classifier of data
The similarity between objects is reflected by classifying them into the same class. Objects are instances of classes Class is the template for a collection of objects that have the same structure, i.e. the same set of attributes, and the same set of methods. March 2011 In mainstream OO methodology, objects does not change their membership to the classes. Class is an abstract thing that does not actually exist in the system at runtime. P00801: E-Business Information Systems

13 Relationships Between Objects
Generalisation Definition: Class A is a generalisation of class B, if every instance of class A is also an instance of class B. Class A is called a super-class of B; class B is called a subclass of A. We also say that class B is a specialisation of A. A relationship between classes: the super-class /subclass relationship is also called inheritance relation. Class B inherits the attributes and methods of A. Example: Undergraduate Student is a subclass of Student; Postgraduate Student is a subclass of Student; Student is a subclass of Person; Lecturer is also a subclass of Person March 2011 It also allows B to specialise the attributes and methods by giving a new definition while maintain the same semantics P00801: E-Business Information Systems

14 Whole-part relationships
Whole-part: Object A is a part of object B A wheel is a part of a car Aggregation: an object consists of several other objects A car consists of 4 wheels, 1 engine, 1 steering wheel, … Key features of whole-part relationship Life-dependence: Whether a part object can exist without being a part of a whole object Shareability: Whether a part object can be a part of more than 1 object Cardinality: (also called multiplicity): How many part objects can be contained in 1 whole object Types of whole-part relations in UML: Aggregate: shareable, but no life-dependence Composite: life-dependent and not shareable E.g. Heart is a part of human body. March 2011 E.g. Your money is also mine. E.g. A bike has 2 wheels. P00801: E-Business Information Systems

15 Association An object A affects another object B’s state, e.g. object A can directly cause object B to change its state (by invocation of object B’s method). A doctor operates on a patient Engine drives wheels Steer wheel change the direction of wheels An object A monitors another object B’s state, e.g. object A accesses B’s attributes. March 2011 P00801: E-Business Information Systems

16 Functional Models Use case diagram Activity diagram
Describes the functionality of the SW its roles in the business process its interaction with the user and environment What are the functions How the system works from the external point of view UML’s support of functional modelling Use case diagram Activity diagram March 2011 P00801: E-Business Information Systems

17 Use Case Diagrams A use case diagram is a collection of actors, use cases, and their communication Used during requirements elicitation to represent the functions of a system from external point of view March 2011 Use-case diagrams provide a way of describing the external view of the system and its interactions with the outside world. In this way it resembles the context diagram of traditional approaches. In this representation the outside world is represented as actors. Actors are roles played by various people, or other computer systems. The emphasis on roles is important: one person may play many roles, and a role may have many people playing it. Use-cases are then typical interactions that the actor has with the system. P00801: E-Business Information Systems

18 The Notation of UML’s Use Case Diagrams
Passenger Actors represent roles, that is, a type of user of the system Use cases represent a sequence of interaction for a type of functionality <<Extend>> or <<Include>> relations between use cases March 2011 PurchaseTicket <<Extend>> FindRoute P00801: E-Business Information Systems

19 Actors An actor models an external entity which communicates with the system: User External system Another computer system Physical environment An actor has a unique name and an optional description. Examples: Passenger: A traveller on the train GPS satellite: Provides the system with GPS coordinates Passenger March 2011 P00801: E-Business Information Systems

20 Use Case A use case represents a class of functionality provided by the system as an event flow. A use case consists of: Unique name Participating actors Entry conditions Flow of events Exit conditions Special requirements PurchaseTicket March 2011 Purchase Ticket P00801: E-Business Information Systems

21 Example of Use Case Diagram
Flow of Events: The seller selects an agent. The system responds by assigning an agent and notifying the seller’s agent. The seller lists the property to sell. The system responds by displaying this property in the property listing and linking it for searches. The buyer selects an agent. The buyer reviews the property listings by entering search criteria. The system responds by displaying properties that match the buyer’s search criteria. The buyer finds a property and makes an offer on it. The system responds by notifying the seller and the seller’s agent. The seller responds to the offer with a counteroffer. The system responds by notifying the buyer and the buyer’s agent. The buyer and the seller agree to terms. The system responds by recording the agreement. The buyer indicates that a loan is required. The system responds by locating an appropriate loan provider. The buyer and the loan provider agree to loan terms. The system responds by recording the terms of the loan. The buyer and the seller close on the property. The system responds by recording the details of the close. March 2011 Use case name: Sell Property Participant: Buyer, Seller, Loan Adviser Entry conditions: Exit conditions: Include relationships factor use cases into additional ones. Includes are especially helpful when the same use case can be factored out of two different use cases. Both Make Appointment and Request Medication include Check Patient Record as a subtask. In the diagram, include notation is a dotted line beginning at base use case ending with an arrows pointing to the include use case. The dotted line is labeled <<include>>. An extend relationship indicates that one use case is a variation of another. Extend notation is a dotted line, labeled <<extend>>, and with an arrow toward the base case. The extension point, which determines when the extended case is appropriate, is written inside the base case Kulak, D and Guiney, E., Use Cases: Requirements in Context, Addison Wesley, 2000 (page ) P00801: E-Business Information Systems

22 Revised use case diagram
How to decompose long transactions into use cases? March 2011 P00801: E-Business Information Systems

23 Notation of UML’s Activity Diagrams
Action Action/activity node: an action or an activity Control flow Object flow Class name Object node: represent an object Initial node: beginning of a sequence of actions/activities March 2011 Final activity node: stop all control flows and object flows in an activity Final flow node: stop a specific control flow or object flow Swim lane: break up an activity diagram into parts to assign the activities or actions to the actors Decision node Fork node Merge node Join node P00801: E-Business Information Systems

24 Activity Diagram: the Underlying Concepts
Action/Activity Performed for some specific business reason Can be manual or computerised behaviour Named by a verb with a noun, e.g. Make payment arrangement Book an air ticket Enter delivery address Action: simple, not decomposable Activity: can be further decomposed into a set of actions or activities March 2011 P00801: E-Business Information Systems

25 Control Flow and Object Flow
Model the path of execution through a business process Can only be attached to action/activity nodes Object flow Model flow of object through a business process Show the objects that flow into and out of the actions or activities (i.e. passed between activities) Similar to dataflow in dataflow diagrams Attached to one action/activity node and an object node March 2011 P00801: E-Business Information Systems

26 Create new patient record
Example: Appointment Decision node Object node Get patient info Decision condition [old patient] [New patient] March 2011 Appt request form Create new patient record Appt request form Object flow Make an appointment Appt P00801: E-Business Information Systems

27 Swim Lanes Breaking up an activity diagram into parts by placing activities/actions into the swim lane box Assigning responsibility to objects or individuals that performs the activities/actions by assign a name of object/individual to each swim lane Representing parallel and concurrency of executions Modelling a business workflow, Describing ‘who is doing what’ using swim lanes Describing ‘how they coordinate’ using synchronisation bar March 2011 P00801: E-Business Information Systems

28 Example: Make a School Lunch Box
Father Mother Get jelly Get bread Get drink Get dessert Get peanut butter March 2011 Create sandwich Get lunch box Put lunch in box P00801: E-Business Information Systems

29 For information systems:
Structural Models General concept: A structural model describes a system in terms of its constituent elements and their interrelationship. For information systems: A structural model of an information system describes the structure of the data and their processing code by dividing them into computational entities. March 2011 P00801: E-Business Information Systems

30 Structural Modelling at Different Phases
At analysis phase: Shows the logical organisation of the entities without indicating how they are stored, created, or manipulated Free from any implementation or technical details At design phase: Reflects how the objects will be organised in databases and files Address implementation and technical issues, such as redundancy in the storing of information, ease of retrieval of stored information, etc. March 2011 P00801: E-Business Information Systems

31 UML Class Diagram Notation
Class name Attributes Methods Class name Aggregate Class node without compartments March 2011 Composite Class node with 3 compartments Inheritance Association P00801: E-Business Information Systems

32 Example: Inheritance Relation
Vehicle Buffalo cart Truck Aircraft Jumbo-jet Helicopter March 2011 P00801: E-Business Information Systems

33 Examples: Multiplicity
Car Wheel Car Wheel 4 1 Car 0..1 March 2011 4..5 Wheel A wheel is a part of car A car has 4 wheels. A wheel can be on 1 car at any time. A car may have 4 or 5 wheels. A wheel may be fixed on 1 car, but it may also be not used by any car. P00801: E-Business Information Systems

34 Example: Hospital Person Employee Patient Symptom Illness Treatment
0..* Treatment Appointment Schedules Has scheduled 1 0..* 1..* Nurse Administrative staff Doctor Health Team 0..* 1..* 0..1 March 2011 Bill Leads to 1 0..* * P00801: E-Business Information Systems

35 Example: Class Diagram with Attributes & Methods
Person -surname -first name -address -telephone -date of birth -/age Patient -amount +make appointment March 2011 Derived attribute: Its value is calculated from other attributes rather than stored. P00801: E-Business Information Systems

36 Example: Class Diagram
Patient -amount +make appointment Appointment -time -date -reason +Cancel Doctor Symptom -name schedules Has scheduled suffer 0..* 1..* 1 March 2011 P00801: E-Business Information Systems

37 Behavioural Models Behavioural models describe the internal dynamic aspects of an information system that supports the business processes in an organisation At requirements analysis stage Internal logic of the business processes Without specifying how the system is implemented At design and implementation stage Details of the designs of the system, such as the data types of the attributes the operations of the objects March 2011 Behaviour model describes the ‘journey between the towns’, i.e. the interactions between the objects to achieve the functions of use cases. P00801: E-Business Information Systems

38 Two Types of Behaviour Models
Interaction models Describe the collaboration between objects and actors in the business process by describing how objects and actors in the system communicate, cooperate and coordinates with each other In UML, they are described by sequence diagrams and communication diagrams Individual models Describe the behaviour of individual objects and actors by describing how they change their states and the actions to be taken in each state and the outside condition. In UML, they are described by behavioural state machines associated to classes March 2011 P00801: E-Business Information Systems

39 Interaction Diagrams Basic concepts Object Operations Messages
OO Behaviour rule: When an object receives a message, it executes its corresponding method with the parameters given in the message. Basic concepts Object Instances of classes Consists of attributes and methods Operations Attributes describe the information about the object Operations (i.e. methods) are the actions that an object can perform, which are essentially procedure/function declarations that has attributes as global variables Messages Messages are information sent to objects to tell an object to execute one of its operations Messages are essentially procedure/function calls from one object to another March 2011 P00801: E-Business Information Systems

40 Sequence Diagrams: Buying Book Online
:Buyer :ClientGUI :Bookshop :Customer Manager keywords List of titles title title available place order request customer details customer details request credit details credit details purchase confirmed Two dimensions time objects March 2011 P00801: E-Business Information Systems

41 Elements of Sequence Diagrams
<<actor>> Actor/Role Actor: A person or system that derives benefit from and is external to the system anObj: Class Object: Participants in an interaction depicted in the sequence diagram by sending and/or receiving messages March 2011 Lifeline: denotes the life of an object during the interaction depicted in the sequence diagram aMessage() Return value Message: conveys information from one object to another one Execution occurrence: denotes when an object is sending and/or receiving messages Object destruction: shows an object is going out of existence P00801: E-Business Information Systems

42 Message Flows Message flow annotation:
There is only ONE thread of execution, and activity passes from one object to another. Message flow annotation: Procedural or synchronous - a message is sent by one object to another, and the first object WAITS until the resulting action has completed. Asynchronous - a message is sent by one object to another but the first object does NOT wait until the resulting action has completed, it carries on with the next step in its own sequence of actions. March 2011 More than one object can be active at any one time. This would be the case in a multi-threaded system. Flat - each arrow shows a progression from one step to the next in a sequence. Normally the message is asynchronous, but can be used for both (sync. and async. modes) Return - represents the explicit return of control from the object to which the message was sent (optional). P00801: E-Business Information Systems

43 Example: Telephone Connection
notation using an object constraint language The objects are: sender (person) receiver (person) telecoms switch conversation March 2011 UML notation for a note P00801: E-Business Information Systems

44 Loops and conditionals: UML 1.x
procedure dispatch foreach (lineitem) if (product.value > $10K) careful.dispatch else regular.dispatch end if end for if (needsConfirmation) messenger.confirm end procedure March 2011 P00801: E-Business Information Systems

45 Loops and conditionals: UML 2.0
March 2011 P00801: E-Business Information Systems

46 Common Operators for Interaction Frames
Meaning alt Alternative multiple fragments; only the one whose condition is true will execute opt Optional; the fragment executes only if the supplied condition is true. Equivalent to an alt with only one trace. par Parallel; each fragment is run in parallel. loop Loop; the fragment may execute multiple times, and the guard indicates the basis of iteration region Critical region; the fragment can have only one thread executing it at once. neg Negative; the fragment shows an invalid interaction. ref Reference; refers to an interaction defined on another diagram. The frame is drawn to cover the lifelines involved in the interaction. You can define parameters and a return value. sd Sequence diagram; used to surround an entire sequence diagram, if you wish. March 2011 P00801: E-Business Information Systems

47 Behavioural State Machines
A dynamic model that shows the different states that a single object passes through during its life its response to events with changes on its state and the actions. Used for further definition of the behaviour of objects Waiting Enters Hospital Checks in Admitted [Diagnosis =Unhealthy] Released [Diagnosis = healthy] Under observation > 2 weeks March 2011 P00801: E-Business Information Systems

48 Basic Concepts of State Machines
The state of an object is defined by the values of its attributes and its relationships with other objects at a particular point in time. E.g. a patient can be new, current, or former. Event: Something that takes place at a certain point in time and changes a value of an attribute. For example: A designated condition becoming true The receipt of a call for a method by an object Passage of a designated period of time Transition: A relationship that represents the movement of an object from one state to another state. A transition is trigger by an event; A transition may be associated with an action/activity. The action/activity takes place when the state transition happens A transition may have a guard condition, which is a Boolean expression. The transition happens only when the guard condition is true March 2011 P00801: E-Business Information Systems

49 UML’s Notation of State Machines
State node Initial state March 2011 Final state [guard condition] Event/Action State transition P00801: E-Business Information Systems

50 Further reading Martin Fowler, UML Distilled: A Brief Guide to the Standard Object Modelling language, Third Edition, Addison-Wesley, 2003. Michael P. Papazoglou and Pieter M. A. Ribbers, E-Business: Organizational and Technical Foundations, (Chapter 12: E-Business Modelling, pp ) March 2011 P00801: E-Business Information Systems


Download ppt "E-Business Modelling with UML"

Similar presentations


Ads by Google