1 / 34

GROUP #

GROUP #. 13. Code Generation with Design Patterns. THIS PRESENTATION DIFFERENT. WHAT’S ANNOYING ABOUT DESIGN PATTERNS?. HOW WE CAN ADDRESS THIS!. WHAT IS NOT FUN ABOUT DESIGN PATTERNS?. HAVING TO CODE THEM OVER AND OVER!!. ALL THE “MONKEY BUSINESS”!!!!. pretty much same code over

ria-le
Download Presentation

GROUP #

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. GROUP # 13

  2. Code Generation with Design Patterns

  3. THIS PRESENTATION DIFFERENT WHAT’S ANNOYING ABOUT DESIGN PATTERNS? HOW WE CAN ADDRESS THIS!

  4. WHAT IS NOT FUN ABOUT DESIGN PATTERNS? HAVING TO CODE THEM OVER AND OVER!!

  5. ALL THE “MONKEY BUSINESS”!!!! pretty much same code over and over names change key principles don’t NO MORE MONKEY BUSINESS!!!!!* * may not eliminate all monkey business

  6. What are Design Patterns • Capture expertise • Proven, general solution • Rationale • Implementation freedom • Deeper understanding • Names form a vocabulary

  7. Representing Design Patterns • How can we represent design patterns to aid in code generation? • Must learn how to: • Discover and recognize them • Represent and apply them

  8. Design Pattern Format 1. Name 2. Intent 3. Also Known As 4. Motivation 5. Applicability 6. Structure 7. Participants

  9. Design Pattern Format 8. Collaborations 9. Consequences 10. Implementation 11. Sample Code 12. Known Uses 13. Related Patterns

  10. Problems with Design Patterns • Pattern writing takes time • Most examples are in Smalltalk or C++ • They are not code Patterns don't generate anything —people do!

  11. Why are Design Patterns important? • Communicate design knowledge • Build consensus • Promote thought rather than action • Work with awareness • Allow potential for design re-use

  12. Automatic Code Generation • Motivations • Steps for automatic code generation • Section Pages • Code Generation Page • Generating Declarations • Choosing Trade-offs • Other Generation Options

  13. Motivations • design pattern describes the system but does not provide any code • Want a tool to translate design patterns into useful code • The automatic code generation tool will create all the declarations and definitions from the design pattern for the code

  14. Steps for Automatic Code Generation with the Tool • Section Pages • Code Generation Page • Generating Declarations • Choosing Trade-offs • Other Options

  15. Section pages • Tool will display the design patterns in different pages • Intent section: describes the purpose of the design pattern • Motivation section: describes the design of the system

  16. Intent Section

  17. Motivation Section

  18. Code Generation Page • Allows the user to enter information to generate a custom implementation of the design pattern • Fields to define the names for the pattern participants

  19. Code Generation Page

  20. Generating Declarations • Shows the generated classes defined in the design pattern • Classes are generated from the design pattern described • Can be customized by setting the trade-offs

  21. Generating Declarations

  22. Choosing Trade-offs • Allows the user to select specific trade-offs for the pattern specified (optional) • Specifies how the different classes can interact with each other • Chooses where the operations are declared

  23. Choosing Trade-offs

  24. Other Generation Options • Allows user to control other generation parameters • Examples: • Include standard C++ operations • Generate execution trace in the operation • Limit file names to a certain size • Include a main testing routine in the class

  25. Automate Code Generation

  26. System Architecture • Tool Designer Goals • Tool User Goals • Characteristics • Examples

  27. Tool Designers Goals • Fast turn around time • Flexible system • Ability to interpret what the user wants

  28. Tool User Goals • Useful and easy • Accessibility to an integrated information source on design patterns • Easy feedback mechanism • Ability to adapt code (design) to change

  29. Characteristics of a Tool • Reuses aspects from other tools and systems • Make thorough use of the information provided by the user • Modularized design

  30. Example of “IBM” Tool

  31. Example of “Threshold Computer Systems” Solution • Recognize patterns • Build a pattern language in XML • Move from XML to implementation language (Java, C++, etc.)

  32. Automagic Code Generation with Design Patterns Looked at: Design Patterns in General A tool that might help cut the “monkey business” How such tools work Which in the future means: More time designing, less time coding! NO MORE MONKEY BUSINESS!* *some monkey business may be necessary. your mileage will vary.

  33. Know Your Last 485 Presentation! FIRST QUESTION: What isn’t fun about design patterns? SECOND QUESTION: Name two qualities in a design pattern code generation tool that users want. THIRD QUESTION: Name two options that a code generation tool has that a user can use to customize code implementation FOURTH QUESTION (FINAL QUESTION): How long did it take to create 23 design patterns?

  34. REFERENCES www.research.ibm.com/journal/sj/352/budinsky.html http://studwww.rug.ac.be/~wbossart/ao/gen.pdf http://researchweb.watson.ibm.com/designpatterns/pubs/top10misc.pdf www.research.ibm.com/designpatterns/pubs/codegen.pdf www.qwan.com/AboutUs/generatePatternsUsingXml.pdf SUPPLIES LIMITED, ORDER NOW!!!

More Related