Skip to main content
HOW TO MAKE A
 FRAMEWORK PLUGIN
THAT DOES NOT SUCK
       by Max Rydahl Andersen, Red Hat
WHICH OF THESE ARE
   FRAMEWORK PLUGINS ?
• Hibernate Tools           • Seam Tools
• Eclipse   JDT             • SpringIDE
• JUnit   Plugin            • TestNG Plugin
• Apache Ant       Plugin   • CVS Plugin
• SVN     Plugin            • Eclipse CDT
• GEF                       • DroolsIDE
TYPICAL KEY FUNCTIONS
•   Provide support for a (Java) framework

•   To be used by new and seasoned developers

•   Setup of Libraries/Dependencies

•   Wizards to Create Artifacts

•   Editors for artifacts with code completion

•   “Compile/Validate”

•   Navigate between artifacts

•   Refactoring
FRAMEWORK PLUGINS
• Hibernate Tools           • Seam Tools
• Eclipse   JDT             • SpringIDE
• JUnit   Plugin            • TestNG Plugin
• Apache Ant       Plugin   • CVS Plugin
• SVN     Plugin            • Eclipse CDT
• GEF                       • DroolsIDE
DEVELOPERS, DEVELOPERS,
     DEVELOPERS, ...
DEVELOPERS, DEVELOPERS,
     DEVELOPERS, ...
                                       ...are lazy
                             ...don’t read docs
                     ...are not working alone
       ...uses more than just one framework
HOW DO
   WE SUPPORT
 LAZY DEVELOPERS
THAT DOESN’T READ ?
DEFAULTS BASED ON
CURRENT SELECTION
DEFAULTS BASED ON
  CURRENT SELECTION


       s !
   c k
S u
HOW DO
     WE SUPPORT
     DEVELOPERS
      THAT USES
MULTIPLE FRAMEWORKS ?
s !
   c k
S u
s !
   c k
S u
s !
   c k
S u         S uc ks !
GOING BEYOND NATURES
• Natures    are “stupid markers” and require custom UI

• Facets
       are an API to provide unified enablement and
 configuration of frameworks

•Iview Facets as installer/uninstaller of Natures + standardized
 Configuration UI

• Facet’s   have been around since 2006 (Scary!)

• Start   use them!
FACET USER INTERFACE
FACET USER INTERFACE
‘N’-RUNTIMES
‘N’-RUNTIMES
        s !
  c k
Su
‘N’-RUNTIMES
        s !
  c k
Su
NAVEL-GAZING CLASSPATH
      CONTAINERS
NAVEL-GAZING CLASSPATH

           !
      CONTAINERS
         s
   c k
S u
NAVEL-GAZING CLASSPATH

           !
      CONTAINERS
         s
   c k
S u
NAVEL-GAZING CLASSPATH
      CONTAINERS
                s !
   c k
S u
   Consider integrating with Maven...
PRACTICE RELATIVITY




Folders/Files should be defined relative to a “root”
          Avoid hard coded names/paths
             Use logical names instead
   Make sure sharable settings are storable in a
                      project...
BECAUSE THEN YOU ARE
SUPPORTING DEVELOPERS
THAT WORK WITH OTHER
   DEVELOPERS, AND...
...YOUR PLUGIN WILL NOT
               SUCK!
       ...because you are implementing the key functionalities
...you use selections and good defaults so users doesn’t have
                   to think, type or read (too much)
       ...you use the configure menu and/or facets to provide
                  consistent UI for framework setup
...you support multiple runtimes to allow use of old and new
    ...you use relative settings to allow for shareable projects/
                         configuration in teams
...YOUR PLUGIN WILL NOT
               SUCK!
       ...because you are implementing the key functionalities
...you use selections and good defaults so users doesn’t have
                   to think, type or read (too much)
       ...you use the configure menu and/or facets to provide
                  consistent UI for framework setup
...you support multiple runtimes to allow use of old and new
    ...you use relative settings to allow for shareable projects/
                         configuration in teams
RELATED LINKS

    How to report bugs effectively http://bit.ly/cbUW9d
             Eclipse Facets Tutorial http://bit.ly/aEf1am



Navel Gazing Classpath Containers http://bit.ly/9q0h7S
            Eclipse 2009 Long talk http://bit.ly/cxy61Q
QUESTIONS ?

Up Next in Steven’s Creek:
     Pimp My
    Bug Report

                        • http://in.relation.to/Bloggers/Max

                        • http://twitter.com/maxandersen

                        • http://twitter.com/jbosstools