A Simple Plugin Architecture for Wicket
-
Upload
nielsvk -
Category
Technology
-
view
7.579 -
download
0
description
Transcript of A Simple Plugin Architecture for Wicket
![Page 1: A Simple Plugin Architecture for Wicket](https://reader036.fdocuments.us/reader036/viewer/2022081512/5561e727d8b42ab1068b4f60/html5/thumbnails/1.jpg)
Wicket Meetup Amsterdam Nov 2007A Simple Plugin Architecture for Wicket
A Simple Plugin Architecture for
WicketNiels van Kampenhout [email protected] Grevink [email protected]
![Page 2: A Simple Plugin Architecture for Wicket](https://reader036.fdocuments.us/reader036/viewer/2022081512/5561e727d8b42ab1068b4f60/html5/thumbnails/2.jpg)
A Simple Plugin Architecture for Wicket Wicket Meetup Amsterdam Nov 2007
The Intro
• Wicket newbies
• Easy to do cool things with Wicket
• We like feedback!
http://flickr.com/photos/openthreads/234957983/
![Page 3: A Simple Plugin Architecture for Wicket](https://reader036.fdocuments.us/reader036/viewer/2022081512/5561e727d8b42ab1068b4f60/html5/thumbnails/3.jpg)
A Simple Plugin Architecture for Wicket Wicket Meetup Amsterdam Nov 2007
The Dream
• A pluggable GUI
http://flickr.com/photos/gilest/123760608/
![Page 4: A Simple Plugin Architecture for Wicket](https://reader036.fdocuments.us/reader036/viewer/2022081512/5561e727d8b42ab1068b4f60/html5/thumbnails/4.jpg)
A Simple Plugin Architecture for Wicket Wicket Meetup Amsterdam Nov 2007
The Use Case
• Hippo CMS
![Page 5: A Simple Plugin Architecture for Wicket](https://reader036.fdocuments.us/reader036/viewer/2022081512/5561e727d8b42ab1068b4f60/html5/thumbnails/5.jpg)
A Simple Plugin Architecture for Wicket Wicket Meetup Amsterdam Nov 2007
The Use Case
• Open architecture
• Easily customizable, extendible
• But people want more...!
![Page 6: A Simple Plugin Architecture for Wicket](https://reader036.fdocuments.us/reader036/viewer/2022081512/5561e727d8b42ab1068b4f60/html5/thumbnails/6.jpg)
A Simple Plugin Architecture for Wicket Wicket Meetup Amsterdam Nov 2007
The Problem
• Poor customizability on GUI level
• Changing and recompiling core code necessary
http://flickr.com/photos/antware/1749436733/
![Page 7: A Simple Plugin Architecture for Wicket](https://reader036.fdocuments.us/reader036/viewer/2022081512/5561e727d8b42ab1068b4f60/html5/thumbnails/7.jpg)
A Simple Plugin Architecture for Wicket Wicket Meetup Amsterdam Nov 2007
The Problem
• Many similar but slightlydifferent applications
• Copy paste
• Forks
http://flickr.com/photos/eqqman/454920412/
![Page 8: A Simple Plugin Architecture for Wicket](https://reader036.fdocuments.us/reader036/viewer/2022081512/5561e727d8b42ab1068b4f60/html5/thumbnails/8.jpg)
A Simple Plugin Architecture for Wicket Wicket Meetup Amsterdam Nov 2007
The Problem
• Maintenance hell
• Support hell
http://flickr.com/photos/eqqman/54508927/
![Page 9: A Simple Plugin Architecture for Wicket](https://reader036.fdocuments.us/reader036/viewer/2022081512/5561e727d8b42ab1068b4f60/html5/thumbnails/9.jpg)
A Simple Plugin Architecture for Wicket Wicket Meetup Amsterdam Nov 2007
The Solution
• Generic platform
• Building blocks
http://flickr.com/photos/chris-fritz/2011872018/
![Page 10: A Simple Plugin Architecture for Wicket](https://reader036.fdocuments.us/reader036/viewer/2022081512/5561e727d8b42ab1068b4f60/html5/thumbnails/10.jpg)
A Simple Plugin Architecture for Wicket Wicket Meetup Amsterdam Nov 2007
The Solution
• Hippo CMS is just one possible configuration of plugins
http://flickr.com/photos/17271969@N00/16402704/
![Page 11: A Simple Plugin Architecture for Wicket](https://reader036.fdocuments.us/reader036/viewer/2022081512/5561e727d8b42ab1068b4f60/html5/thumbnails/11.jpg)
A Simple Plugin Architecture for Wicket Wicket Meetup Amsterdam Nov 2007
The Solution
• You can adapt the configuration to your needs
http://flickr.com/photos/cryptic/294614661/
![Page 12: A Simple Plugin Architecture for Wicket](https://reader036.fdocuments.us/reader036/viewer/2022081512/5561e727d8b42ab1068b4f60/html5/thumbnails/12.jpg)
A Simple Plugin Architecture for Wicket Wicket Meetup Amsterdam Nov 2007
The Solution
• Any other configuration of plugins is also possible
http://flickr.com/photos/liquidx/594302659/
![Page 13: A Simple Plugin Architecture for Wicket](https://reader036.fdocuments.us/reader036/viewer/2022081512/5561e727d8b42ab1068b4f60/html5/thumbnails/13.jpg)
A Simple Plugin Architecture for Wicket Wicket Meetup Amsterdam Nov 2007
The Tool
• Wicket
http://flickr.com/photos/lifeasart/361147812/
![Page 14: A Simple Plugin Architecture for Wicket](https://reader036.fdocuments.us/reader036/viewer/2022081512/5561e727d8b42ab1068b4f60/html5/thumbnails/14.jpg)
A Simple Plugin Architecture for Wicket Wicket Meetup Amsterdam Nov 2007
The Implementation
• Prototype
http://flickr.com/photos/bootload/439400044/
![Page 15: A Simple Plugin Architecture for Wicket](https://reader036.fdocuments.us/reader036/viewer/2022081512/5561e727d8b42ab1068b4f60/html5/thumbnails/15.jpg)
A Simple Plugin Architecture for Wicket Wicket Meetup Amsterdam Nov 2007
A Wicket page
public RootPanel() {add(“list”, new ListPanel());add(“tree”, new TreePanel());add(“custom”, new SimplePanel());
}
![Page 16: A Simple Plugin Architecture for Wicket](https://reader036.fdocuments.us/reader036/viewer/2022081512/5561e727d8b42ab1068b4f60/html5/thumbnails/16.jpg)
A Simple Plugin Architecture for Wicket Wicket Meetup Amsterdam Nov 2007
A Wicket page using plugins
public RootPlugin() {}
ConfigurationConfiguration
root: class = org.example.RootPlugin children = {list, tree, custom}list: class = org.example.listPlugin children = {}custom: class = org.example.simplePlugin children = {}tree: [...]
![Page 17: A Simple Plugin Architecture for Wicket](https://reader036.fdocuments.us/reader036/viewer/2022081512/5561e727d8b42ab1068b4f60/html5/thumbnails/17.jpg)
A Simple Plugin Architecture for Wicket Wicket Meetup Amsterdam Nov 2007
Plugin configuration
• Data driven
• Any data store, implement simple interface.
• JCR repository (Jackrabbit)
• Static
• Initial page setup
• An application is an assembly of plugins
• Dynamic
• Change plugin configuration at runtime
• Can be triggered by any runtime condition
![Page 18: A Simple Plugin Architecture for Wicket](https://reader036.fdocuments.us/reader036/viewer/2022081512/5561e727d8b42ab1068b4f60/html5/thumbnails/18.jpg)
A Simple Plugin Architecture for Wicket Wicket Meetup Amsterdam Nov 2007
Global picture
• A library of Plugins
• Plugins are specialized Panels
• Plugins are packaged in separate jars
• Tiny core
• Reads plugin configuration
• Loads and assembles plugins
• Manages inter-plugin communication (event based)
• Core model classes
• Abstract base classes for common GUI elements
![Page 19: A Simple Plugin Architecture for Wicket](https://reader036.fdocuments.us/reader036/viewer/2022081512/5561e727d8b42ab1068b4f60/html5/thumbnails/19.jpg)
A Simple Plugin Architecture for Wicket Wicket Meetup Amsterdam Nov 2007
What's next
• Load plugins from configuration data store
• Jackrabbit repository classloader
• Wicket upload plugin plugin
• Add or change plugins at runtime
![Page 20: A Simple Plugin Architecture for Wicket](https://reader036.fdocuments.us/reader036/viewer/2022081512/5561e727d8b42ab1068b4f60/html5/thumbnails/20.jpg)
A Simple Plugin Architecture for Wicket Wicket Meetup Amsterdam Nov 2007
Demo
• Change plugin configuration at runtime
• Manually by filling in a form
• Triggered by a runtime condition (user credentials)