I normally just lurk on this list, but since you're asking about Barracuda,
I'll try to explain.
> The main difference between Turbine and Barracuda that I read
> about on the website seems to be the choice between Velocity
> or XMLC2
Hmm...yes and no. Its not so much a difference between template engines, as
it is a difference between template engine _paradigms_. Most template
engines (and I believe this includes Velocity) allow you to embed logic in
the template, usually by way of a scripting language. The XMLC approach (and
it hasn't changed between version 1 and 2, btw) is to compile a template
document to a Java object that can be manipulated programatically using the
DOM interfaces.
In the traditional template approach, you're manipulating the template from
within the template; in the DOM template approach, you're manipulating the
template externally from servlet code. Fans of XMLC will argue this yields
better seperation of code from content.
Now, while I think XMLC is great technology, I still think there are some
problems with it. First, the DOM interfaces are pretty low-level; if you
need to drastically alter the structure of the template, it can be a lot of
code to do so. Second, XMLC uses what some people call "push Model 2", where
your servlet code is pushing the logic into the template, rather than
allowing the template to pull the necessary data out of the model. This
requires the developer to have an implicit knowledge of the structure of the
document, meaning if the designer wants to dramatically change the ordering
of the screen, chances are the developer is going to have to make changes.
Barracuda addresses both of these issues. First, in order to make it easier
to manipulate the DOM, we created a set of strongly typed MVC components
(similar to Swing) that can be bound to nodes in the DOM. So you take a
template, bind components to the appropriate nodes, and then just set data
through the component interfaces (ie. implementing a Model interface). This
means a Barracuda developer rarely needs to interact with the DOM
interfaces. It also means that Barracuda is not tightly coupled with XMLC
(although most of our examples use XMLC)--Barracuda can be used to
manipulate any DOM objects, whether they come from XMLC or some other
source.
To solve the second issue, we created a BTemplate component which basically
brings template driven "pull Model 2" to DOM templates. This is very similar
to the traditional template engine approach...the component parses the
template and as it encounters "directives", it queries data from the
template's models and substitutes it in. This makes the whole thing very
flexible: a designer can radically revamp a page and there are no developer
changes needed.
There are still some differences between this approach and something like
Velocity. In Barracuda, the BTemplate component is just that: a
component--it can be freely intermixed with other components, and can be
used where it makes sense or avoided where it doesn't. It essentially allows
you to apply templating processing to just a portion of the template page,
not the whole thing. Plus, it provides a strongly typed MVC model interface,
just like the other Barracuda components. Plus, all Barracuda models can
return more than just String data--they can also return DOM Nodes (making it
easy to insert chunks of markup), or they can return other Barracuda
components (just like in Swing, where you can put any component inside other
components). This makes it very easy to use granular components inside a
larger template component.
This componetization also enables us to keep the whole "directive set" very
very simple for the BTemplate component. Most template approaches start with
a very simple scripting language that unfortunately blooms in complexity in
order to support all kinds of fringe logic that needs to be expressed in the
template. In Barracuda, we limit complexity to 4 or 5 simple directives, and
if you need something that is not supported you either define a custom
directive or you use a different component. The fact that the whole system
is based on components makes it easy for someone to develop custom
components and experiment with different approaches. No ones locked into any
one particular way of doing things.
> But since you can plug in any templating system you like into Turbine that
> seems a bit of a moot point.
Within Barracuda, the idea is that you should be able to apply templating to
portions of a page; you shouldn't have to do it for the whole thing. Use it
where it makes sense; don't where it doesn't. Barracuda makes it possible to
take a template approach like you'd use within Velocity ("pull Model 2") as
well as an XMLC type approach ("push Model 2"), and freely intermix them,
not only within the same app but also within the same page.
> There may be many other non-obvious differences.
Barracuda focuses on delivering 4 key pieces of technology:
1. Strongly typed MVC Component Model - we've beaten this to death up above.
2. Event Model - convert requests into first class even objects and deliver
them to interested listeners. This provides the Model 2 flow control aspects
of the system. It also enables you to add server-side listeners to
components and get notified when client-side events occur (again, just like
in Swing)
3. Form Mapping and Validation framework - convert HTTP Req params into
first class objects and validate them
4. Localization services - automatically localize templates based on values
found in properties files; you can then load the appropriate template for a
given locale (it'll find the closest match, just like with ResourceBundles)
Each of these is designed to be used independantly, so you can pick and
choose which part makes sense for you.
If you want more information on this, you should really refer to the
Barracuda site and ask questions there. I don't want to take up any more
Turbine bandwidth discussing issues that would be better covered on the
Barracuda list.
Hope this helps,
Christian
------------------------------------------------
Christian Cryder [[EMAIL PROTECTED]]
Barracuda - MVC Component Framework for Webapps
http://barracuda.enhydra.org
------------------------------------------------
"What a great time to be a Geek"
> -----Original Message-----
> From: Alex McLintock [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 08, 2001 3:28 AM
> To: [EMAIL PROTECTED]
> Subject: Re: What about Barracuda? (Was Re: JavaOne Struts BOF)
>
>
>
> --- John Thorhauer <[EMAIL PROTECTED]> wrote:
> > On Friday 08 June 2001 01:09, Bruno Unna wrote:
> > >
> > > Nonetheless, since the time I started to use Turbine, Lutris came out
> > > with their first beta release of Barracuda, and since I'm yet in the
> > > early stages of my first project with Turbine, I'm feeling just as a
> > > fifteen years old girl about to make *the* decision of her life... :)
> >
> > I dont know much about Barracuda but if you tell us what it
> does, maybe we
> > can help you understand how turbine might accomplish the saem thing,
> >
> > John
>
> I think the poster was hoping that we had already evaluated Barracuda.
> It appears to be a component orientated framework for building
> web applications.
> The main difference between Turbine and Barracuda that I read
> about on the
> website seems to be the choice between Velocity or XMLC2
>
> But since you can plug in any templating system you like into Turbine that
> seems a bit of a moot point.
>
> There may be many other non-obvious differences.
>
>
> If evaluating the two systems you need to look at two things
>
> 1) The current codebase.
> 2) the people involved in doing future development.
>
> I am not in a position compare the code - you should do it
> yourself - you can download
> both since they are open source. However I have looked at a lot
> of Apache Java code
> and in general I find it of very high quality.
>
> The latter is definitely a personal opinion. Enhydra appears to
> be far glossier
> than Apache with better logos and graphic design on the website. Apache
> Turbine suffers from a rather steep learning curve - you need to learn
> a lot to get things going, but maybe this list will help improve matters.
>
> -----------
>
> To paraphrase one vociferous Turbine developer who said something like:
>
> "You could use Enhydra, but then you'd have to use XMLC, and that
> would be horrible".
>
> However maybe XMLC2 is better than XMLC and maybe better than Velocity?
> I'd be surprised though. Velocity has had enough people using it
> and developing
> it to satisfy me.
>
> Alex McLintock
>
>
>
> =====
> Alex McLintock [EMAIL PROTECTED]
> OpenWeb Analysts Ltd, http://www.OWAL.co.uk/
> DR WHO COMPETITION:
http://www.diversebooks.com/cgi-bin/caption/captions.cgi?date=200104
Get Your XML T-Shirt <t-shirt/> at http://www.inversity.co.uk/
____________________________________________________________
Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]