From Design To Code
E N D
Presentation Transcript
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
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
Recap: Responsibility Assignment • Information Expert • Creator • Controller • Polymorphism • Pure Fabrication • Indirection • Protected Variations
Today’s Lecture • Code generation • From class and interaction diagrams • ArgoUML • Drawing package, class, and interaction diagrams • Generating code from these diagrams
ArgoUML • Open source design tool • Available for free: http://argouml.tigris.org/ • Use case, class, sequence diagrams • Collaboration, statechart, activity diagrams • Auto-generate Code Skeleton
Installing ArgoUML • Get latest release from: http://argouml-downloads.tigris.org/argouml-0.23.1 also from: http://www.cs.iastate.edu/~cs362/tools/ArgoUML.zip • Unzip the distribution • Run argouml.jar • ArgoUML Demo… • Class diagrams in ArgoUML • Associations in ArgoUML • Generating code from class diagram in ArgoUML
Poseidon: Commercial variant of ArgoUML • Community edition available for free (after registration) http://www.cs.iastate.edu/~cs362/tools/poseidonCE-4.2.1.zip
Rational Modeler • Available on CS machines csts2.cs.iastate.edu csts4.cs.iastate.edu
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”
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
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