1 / 13

CSC 520 – Advanced Object Oriented Programming, Fall, 2010

CSC 520 – Advanced Object Oriented Programming, Fall, 2010. Thursday, October 14 Week 7, UML Diagrams http://edn.embarcadero.com/article/31863. UML Class diagrams. Generic. <<interface>>, <<abstract>>, <<active>> other stereotype Class_or_Interface_Name.

heckstall
Download Presentation

CSC 520 – Advanced Object Oriented Programming, Fall, 2010

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. 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 Generic <<interface>>, <<abstract>>, <<active>> other stereotype Class_or_Interface_Name • 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 showssequence of method calls ScrabbleGame ScrabbleBoard ScrabblePlayer ScrabbleScoreSheet 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 ExecutionEnvironment 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 CommunicationPaths connect Nodes.

  9. Use Case Diagrams • Stick Figure Actors with interaction ellipses. • Meyer says OK for validation, not for analysis. • I find UseCaseText more useful. • Write simple narratives. • Identify potential Objects, perhaps drawing exemplary ObjectDiagrams. • Nouns, interactions, class-responsibility-collaboration. • Capabilities are Meyer’s DeferredClasses (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. dest / stop kayaking flatwater / paddle paddling f / p c / s drifting dest / stop current / steer

  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 pushdownautomaton (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 Server Web Browser Data Data HTML,CSS,XML data Ajax engine UI DB Javascript call HTTP request Query / data request

More Related