Presentation is loading. Please wait.

Presentation is loading. Please wait.

OO Design Notations Original version by B.Rogers/M.Utting.

Similar presentations


Presentation on theme: "OO Design Notations Original version by B.Rogers/M.Utting."— Presentation transcript:

1 OO Design Notations Original version by B.Rogers/M.Utting

2 Notations n There are a large number of OO and other design notations (text or diagram) n Serve two main purposes –helping express ideas during design –documenting the final structure of a system n Informal (personal) –allow free expression of ideas n Formal (standard) –may admit proof of correctness –permits development of tools (Rat Rose) –communication to others

3 Notations n Ad Hoc notations –widget relationships n UML –class diagrams –(activity diagrams) n CRC cards –Class, Responsibility and Collaboration n Use Cases

4 paper triangle button Widget Organisation circle button square button lcd quit button window

5 Organisation of Widgets window (QWidget) quitbutton (QPushButton) squarebutton (QPushButton) circlebutton (QPushButton) trianglebutton (QPushButton) paper (Canvas) lcd (QLCDNumber)

6 Widgets emphasising links window lcd square circle quit triangle paper desktop

7 Unified Modelling Language n Facetiously called Union of all MLs n (UML) Grady Booch, Jim Rumbaugh, and Ivar Jacobson n Unifies and standardises a number of notations developed over the 80 and 90’s n A (mainly) graphical language used to express object oriented designs. –use case diagrams; class diagrams; interaction diagrams; package diagrams; state, collaboration, sequence, activity diagrams; deployment diagrams.

8 Class Diagram n Can be used at different stages of development: from modeling the kinds of objects in a system through to detailed implementation n Classes may be implemented as Java classes or not, may just be kinds of items in a system n A class is shown as a box: Attributes NAME Operations

9 Attributes NAME Operations int atx, aty graphic draw resize Examples n Name in italics for an abstract class Shape current_shape Graphic picture Canvas mouse down, move, up repaint set shape

10 Class Diagram n Association –what uses, has, contains, is related to... n Multiplicity –how many of each kind of object are related n Navigability –what pointers are present n Generalization –sub/super class relationships n Other constraints

11 int atx, aty graphic draw resize Shape current_shape Graphic picture Canvas mouse down, move, up repaint set shape four buttons lcd display MAIN

12 int atx, aty graphic draw resize Shape current_shape Graphic picture Canvas mouse down, move, up repaint set shape 1 * four buttons lcd display MAIN 11

13 int atx, aty graphic draw resize Shape current_shape Graphic picture Canvas mouse down, move, up repaint set shape 1 * four buttons lcd display MAIN 11

14 int atx, aty graphic draw resize Shape current_shape Graphic picture Canvas mouse down, move, up repaint set shape 1 * four buttons lcd display MAIN 11 int size Square int width, height Triangle int radius Circle

15 CRC Cards n Class, Responsibility and Collaboration –Cunningham and Beck from Tektronix labs in Portland, Oregon. (Smalltalk) –Used 15 by 10cm index cards n Attempt to encourage a high level description of the purpose of a class n Avoid details of methods and attributes n Small card limits the number of responsibilities and amount of detail

16 graphic knowing where on the displayCanvas surface it should be drawn drawing itselfCanvas (delegated to subclasses) resizing, given new extentCanvas (delegated to subclasses) Responsibilities Name Collaborators

17 graphic knowing where on the displayCanvas surface it should be drawn drawing itselfCanvas (delegated to subclasses) resizing, given new extentCanvas (delegated to subclasses) Canvas responding to mouse eventsGraphic(+) by drawing a graphic knowing which kind of graphicMAIN to draw next(buttons) maintaining a list of graphicsGraphic which have been drawn repainting the screenCanvas

18 squarecircletrianglesquareMAINCanvas responding to mouse eventsGraphic(+) by drawing a graphic knowing which kind of graphicMAIN to draw next(buttons) maintaining a list of graphicsGraphic which have been drawn graphic knowing where on the displayCanvas surface it should be drawn drawing itselfCanvas (delegated to subclasses) resizing, given new extentCanvas (delegated to subclasses)

19 Use cases 1 n What is a use case? n Identify user goal’s, not system functions n E.g. for a word processor: –Build an index –Insert a picture –Ensure consistent formatting. n Describe external view, interactions with the outside world.

20 Use cases 2 Express requirements at a high level n The first step in software analysis is to develop a sufficient set of use cases. (but will also useful later on for system testing) n Each use case (business task) has: –A name: –An actor: a role that a user takes when using the system. Actors are usually human. –A description: of interaction with system.

21 Description should tell us: n What are the main tasks done by the actor? n What inputs/outputs will the actor give/get? n Does the actor have to inform the system about changes in the external environment? n What information does the actor want from the system? n Does the actor wish to be informed about unexpected changes?

22 Use Case Diagrams Use Case Name Actor Name > (special cases/exceptions)

23 Use Case Diagrams 2 > Valuation Analyze risk Trader Price deal Customer Capture deal Limit exceeded


Download ppt "OO Design Notations Original version by B.Rogers/M.Utting."

Similar presentations


Ads by Google