You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by David Meaker <Da...@angelshade.com> on 2001/09/10 16:54:13 UTC

TemplateContext

Hi,
 
I have had a bit of time recently to experiment with Turbine 3.0.  It is
going to be very difficult to go back to developing in 2.1.
 
I came across something which I don't understand and was wondering if I
could trouble 3.0 developers.
 
I came to test the TemplateHtmlEmail class and while trying to compile I
found that the interfaces org.apache.turbine.TemplateContext and
org.apache.fulcrum.template.TemplateContext are incompatible; both define
put(java.lang.String,java.lang.Object), but with different return type.
 
In org.apache.turbine.TemplateContext 
      public java.lang.Object put(java.lang.String key, java.lang.Object
value)
 
In org.apache.fulcrum.template.TemplateContext
    public void put(java.lang.String key, java.lang.Object value)
 
 
Is this correct or is it an error?
 
 
kind regards
 
    Dave Meaker
 
 

Re: TemplateContext

Posted by Jason van Zyl <jv...@apache.org>.
On 9/10/01 2:18 PM, "Jon Stevens" <jo...@latchkey.com> wrote:

> on 9/10/01 8:00 AM, "Jason van Zyl" <jv...@apache.org> wrote:
> 
>> The template interfaces and classes are particularly confusing because they
>> are adaptered in two places. In Fulcrum itself the TemplateService uses a
>> TemplateContext and each of the Template engines supported has an adapter to
>> make its particular context class appear as a TemplateContext that the
>> TemplateService understands and in Turbine we have our own TemplateContext
>> and it is adapted so that the Fulcrum template service can deal with it.
>> 
>> This appears redundant because the projects have just been severed so things
>> definitely appear to be identical in places and they are. But this will not
>> always be the case. I expect Fulcrum, Turbine and Torque to diverge and I
>> hope to protect Turbine from this by defining an independent set of
>> interfaces that Turbine application programmers can use.
> 
> I just hope the added confusion and seemingly duplication is worth it to the
> people who have to use this stuff.

>From the perspective of a turbine application developer there will only be a
TemplateContext and that's it. I believe it will be far simpler for turbine
application programmers. I hope the emphasis will shift away from having to
dig into turbine at a low level in order to achieve an end goal and move
toward the use of a clean API that inherently allows easy extension. And I
hope the TemplateContext is a part of that.
 
> -jon
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-dev-help@jakarta.apache.org

-- 

jvz.

Jason van Zyl

http://tambora.zenplex.org
http://jakarta.apache.org/turbine
http://jakarta.apache.org/velocity
http://jakarta.apache.org/alexandria
http://jakarta.apache.org/commons



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


Re: TemplateContext

Posted by Jon Stevens <jo...@latchkey.com>.
on 9/10/01 8:00 AM, "Jason van Zyl" <jv...@apache.org> wrote:

> The template interfaces and classes are particularly confusing because they
> are adaptered in two places. In Fulcrum itself the TemplateService uses a
> TemplateContext and each of the Template engines supported has an adapter to
> make its particular context class appear as a TemplateContext that the
> TemplateService understands and in Turbine we have our own TemplateContext
> and it is adapted so that the Fulcrum template service can deal with it.
> 
> This appears redundant because the projects have just been severed so things
> definitely appear to be identical in places and they are. But this will not
> always be the case. I expect Fulcrum, Turbine and Torque to diverge and I
> hope to protect Turbine from this by defining an independent set of
> interfaces that Turbine application programmers can use.

I just hope the added confusion and seemingly duplication is worth it to the
people who have to use this stuff.

-jon


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


Re: TemplateContext

Posted by Jason van Zyl <jv...@apache.org>.
On 9/10/01 10:54 AM, "David Meaker" <Da...@angelshade.com> wrote:

> Hi,
> 
> I have had a bit of time recently to experiment with Turbine 3.0.  It is
> going to be very difficult to go back to developing in 2.1.
> 
> I came across something which I don't understand and was wondering if I
> could trouble 3.0 developers.
> 
> I came to test the TemplateHtmlEmail class and while trying to compile I
> found that the interfaces org.apache.turbine.TemplateContext and
> org.apache.fulcrum.template.TemplateContext are incompatible; both define
> put(java.lang.String,java.lang.Object), but with different return type.
> 
> In org.apache.turbine.TemplateContext
>     public java.lang.Object put(java.lang.String key, java.lang.Object
> value)
> 
> In org.apache.fulcrum.template.TemplateContext
>   public void put(java.lang.String key, java.lang.Object value)
> 
> 
> Is this correct or is it an error?

It is correct.

For Turbine 3.0 we hope to arrive at an API which consists of a set of
interfaces that are wholly decoupled from any tools which turbine might use.

We have had a few discussions about this, in particular why some of the
turbine interfaces don't extend Fulcrum interfaces or Torque interfaces for
example. It basically boils down to not tying the development cycles of
different projects together. Right now Turbine, Fulcrum and Torque are still
more or less one project even though they exist in different repositories.
But their development cycles may change entirely at some point. I'd like to
try and keep any changes in base tools like Fulcrum from affecting Turbine
application code. Daniel Rall asked for my reasons and I responded so I will
try to dig that up and put it in an xdoc.

The template interfaces and classes are particularly confusing because they
are adaptered in two places. In Fulcrum itself the TemplateService uses a
TemplateContext and each of the Template engines supported has an adapter to
make its particular context class appear as a TemplateContext that the
TemplateService understands and in Turbine we have our own TemplateContext
and it is adapted so that the Fulcrum template service can deal with it.

This appears redundant because the projects have just been severed so things
definitely appear to be identical in places and they are. But this will not
always be the case. I expect Fulcrum, Turbine and Torque to diverge and I
hope to protect Turbine from this by defining an independent set of
interfaces that Turbine application programmers can use.
 
> 
> kind regards
> 
>   Dave Meaker
> 
> 
> 

-- 

jvz.

Jason van Zyl

http://tambora.zenplex.org
http://jakarta.apache.org/turbine
http://jakarta.apache.org/velocity
http://jakarta.apache.org/alexandria
http://jakarta.apache.org/commons



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