You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hivemind.apache.org by "Hensley, Richard" <Ri...@McKesson.com> on 2004/07/14 20:50:36 UTC

Tapestry Integration Best Practice Advise

I seeking best practice advise for using HiveMind in a Tapestry application.

This is my design so far:

I'm using the HiveMindFilter to initialize the registry.

I overrode createGlobal() in my engine to do the following:
    protected Object createGlobal(RequestContext arg0) {
        Global global = (Global) super.createGlobal(arg0);
        global.setRegistry(HiveMindFilter.getRegistry(arg0.getRequest()));
        return global;
    }

My global object has getXXX methods for all the services that I might need.
They are implemented something like:

    public Census getCensus() {
        return (Census) this.registry.getService(Census.class.getName(),
                Census.class);
    }

And my service definition is:

module (id=com.mckesson.lab.services version="1.0.0")
{
  service-point (id=Census interface=com.mckesson.lab.services.Census)
}

I have an interfaces jar that contains nothing but interface declarations
and the HiveMind service point declarations.

I have an implementation jar that contains all the implementation classes
and the HiveMind service point implementation declarations.

I'm fairly new to the use of a IoC container, so I could be all wet in this
design.

Any comments would be most appreciated.

Richard


---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


Re: Tapestry Integration Best Practice Advise

Posted by Howard Lewis Ship <hl...@gmail.com>.
Obviously, Tapestry 3.1 will have a very well intergrated approach.

What I'm doing is to use the HiveMindFilter around my Tapestry
application servlet.

I use a common base class for all my pages, that defines a registry property.

I created an OGNL PropertyAccessor that allows the following syntax:

  <property-specification name="portalController"
type="portal.services.PortalController">
    page.registry['portal.PortalController']
  </property-specification> 

In this way, I can access a HiveMind service as a page property.

The code for this is just a few lines, but I'll have to check with my
client to get the OK to post it publically.


On Wed, 14 Jul 2004 14:50:36 -0400, Hensley, Richard
<ri...@mckesson.com> wrote:
> I seeking best practice advise for using HiveMind in a Tapestry application.
> 
> This is my design so far:
> 
> I'm using the HiveMindFilter to initialize the registry.
> 
> I overrode createGlobal() in my engine to do the following:
>     protected Object createGlobal(RequestContext arg0) {
>         Global global = (Global) super.createGlobal(arg0);
>         global.setRegistry(HiveMindFilter.getRegistry(arg0.getRequest()));
>         return global;
>     }
> 
> My global object has getXXX methods for all the services that I might need.
> They are implemented something like:
> 
>     public Census getCensus() {
>         return (Census) this.registry.getService(Census.class.getName(),
>                 Census.class);
>     }
> 
> And my service definition is:
> 
> module (id=com.mckesson.lab.services version="1.0.0")
> {
>   service-point (id=Census interface=com.mckesson.lab.services.Census)
> }
> 
> I have an interfaces jar that contains nothing but interface declarations
> and the HiveMind service point declarations.
> 
> I have an implementation jar that contains all the implementation classes
> and the HiveMind service point implementation declarations.
> 
> I'm fairly new to the use of a IoC container, so I could be all wet in this
> design.
> 
> Any comments would be most appreciated.
> 
> Richard
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
> 
> 


-- 
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org