You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Cyrille37 <cy...@gmail.com> on 2006/11/21 13:43:37 UTC

[newbie] Spring vs Hivemind

Hello,

I'm new with Tapestry. I've selected Tapestry for my future project 
because of its simplicity and its wysiwyg capabilities.
I'd done well the tutorial, and have workbench example running well. 
That's great ;-)

By the way, here are some questions :

Should I learn and use Spring with Tapestry or Hivemind is enough ?
Is Tapernate stable and ready for production ? If not, how to integrate 
Hibernate ?

Thanks a lot for your comments,
cyrille.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Re: Re: [newbie] Spring vs Hivemind

Posted by Sam Gendler <sg...@ideasculptor.com>.
We use Spring 1.2, but long ago wrote our own subclass of
ApplicationContext that will grab context override files from
elsewhere (including the local filesystem rather than the classpath).
It offers pretty much the exact functionality you are looking for.
I'm sure it can be applied to spring 2.0 as well.  It lets us have a
default config defined in the application context which works on
developer machines, and then have overrides that live in app context
files on the local filesystem in production boxes.  Any bean defined
in an override file will automatically replace any bean of the same
name found in the application context that would be loaded without the
override.  You can also provide totally unique beans in an override
context. This allows us to drop a developer build directly on a
production machine and the production overrides will be autodetected
and utilized. It probably isn't quite as flexible as hibernate's
mechanism, but it is flexible enough for our use cases.  I can talk to
the lawyerly folks about whether I can make it public if you'd like.

One cute little thing we do with it is to override the name of the CSS
files that get used.  This allows us to have a look and feel that
makes it abundantly clear you are not in a production environment (the
color scheme is pink and lime-green unless you have a production
override).  I'm sure hivemind would give us a more elegant solution to
the same problem(or at least a built-in solution to it), but then I'd
have to know more about hivemind, something I'm trying to avoid, since
we've already got enough frameworks that I have to be expert in
(tapestry, spring, dojo, hibernate, quartz, j2ee, etc).

Honestly, if you can get away with just using hivemind, then I'd
recommend it, if only becuse it will be one less framework you need to
deal with, which is probably a good thing.  But if you must have some
of Spring's features, then my strategy of minimizing our dependancy on
hivemind has worked out very well for us.

--sam

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Re: [newbie] Spring vs Hivemind

Posted by Daniel Tabuenca <dt...@gmail.com>.
No, I believe this is the main positive hivemind has. It would be nice
if spring had a hivemind-like configuration system. One thing that
I've been trying lately is the spring-annotation project found here:
https://spring-annotation.dev.java.net/ It basically lets you fully
configure your beans using annotations which are then automatically
read by spring. Of course some argue that this goes against the spirit
of dependency injection since you then hard-code your dependencies in
the form of annotations. However, for most people, this is just what
they need. I agree with the <aop:scoped-proxy/> it really should be
the default and would be much nicer if it were in option in the actual
bean definition such as proxy="true" or something like that.



On 11/22/06, Marcus.Schulte@bmw.ch <Ma...@bmw.ch> wrote:
> Thanks for the pointer! That's looking quite cool. My only complaint is
> that you obviously have to remember to put " <aop:scoped-proxy/>" inside
> each bean with a non-standard scope. If this was available a year ago,
> I'd have considered Spring - though I still like the HiveMind XML
> notation better.
>
> Sorry for asking instead of reading the docs: But can Spring 2.0 also
> pull together its config from different jars on the classpath like
> HiveMind does?
> Or do you still need to have a "master application.xml" and and do
> manual includes?
>
> > -----Original Message-----
> > From: Daniel Tabuenca [mailto:dtabuenc@gmail.com]
> > Sent: Wednesday, November 22, 2006 10:18 AM
> > To: Tapestry users
> > Subject: Re: Re: [newbie] Spring vs Hivemind
> >
> >  Spring 2.0 has singleton/prototype/request/session/global
> > session/ and custom scopes. It should be noted that spring's
> > prototype scope is different from hivemind in that an object
> > is created every time a referencing dependency is set or when
> > one requests it directly via a getBean("beanName"). In this
> > sense spring acts more like a factory returning configured
> > objects unlike hivemind which returns a proxy which creates a
> > new object on each method invocation.
> >
> > Spring also has the concept of target sources which is
> > basically equivalent to hivemind pooled service models and
> > also allow lets you do hivemind-like prototype proxies.
> >
> > Here are the references to the docs if anyone is interested:
> >
> > http://static.springframework.org/spring/docs/2.0.x/reference/
> > beans.html#beans-factory-scopes
> >
> > and
> >
> > http://static.springframework.org/spring/docs/2.0.x/reference/
> > aop-api.html#aop-targetsource
> >
> >
> >
> > On 11/22/06, Marcus.Schulte@bmw.ch <Ma...@bmw.ch> wrote:
> > > No, Spring has only prototype and singleton Beans afaik.
> > > HiveMind has threaded/pooled service-models which can easily be
> > > extended (Honeycomb does this to implement session-per-conversation
> > > based on a "stateful" service-model).
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


RE: Re: [newbie] Spring vs Hivemind

Posted by Ma...@bmw.ch.
Thanks for the pointer! That's looking quite cool. My only complaint is
that you obviously have to remember to put " <aop:scoped-proxy/>" inside
each bean with a non-standard scope. If this was available a year ago,
I'd have considered Spring - though I still like the HiveMind XML
notation better.

Sorry for asking instead of reading the docs: But can Spring 2.0 also
pull together its config from different jars on the classpath like
HiveMind does?
Or do you still need to have a "master application.xml" and and do
manual includes?

> -----Original Message-----
> From: Daniel Tabuenca [mailto:dtabuenc@gmail.com] 
> Sent: Wednesday, November 22, 2006 10:18 AM
> To: Tapestry users
> Subject: Re: Re: [newbie] Spring vs Hivemind
> 
>  Spring 2.0 has singleton/prototype/request/session/global 
> session/ and custom scopes. It should be noted that spring's 
> prototype scope is different from hivemind in that an object 
> is created every time a referencing dependency is set or when 
> one requests it directly via a getBean("beanName"). In this 
> sense spring acts more like a factory returning configured 
> objects unlike hivemind which returns a proxy which creates a 
> new object on each method invocation.
> 
> Spring also has the concept of target sources which is 
> basically equivalent to hivemind pooled service models and 
> also allow lets you do hivemind-like prototype proxies.
> 
> Here are the references to the docs if anyone is interested:
> 
> http://static.springframework.org/spring/docs/2.0.x/reference/
> beans.html#beans-factory-scopes
> 
> and
> 
> http://static.springframework.org/spring/docs/2.0.x/reference/
> aop-api.html#aop-targetsource
> 
> 
> 
> On 11/22/06, Marcus.Schulte@bmw.ch <Ma...@bmw.ch> wrote:
> > No, Spring has only prototype and singleton Beans afaik.
> > HiveMind has threaded/pooled service-models which can easily be 
> > extended (Honeycomb does this to implement session-per-conversation 
> > based on a "stateful" service-model).
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Re: [newbie] Spring vs Hivemind

Posted by Daniel Tabuenca <dt...@gmail.com>.
 Spring 2.0 has singleton/prototype/request/session/global session/
and custom scopes. It should be noted that spring's prototype scope is
different from hivemind in that an object is created every time a
referencing dependency is set or when one requests it directly via a
getBean("beanName"). In this sense spring acts more like a factory
returning configured objects unlike hivemind which returns a proxy
which creates a new object on each method invocation.

Spring also has the concept of target sources which is basically
equivalent to hivemind pooled service models and also allow lets you
do hivemind-like prototype proxies.

Here are the references to the docs if anyone is interested:

http://static.springframework.org/spring/docs/2.0.x/reference/beans.html#beans-factory-scopes

and

http://static.springframework.org/spring/docs/2.0.x/reference/aop-api.html#aop-targetsource



On 11/22/06, Marcus.Schulte@bmw.ch <Ma...@bmw.ch> wrote:
> No, Spring has only prototype and singleton Beans afaik.
> HiveMind has threaded/pooled service-models which can easily be
> extended (Honeycomb does this to implement session-per-conversation
> based on a "stateful" service-model).

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


RE: Re: [newbie] Spring vs Hivemind

Posted by Ma...@bmw.ch.
No, Spring has only prototype and singleton Beans afaik.
HiveMind has threaded/pooled service-models which can easily be
extended (Honeycomb does this to implement session-per-conversation
based on a "stateful" service-model). 

> -----Original Message-----
> From: Daniel Tabuenca [mailto:dtabuenc@gmail.com] 
> Sent: Wednesday, November 22, 2006 9:49 AM
> To: Tapestry users
> Subject: Re: Re: [newbie] Spring vs Hivemind
> 
> While we're on the subject, am I correct in my assessment 
> that the only feature that hivemind has that spring does not 
> is the whole configuration point /contribution system? It's 
> been a while since I've really used hivemind so I may be wrong.
> 
> On 11/22/06, Kalle Korhonen <ka...@gmail.com> wrote:
> > I think Sam put it pretty well. Cyrille, you should also read the 
> > other thread "Tapernate access multiple database" that touches the 
> > Hivemind/Spring subject. I often think the primary use scenarios of 
> > commons-logging and log4j are analogous to Hivemind and 
> Spring. If you 
> > are building a library or framework with third-party 
> extensibility in 
> > mind you want Hivemind (and commons-logging), and if you 
> are building 
> > a stand-alone web/J2EE application Spring (and log4j) provides a 
> > better fit (because you gain less from Hivemind/common-logging 
> > flexibility and because they don't have out-of-the-box 
> support for other frameworks you likely need).
> >
> > Kalle
> >
> > On 11/21/06, Sam Gendler <sg...@ideasculptor.com> wrote:
> > >
> > > It depends entirely on the context of the app.  Tap has some 
> > > dependancies on hivemind, so you will wind up dealing 
> with hivemind 
> > > and hivemind configs to some extent no matter which 
> solution you use.
> > > However, the spring integration is very easy to use, and it is 
> > > easily possible to keep all of the layers and support 
> classes that 
> > > aren't web/tapestry specific in your spring config and 
> use them from 
> > > within tapestry as easily as you can use objects managed 
> by Hivemind.
> > > Fundamentally, Spring makes working with Hibernate based 
> entities an 
> > > absolute breeze, and that isn't something to be disregarded.  And 
> > > AOP via AspectJ really simplifies some other things, such as 
> > > changelogs and transaction management (spring will happily manage 
> > > all your transactions for you via AOP, if you ask it to).  If you 
> > > will be using hibernate for entity storage and/or want 
> acegi or AOP, 
> > > then the choice is made for you. Use Spring.  If not, hivemind is 
> > > the solution that is native to tapestry, so you might as well use 
> > > that. Another issue to consider is that Spring is probably more 
> > > likely to crop up on other projects you may build in the 
> future, so 
> > > it may be useful to you, personally, to use it.
> > >
> > > --sam
> > >
> > > 
> --------------------------------------------------------------------
> > > - To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > For additional commands, e-mail: users-help@tapestry.apache.org
> > >
> > >
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Re: [newbie] Spring vs Hivemind

Posted by Daniel Tabuenca <dt...@gmail.com>.
While we're on the subject, am I correct in my assessment that the
only feature that hivemind has that spring does not is the whole
configuration point /contribution system? It's been a while since I've
really used hivemind so I may be wrong.

On 11/22/06, Kalle Korhonen <ka...@gmail.com> wrote:
> I think Sam put it pretty well. Cyrille, you should also read the other
> thread "Tapernate access multiple database" that touches the Hivemind/Spring
> subject. I often think the primary use scenarios of commons-logging and
> log4j are analogous to Hivemind and Spring. If you are building a library or
> framework with third-party extensibility in mind you want Hivemind (and
> commons-logging), and if you are building a stand-alone web/J2EE application
> Spring (and log4j) provides a better fit (because you gain less from
> Hivemind/common-logging flexibility and because they don't have
> out-of-the-box support for other frameworks you likely need).
>
> Kalle
>
> On 11/21/06, Sam Gendler <sg...@ideasculptor.com> wrote:
> >
> > It depends entirely on the context of the app.  Tap has some
> > dependancies on hivemind, so you will wind up dealing with hivemind
> > and hivemind configs to some extent no matter which solution you use.
> > However, the spring integration is very easy to use, and it is easily
> > possible to keep all of the layers and support classes that aren't
> > web/tapestry specific in your spring config and use them from within
> > tapestry as easily as you can use objects managed by Hivemind.
> > Fundamentally, Spring makes working with Hibernate based entities an
> > absolute breeze, and that isn't something to be disregarded.  And AOP
> > via AspectJ really simplifies some other things, such as changelogs
> > and transaction management (spring will happily manage all your
> > transactions for you via AOP, if you ask it to).  If you will be using
> > hibernate for entity storage and/or want acegi or AOP, then the choice
> > is made for you. Use Spring.  If not, hivemind is the solution that is
> > native to tapestry, so you might as well use that. Another issue to
> > consider is that Spring is probably more likely to crop up on other
> > projects you may build in the future, so it may be useful to you,
> > personally, to use it.
> >
> > --sam
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Re: [newbie] Spring vs Hivemind

Posted by Kalle Korhonen <ka...@gmail.com>.
I think Sam put it pretty well. Cyrille, you should also read the other
thread "Tapernate access multiple database" that touches the Hivemind/Spring
subject. I often think the primary use scenarios of commons-logging and
log4j are analogous to Hivemind and Spring. If you are building a library or
framework with third-party extensibility in mind you want Hivemind (and
commons-logging), and if you are building a stand-alone web/J2EE application
Spring (and log4j) provides a better fit (because you gain less from
Hivemind/common-logging flexibility and because they don't have
out-of-the-box support for other frameworks you likely need).

Kalle

On 11/21/06, Sam Gendler <sg...@ideasculptor.com> wrote:
>
> It depends entirely on the context of the app.  Tap has some
> dependancies on hivemind, so you will wind up dealing with hivemind
> and hivemind configs to some extent no matter which solution you use.
> However, the spring integration is very easy to use, and it is easily
> possible to keep all of the layers and support classes that aren't
> web/tapestry specific in your spring config and use them from within
> tapestry as easily as you can use objects managed by Hivemind.
> Fundamentally, Spring makes working with Hibernate based entities an
> absolute breeze, and that isn't something to be disregarded.  And AOP
> via AspectJ really simplifies some other things, such as changelogs
> and transaction management (spring will happily manage all your
> transactions for you via AOP, if you ask it to).  If you will be using
> hibernate for entity storage and/or want acegi or AOP, then the choice
> is made for you. Use Spring.  If not, hivemind is the solution that is
> native to tapestry, so you might as well use that. Another issue to
> consider is that Spring is probably more likely to crop up on other
> projects you may build in the future, so it may be useful to you,
> personally, to use it.
>
> --sam
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Re: [newbie] Spring vs Hivemind

Posted by Sam Gendler <sg...@ideasculptor.com>.
It depends entirely on the context of the app.  Tap has some
dependancies on hivemind, so you will wind up dealing with hivemind
and hivemind configs to some extent no matter which solution you use.
However, the spring integration is very easy to use, and it is easily
possible to keep all of the layers and support classes that aren't
web/tapestry specific in your spring config and use them from within
tapestry as easily as you can use objects managed by Hivemind.
Fundamentally, Spring makes working with Hibernate based entities an
absolute breeze, and that isn't something to be disregarded.  And AOP
via AspectJ really simplifies some other things, such as changelogs
and transaction management (spring will happily manage all your
transactions for you via AOP, if you ask it to).  If you will be using
hibernate for entity storage and/or want acegi or AOP, then the choice
is made for you. Use Spring.  If not, hivemind is the solution that is
native to tapestry, so you might as well use that. Another issue to
consider is that Spring is probably more likely to crop up on other
projects you may build in the future, so it may be useful to you,
personally, to use it.

--sam

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [newbie] Spring vs Hivemind

Posted by Daniel Tabuenca <dt...@gmail.com>.
I find spring easier to use. There's not much difference in what the
two can do in terms of dependency injection. The one thing that makes
hivemind different is the whole configuration point/ contribution idea
which makes it easier for things to plug right in by simply dropping a
properly configured jar. Other than that, the new spring 2.0 has all
the features such as the scoping, lazy init, and all that. Apart from
dependency injection, spring has a whole slew of other features that
can be useful, such as Acegi for security, excellent AspectJ
integration, Transaction management, and hibernate integration. You
might consider using spring for these reasons.

On 11/21/06, Andrea Chiumenti <ki...@gmail.com> wrote:
> Go well with hivemind, because it can do everything Spring does (and
> sometime even better).
> However a look @ Spring can enforce your skill ;-P
>
> kiuma
>
> On 11/21/06, Cyrille37 <cy...@gmail.com> wrote:
> >
> > Hello,
> >
> > I'm new with Tapestry. I've selected Tapestry for my future project
> > because of its simplicity and its wysiwyg capabilities.
> > I'd done well the tutorial, and have workbench example running well.
> > That's great ;-)
> >
> > By the way, here are some questions :
> >
> > Should I learn and use Spring with Tapestry or Hivemind is enough ?
> > Is Tapernate stable and ready for production ? If not, how to integrate
> > Hibernate ?
> >
> > Thanks a lot for your comments,
> > cyrille.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [newbie] Spring vs Hivemind

Posted by Andrea Chiumenti <ki...@gmail.com>.
Go well with hivemind, because it can do everything Spring does (and
sometime even better).
However a look @ Spring can enforce your skill ;-P

kiuma

On 11/21/06, Cyrille37 <cy...@gmail.com> wrote:
>
> Hello,
>
> I'm new with Tapestry. I've selected Tapestry for my future project
> because of its simplicity and its wysiwyg capabilities.
> I'd done well the tutorial, and have workbench example running well.
> That's great ;-)
>
> By the way, here are some questions :
>
> Should I learn and use Spring with Tapestry or Hivemind is enough ?
> Is Tapernate stable and ready for production ? If not, how to integrate
> Hibernate ?
>
> Thanks a lot for your comments,
> cyrille.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>