a simple plugin architecture for wicket

20
Wicket Meetup Amsterdam Nov 2007 A Simple Plugin Architecture for Wicket A Simple Plugin Architecture for Wicket Niels van Kampenhout [email protected] Wander Grevink [email protected]

Upload: nielsvk

Post on 24-May-2015

7.583 views

Category:

Technology


0 download

DESCRIPTION

A simple plugin architecture for the Apache Wicket web application framework, allowing pluggable GUIs.

TRANSCRIPT

Page 1: A Simple Plugin Architecture for Wicket

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

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

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

A Simple Plugin Architecture for Wicket Wicket Meetup Amsterdam Nov 2007

The Use Case

• Hippo CMS

Page 5: A Simple Plugin Architecture for Wicket

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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)