1 / 15

Design Pattern Support for BlueJ

Proven solutions to commonly occurring problems, encourage good designs, capture reusable experience, provide insights into the Java API.

Download Presentation

Design Pattern Support for BlueJ

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. Design Pattern Support for BlueJ Michael Nairn (Bell) Jim Paterson (GCU) John Haddow (Bell)

  2. Design Patterns • Proven solutions to commonly occurring problems. • Encourage good designs. • Capture experience which can be reused by others. • Provide insights into the Java API.

  3. Design Patterns Extension for BlueJ • Encapsulate knowledge of design patterns. • Allow the selection of different design patterns • Allow interaction during the creation of the pattern. • Add the pattern to the current project. • Allow students to solve problems using design patterns. • Expandable, allowing the addition and modification of pattern files.

  4. Using the Extension Information about the design pattern. Choose pattern to adopt. Image of pattern in BlueJ.

  5. Using the Extension Rename component option. Information about individual components role in the pattern.

  6. Using the Extension

  7. Inspecting the Pattern in BlueJ Operation method of the DarkRoast object Result of DarkRoast operation displayed in terminal

  8. Inspecting the Pattern in BlueJ Operation of the MilkDecorator object Inspection of the MilkDecorator object New MilkDecorator object created with the DarkRoast object Result of operation now shows added behaviour, as well as original. Inspection shows that the MilkDecorator has an attribute that it Decorates.

  9. Modification of a problem

  10. Creating your own patterns • Patterns defined as XML files and class templates • Each pattern described by one XML file with three main sections: • Basic pattern description • Pattern components • Wizard steps • Each component class is based on a template with placeholders for names of the class and dependants

  11. Pattern description <?xml version="1.0"?> <pattern patternName="Decorator" patternImage="decorator.bmp"> <patternDescription> <![CDATA[ Description of decorator pattern]]> </patternDescription> ...

  12. Pattern components <class classId="3" compType="Decorator" defaultName="Decorator" classDescription=”Description” classTemplate="Decorator/Decorator.TMPL"> <dependantClass value="1"/> </class> ...

  13. Wizard steps <wizard> <step stepId="1" type="class" compId="1" nextStepId="2" previousStepId="" stepName="Rename Component" stepDesc="Use the text field to enter a relevant name for the Component class."> </step> ... </wizard>

  14. Class template public class $CLASSNAME implements $DEPENDANT1 { protected $DEPENDANT1 component; public $CLASSNAME($DEPENDANT1 component) { this.component = component; } ...

  15. Please try it out Extension, source and documentation can be found at: http://hamilton.bell.ac.uk/designpatterns/ This project has been supported by the Bell College Research Grants Fund

More Related