Presentation is loading. Please wait.

Presentation is loading. Please wait.

Object-Oriented Software Engineering CS288. UniS 2 Lecture 1 - Object-Orientation & UML Contents  Overview  Classifiers  Dynamic Behaviour  Static.

Similar presentations


Presentation on theme: "Object-Oriented Software Engineering CS288. UniS 2 Lecture 1 - Object-Orientation & UML Contents  Overview  Classifiers  Dynamic Behaviour  Static."— Presentation transcript:

1 Object-Oriented Software Engineering CS288

2 UniS 2 Lecture 1 - Object-Orientation & UML Contents  Overview  Classifiers  Dynamic Behaviour  Static Modelling  Summing Up

3 UniS 3 Unified Modelling Language  First introduced in 1999 (about)  Still evolving, and extremely popular language  Current version 2.0 ratified August 2003  We use UML 1.4, which is the current standard widely adopted in industry

4 UniS 4 Unified Modelling Language Java allows us to closely tie the concepts from the UML model directly to the implementation. Easier to verify Easier to modify Easier to reuse Think before you code. UML allows us to build a conceptual model that we can examine and understand before we write a single line of code.

5 UniS 5 Unified Modelling Language  Visual modelling language Specify Visualise Construct Document  UML can be used to capture information about: Static structure Dynamic behaviour Environmental aspects Organisational aspects

6 UniS 6 Overview CreditCardCharges ItemSeller ManagerInterface ItemDB SalesServer CustomerInterface Client ServiceInterface SalesTerminal 1 * 1 * Deployment View

7 UniS 7 Overview height: Real age: Real Person Male_PersonFemale_Person Static View

8 UniS 8 Overview public class Person { public double height; public double age; } class Male_Person extends Person { // Now add stuff here to change // attributes and behaviour } class Female_Person extends Person { // Now add stuff here to change // attributes and behaviour }

9 UniS 9 Overview Locked Available Sold timed out lock unlock buy Behavioural View: Single Object

10 UniS 10 Overview customercredit servicevendor request item show availability select item demand payment insert card charge card Dynamic behaviour: communication patterns

11 UniS 11 Classifiers ClassifierFunctionNotation actorAn outside user of the system classA concept from the modelled system componentA physical piece of the system data typeA descriptor of a set of primitive values that lack identity Name nodeA computational resource subsystemA package that is treated as a unit with a specification, implementation and identity use caseA specification of the behaviour of an entity in its interaction with outside agents Name >

12 UniS 12 Dynamic Behaviour: Use Cases ATM Customer Validate PIN > Withdraw Cash Query Account Order Statement Operator Add Cash Startup Shutdown

13 UniS 13 Dynamic Behaviour: Sequence Chart ATM Customer ATM CardATM Control Customer Interface Bank Server Card Inserted Get Pin PIN Prompt PIN Input Card Request Card Data PIN Entered Validate PIN

14 UniS 14 Dynamic Behaviour: State  A condition or situation during the life of an object during which it satisfies some condition, performs some action, or waits for some event. The Unified Modelling Reference Manual  I.E. State captures all the relevant information about an object at one specific moment with respect to the purpose of the object.

15 UniS 15 Representation of a State Activate Phone entry/ register on network exit / disconnect from network

16 UniS 16 Events trigger Transitions Closed DownIdle startup closedown Top-level Statechart for ATM Control

17 UniS 17 Full Label for a Transition StateAStateB e1 [cond] / action1;action2 event name guard condition actions

18 UniS 18 More ATM Control Closed Down Idle Entry / display Welcome startupclosedown Processing Customer Input card inserted / get pin validation received [invalid card] / confiscate Terminating Transaction Processing Transaction withdrawal selected [valid card] / display wait

19 UniS 19 Phone Composite State Example Off On Power On Power Off

20 UniS 20 Phone Composite State Example Off On Power On Power Off Idle Active unlock incoming-call end

21 UniS 21 Phone Composite State Example Off On Power On Power Off Idle Active Dialling end 0-9 Connecting Ringing Talking unlock incoming-call connect-key connect-fail call-accepted connect-key

22 UniS 22 Static Modelling: Class Tuner class name Channel Frequency attributes Get_Frequency Set_Frequency operations

23 UniS 23 Static Modelling: Inheritance Hierarchy Tuner A/V TunerFM Tuner

24 UniS 24 Static Modelling: Association Tuner Surf List 1 1 Binary relation between classes Can be implemented in different ways 1 Surf List to 1 Tuner

25 UniS 25 Static Modelling: Aggregation Surf List Surf List Size Add Surf Channel Delete Surf Channel Set Surf Channel Source ID Preset Number Preset Name Edit Preset Number Edit Preset Name 0..* Specifies that an aggregate class is made up from components. Here: A Surf List has 0 or more Source ID

26 UniS 26 Static Modelling: Aggregation University 0..* School Department LecturerStudents 1..* 1 1 1 Nested Aggregates

27 UniS 27 Static Modelling: Putting it all together A/V Source Front EndExternal Source Surf List Source ID 0..* 1 1 Tuner 1..* is tuned to

28 UniS 28 Summing Up  UML is a visual modelling language that covers a range of aspects of systems analysis and design  We have seen examples of modelling static structure and dynamic behaviour  Environmental and Organisational aspects can be covered too ______________  Use it!


Download ppt "Object-Oriented Software Engineering CS288. UniS 2 Lecture 1 - Object-Orientation & UML Contents  Overview  Classifiers  Dynamic Behaviour  Static."

Similar presentations


Ads by Google