Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSC 520 – Advanced Object Oriented Programming, Fall, 2010 Thursday, October 14 Week 7, UML Diagrams

Similar presentations


Presentation on theme: "CSC 520 – Advanced Object Oriented Programming, Fall, 2010 Thursday, October 14 Week 7, UML Diagrams"— Presentation transcript:

1 CSC 520 – Advanced Object Oriented Programming, Fall, 2010 Thursday, October 14 Week 7, UML Diagrams http://edn.embarcadero.com/article/31863

2 UML Class diagrams >, >, > other stereotype Class_or_Interface_Name Generic - privateAttribute1 : p1Type = initialValue # protectedAttribute2 : p2Type ~ packageAttribute3 : p3Type + publicAttribute4 : p4Type + publicStaticAttribute5 : p5Type - privateOperation1(param1 : T1, …) : m1Type # protectedOperation2(param1 : T1, …) : m2Type ~ packageOperation3(param1 : T1, …) : m3Type + publicOperation4 (param1 : T1, …) : m4Type + publicStaticOperation5(param1 : T1, …) : m5Type + publicAbstractOperation(param1 : T1, …) : m6Type {abstract}

3 Generalization, Association, Dependency, Multiplicity, Keywords

4 Sequence Diagram shows sequence of method calls ScrabbleGameScrabbleBoardScrabblePlayerScrabbleScoreSheet move put validateWord validateLetters putWord deleteTiles addScore addEntry addTiles

5 Other Sequence Diagram Options Filled arrow is the synchronous (waiting) call Open arrow is asynchronous (nonblocking) UML 1.4 UML 1.3 Create message starts an object’s lifeline. Delete message ends an objects lifeline. I recommend avoiding conditional control logic and loops in sequence diagrams.

6 Activity Diagram It is like an old-fashioned flowchart. Start End Fork and Join (thick horizontal line) Action, including subdiagrams Vertical or gridded Partitions can be used to divide control across objects or deployed components Again, avoid using every diagramming option.

7 Diagrams similar to Class Diagrams Package Diagram shows package dependencies. Object Diagram shows instantiated objects. Useful for showing example run-time relationships. Give the name of a class object and assign values to attributes. Component Diagram shows software components packaged together. Dynamic link libraries (DLLs), Java Archives (JARs), Server Processes, Frameworks, Plugins, etc. Multiple class objects and data stores per component. Related to deployment diagrams.

8 Deployment Diagrams A 3D box is a Node. A Device is hardware. An Execution Environment is software (process, OS, …). A Node contains Artifacts. Executable files, server processes, plugins, DLLs, JARs, browsers, data files, databases, scripts, etc. I prefer to model Artifacts as Components contained within Nodes. Labeled Communication Paths connect Nodes.

9 Use Case Diagrams Stick Figure Actors with interaction ellipses. Meyer says OK for validation, not for analysis. I find Use Case Text more useful. Write simple narratives. Identify potential Objects, perhaps drawing exemplary Object Diagrams. Nouns, interactions, class-responsibility-collaboration. Capabilities are Meyer’s Deferred Classes (e.g., comparable, cloneable, serializable). Abstract the Objects into Classes.

10 State Diagrams = State Machines States mirror collection of mutable state variables. Initial and final pseudostates for entry and exit. Superstate can be modeled as a substate diagram. Targeted modeling tools can generate code. Transitions between states include triggers (events), guards (booleans) and activities (outputs). Any of these on a given transition is optional. kayakingpaddling drifting current / steer flatwater / paddle c / s f / p dest / stop

11 State Machine Diagrams continued State Diagrams can capture nested, hierarchical behavior. State Diagrams can capture concurrency. Specify state variables as part of machine. Relate these to attributes in Class Diagrams. Use notes. Internal activities list their triggers, guards and actions. They are like self-transitions. Triggers and actions are the I/O of states. Guards are conditional entry booleans. Add a stack to support a pushdown automaton (not part of UML).

12 Deployment Bundle executable files, data sets, scripts, on- line help etc. into a distributable format. JAR file + manifest = stand alone executable. JAR file + HTML + browser = applet. Frameworks support run-time configuration using plugins (games2010rev5, Eclipse). Servers and clients support run-time configuration using plugins, networked distribution, live update, multithreading.

13 Multitiered Enterprise Architectures Beyond the scope of this course Specific systems tend to constrain your perspective. http://download.oracle.com/javaee/ Ajax Web Application Model Web Browser UI Ajax engine Javascript call HTML,CSS,XML data Web Server DB HTTP request Data Query / data request


Download ppt "CSC 520 – Advanced Object Oriented Programming, Fall, 2010 Thursday, October 14 Week 7, UML Diagrams"

Similar presentations


Ads by Google