13
Com S 362: Object-Oriented Analysis and Design From Design To Code

Com S 362: Object-Oriented Analysis and Design From Design To Code

Embed Size (px)

Citation preview

Page 1: Com S 362: Object-Oriented Analysis and Design From Design To Code

Com S 362: Object-Oriented Analysis and Design

From Design To Code

Page 2: Com S 362: Object-Oriented Analysis and Design From Design To Code

2 Com S 362: Object-Oriented Analysis and Design

2

Com S 362: Object-Oriented Analysis and Design

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

Page 3: Com S 362: Object-Oriented Analysis and Design From Design To Code

3 Com S 362: Object-Oriented Analysis and Design

3

Com S 362: Object-Oriented Analysis and Design

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

Page 4: Com S 362: Object-Oriented Analysis and Design From Design To Code

4 Com S 362: Object-Oriented Analysis and Design

4

Com S 362: Object-Oriented Analysis and Design

Recap: Responsibility Assignment Information Expert Creator Controller Polymorphism Pure Fabrication Indirection Protected Variations

Page 5: Com S 362: Object-Oriented Analysis and Design From Design To Code

5 Com S 362: Object-Oriented Analysis and Design

5

Com S 362: Object-Oriented Analysis and Design

Today’s Lecture Code generation

From class and interaction diagrams ArgoUML

Drawing package, class, and interaction diagrams

Generating code from these diagrams

Page 6: Com S 362: Object-Oriented Analysis and Design From Design To Code

6 Com S 362: Object-Oriented Analysis and Design

6

Com S 362: Object-Oriented Analysis and Design

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

Page 7: Com S 362: Object-Oriented Analysis and Design From Design To Code

7 Com S 362: Object-Oriented Analysis and Design

7

Com S 362: Object-Oriented Analysis and Design

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

Page 8: Com S 362: Object-Oriented Analysis and Design From Design To Code

8 Com S 362: Object-Oriented Analysis and Design

8

Com S 362: Object-Oriented Analysis and Design

Poseidon: Commercial variant of ArgoUML Community edition available for free (after registration)

http://www.cs.iastate.edu/~cs362/tools/poseidonCE-4.2.1.zip

Page 9: Com S 362: Object-Oriented Analysis and Design From Design To Code

9 Com S 362: Object-Oriented Analysis and Design

9

Com S 362: Object-Oriented Analysis and Design

Rational Modeler Available on CS machines

csts2.cs.iastate.edu

csts4.cs.iastate.edu

Page 10: Com S 362: Object-Oriented Analysis and Design From Design To Code

10 Com S 362: Object-Oriented Analysis and Design

10

Com S 362: Object-Oriented Analysis and Design

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”

Page 11: Com S 362: Object-Oriented Analysis and Design From Design To Code

11 Com S 362: Object-Oriented Analysis and Design

11

Com S 362: Object-Oriented Analysis and 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

Page 12: Com S 362: Object-Oriented Analysis and Design From Design To Code

12 Com S 362: Object-Oriented Analysis and Design

12

Com S 362: Object-Oriented Analysis and Design

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

Page 13: Com S 362: Object-Oriented Analysis and Design From Design To Code

13 Com S 362: Object-Oriented Analysis and Design

13

Com S 362: Object-Oriented Analysis and Design