[jboss-user] [JBoss Seam] - Application Layering

David Radunz davidr at utiba.com
Thu Jun 21 21:56:21 EDT 2007


Hi All,

  We are about to cut over to JSF / Seam for our new web framework and 
we need to be able to layer the technology. I can see there being a few 
ways to achieve this, but I am not entirely sure what the best approach 
is. What I mean by layering is to have say a core layer of ejb3 classes 
and XHTML pages/components, then a product layer of ejb3 classes and 
XHTML pages/components and then possibly another layer under that with 
it's own ejb3 classes and XHTML. The idea would be to be able to load a 
specific resource (xhtml or ejb3) using a generic (EL) name, and have 
the appropriate resource loaded from the most defined layer.



For example (ejb3 layering):

Core layer:
    Core/src/org/example/beans/MyBean (annotated with @Name("bean"))

Product layer:
    Product/src/org/example/product/beans/MyBean (annotated with 
@Name("bean"), extends org.example.product.beans.MyBean)

Customised product layer:
    Site/src/org/example/product/site/beans/MyBean (annotated with 
@Name("bean"), extends org.example.product.beans.MyBean)

And simply used in EL (somewhere in the XHTML) as perhaps:

  <h:outputText value="#{bean.item}" />

Which should load the customised product layer instance of MyBean, if 
it's defined - Otherwise the product, then the core.



For example (XHTML layering):

Core layer:
    Core/view/pages/header.xhtml

Product layer:
    Product/view/product/pages/header.xhtml

Customised product layer:
    Site/view/product/site/pages/header.xhtml

And simply used in EL...

    <ui:include src="#{pages.header}"/>


Which should load the customised product layer instance of header.xhtml, 
if it's defined - Otherwise the product, then the core.


   
I have an idea how to implement the XHTML resource loading solution by 
using resource bundles, and layering the resource bundles (as described 
in the internationalisation documentation). However, I want to make both 
approaches consistent and I am not entirely sure what the "best" way to 
do this is. Has anyone faced a similar issue? Is this catered for in the 
framework already? Could I address the issue for the ejb3 sourcing with 
a factory? And if so, could the factory also source other kinds of beans 
than just entity beans..

Thanks for your help,

David

-- 
David Radunz

Senior Perl Developer
Utiba Pty Ltd
ph: +613 9606 0444
ad: Level 6, 190 Queen St, Melbourne, VIC, 3000, Australia

-------------- next part --------------
A non-text attachment was scrubbed...
Name: davidr.vcf
Type: text/x-vcard
Size: 260 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/jboss-user/attachments/20070622/bc262f4a/attachment.vcf 


More information about the jboss-user mailing list