Software Reality
Programming with
a dose of satire.

Site Map Search


Agile Development
 
Extreme Programming
 
Code Generation


Articles
Lifecycle
Design
Programming
Soapbox
Reviews
Cthulhu

Check out our ageing Reviews Section


Use Case Driven
Use Case Driven Object Modeling with UML: Theory and Practice
Get from use cases to working, maintainable source code. Examples use Spring Framework, JUnit and Enterprise Architect

Agile UML
Agile Development with ICONIX Process
A practical subset of agile development techniques, illustrated by example

Get Controversial!
Extreme Programming Refactored
Extreme Programming with a dose of satire
Available now:



ICONIX/Sparx Public Classes to Come to London

ICONIX is planning a series of open- enrollment public classes entitled Hands-On Enterprise Architect for Power Users in collaboration with Sparx Systems.




Slots Web Framework

Slots Example

<< Slots Central

 

slots-config.properties

# default defines the base (template definition) if no other is defined for a page
default=colorbase

# here we define a base called base(!), the page layout define in /base.jsp
# note how the title slot is set to a static string
# $WEBROOT is the name of the web context i.e. request.getContextPath()
base=base=/base.jsp,header=/header.jsp,leftnav=/leftnav.jsp,title="Base title",css="/$WEBROOT/default.css"

# here is another base, so far only used by /test4.jsp
# this time the title is set to the contents of /title.jsp
custombase=base=/custombase.jsp,header=/header2.jsp,leftnav=/leftnav.jsp,title=/title.jsp

# This is popular base, due to the fact that it has been defined as the default base
# so when accessing /test1.jsp or some other page with no specific entry we get to use this base
colorbase=base=/base_color.jsp,header=/header2.jsp,leftnav=/leftnav.jsp,title="My Page!!!"

# Here is another base, this time subclassing base and altering title and leftnav, but keeping css and header
# The slash in the basename has no meaning, just there for descriptive purposes
base/basesubclass=base=base,title="I am a subclass base",leftnav=/leftnav.jsp

# And this base subclasses base/basesubclass, just to show that you can do N deep inheritance
basesubclass2=base=base/basesubclass,title="I am a subclass2",header="Not much here",css="/$WEBROOT/mycss1.css"

# Useful for when you want page definitions that don't have decorations, just slot values that are used in the page itself
# See /leftnav.jsp and /leftnav2.jsp
emptybase=base=/emptybase.jsp

# This is a fake index page, i.e. when you ask for /index.jsp you are in fact given /test1.jsp
# Of course this is decorated with the default base
/index.jsp=content=/test1.jsp

# This entry does not define a base, so uses the default base, but replaces a couple of slots
# Note that the leftnav is in fact another slot decorated page, not just raw jsp
/test3.jsp=header=/header.jsp,title="Hello there!!!",leftnav=/slot/leftnav.jsp

# This is another page that doesn't exist, but serves up different slots than /test3.jsp above
/test3_2.jsp=header=/header.jsp,title="test3_2",leftnav=/slot/leftnav2.jsp,content=/test3.jsp

# This is the only page that uses custombase
/test4.jsp=base=custombase,title="TEST 4"

# /test5.jsp does exist as a page, but we serve up another page
# we also use basesubclass2, which has 3 levels deep inhertance
/test5.jsp=base=basesubclass2,content=/test5_shadow.jsp

# We do 2 things here, inherit from another page definition (not directly from a base), and alter the css
/test5_mycss2.jsp=base=/test5.jsp,content=/test5.jsp,css="/$WEBROOT/mycss2.css"

# Here we say that every page under /subdirectory (and recursively) should uses these slot definitions
/subdirectory=title="In /subdirectory",css="/$WEBROOT/mycss2.css",base=basesubclass2

# A page that doesn't exist, even in terms of another page.
/test6.jsp=content="I don't really exist"

# Here we have definitions that are included elsewhere as slot values
/leftnav.jsp=leftnavtitle="leftnav.jsp",base=emptybase
/leftnav2.jsp=leftnavtitle="leftnav2.jsp",base=emptybase,content=/leftnav.jsp

 

<< Slots Central

<< Software Reality Front Page

 

All trademarks and copyrights on this page are owned by their respective owners.
Stories and articles are owned by the original author.
All the rest Copyright © 1998-2007 Matt Stephens. ALL RIGHTS RESERVED.