Com S 362: Object-Oriented Analysis and Design From Design To Code
Com S 362: Object-Oriented Analysis and Design 2 2 Recap: Class Diagrams Class diagrams represent design structure Three parts: name, attribute, operations Visibility, attribute type, multiplicity Association, association multiplicity Generalization i.e. interface impl, subclassing Composition i.e. class A contains class B Applied information hiding, DSM, layering
Com S 362: Object-Oriented Analysis and Design 3 3 Recap: Interaction Diagrams Represent functionality Two major parts: Life line boxes (represent life time of an object) Messages between objects (instances) Also looked at some special case notations Instances: parameterized instances, singleton instances, array elements Messages: creation, destruction, conditional messages, mutually exclusive conditional messages, asynchronous messages, polymorphic messages Abstractions: looping, iteration over collection, nesting of frames, decomposition
Com S 362: Object-Oriented Analysis and Design 4 4 Recap: Responsibility Assignment Information Expert Creator Controller Polymorphism Pure Fabrication Indirection Protected Variations
Com S 362: Object-Oriented Analysis and Design 5 5 Today’s Lecture Code generation From class and interaction diagrams ArgoUML Drawing package, class, and interaction diagrams Generating code from these diagrams
Com S 362: Object-Oriented Analysis and Design 6 6 ArgoUML Open source design tool Available for free: Use case, class, sequence diagrams Collaboration, statechart, activity diagrams Auto-generate Code Skeleton
Com S 362: Object-Oriented Analysis and Design 7 7 Installing ArgoUML Get latest release from: also from: Unzip the distribution Run argouml.jar ArgoUML Demo… Class diagrams in ArgoUML Associations in ArgoUML Generating code from class diagram in ArgoUML
Com S 362: Object-Oriented Analysis and Design 8 8 Poseidon: Commercial variant of ArgoUML Community edition available for free (after registration)
Com S 362: Object-Oriented Analysis and Design 9 9 Rational Modeler Available on CS machines csts2.cs.iastate.edu csts4.cs.iastate.edu
Com S 362: Object-Oriented Analysis and Design 10 Com S 362: Object-Oriented Analysis and Design 10 Discussion Tools such as ArgoUML show that – Significant portion of code can be auto-generated Only the intellectually challenging part of coding left for developer “It pays to design”
Com S 362: Object-Oriented Analysis and Design 11 Com S 362: Object-Oriented Analysis and Design 11 What about UI Design? Tools such as Visual Studio Automate code generation from GUI design Tools such as Dreamweaver Automate HTML (again some form of code) from the web-page design Artist can focus on domain concepts such as layout and content
Com S 362: Object-Oriented Analysis and Design 12 Com S 362: Object-Oriented Analysis and Design 12 Additional Exercise Look up: Generative programming A whole new research area about auto- generation of source code Also, program transformation The holy grail is to allow developers to program in terms of domain concepts
Com S 362: Object-Oriented Analysis and Design 13 Com S 362: Object-Oriented Analysis and Design 13