1 / 28

Object-Oriented Software Engineering

Object-Oriented Software Engineering. CS288. Lecture 1 - Object-Orientation & UML. Contents Overview Classifiers Dynamic Behaviour Static Modelling Summing Up. Unified Modelling Language. First introduced in 1999 (about) Still evolving, and extremely popular language

zanna
Download Presentation

Object-Oriented Software Engineering

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Object-Oriented Software Engineering CS288

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

  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. 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. • 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 Unified Modelling Language

  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. Deployment View CreditCardCharges CustomerInterface ManagerInterface ServiceInterface ItemSeller ItemDB SalesServer 1 1 * * SalesTerminal Client Overview

  7. Static View height: Real age: Real Person Male_Person Female_Person Overview

  8. Overview publicclass 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. Behavioural View: Single Object timed out buy lock Available Locked Sold unlock Overview

  10. Overview Dynamic behaviour: communication patterns customer vendor credit service request item show availability select item demand payment insert card charge card

  11. Classifiers Name <<subsystem>>

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

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

  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. Representation of a State Activate Phone entry/ register on network exit / disconnect from network

  16. Closed Down startup Idle closedown Events trigger Transitions Top-level Statechart for ATM Control

  17. guard condition actions event name StateA StateB e1 [cond] / action1;action2 Full Label for a Transition

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

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

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

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

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

  23. A/V Tuner FM Tuner Static Modelling: Inheritance Hierarchy Tuner

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

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

  26. 1 1..* University School 1 1..* Department Nested Aggregates 1..* 1 1..* 0..* Lecturer Students Static Modelling: Aggregation

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

  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!

More Related