HiveMind与Spring 的比较
可能没用过HiveMind的关系,有些部分没看明白。
So how does HiveMind compare to Spring and PicoContainer other these lightweight containers?
They are all pretty good ideas. Each one is going to tickle an individual person's needs in a different way. PicoContainer is a sort of a the leanest and meanest one but what's neat about it is it doesn't require that the objects implement a particular interface, Spring is the same way, it doesn't care about interface so much. HiveMind is very much interface oriented, so every service in HiveMind needs to implement a specific interface, which gives us a lot of latitude to do a lot of interesting AOP like thing using just standard technologies like dynamic proxies or JBoss' JavaAssist framework. In terms of maturity, PicoContainer is new, Avalon has been run for a quite a bit longer. Spring is gaining a lot of traction and has some really great integration with some other big tools like Hibernate. HiveMind is sort of I think catching up to those. I think the biggest difference between all of them is that first of all HiveMind have the same line precise error reporting as Tapestry, which is great because it is so driven by XML. Second, none of the other frameworks, especially Spring, PicoContainer idea have this configuration idea that I borrowed from Eclipse for HiveMind. So they can talk to a lot of services and configuring services, connecting services, but HiveMind has this idea of configuration data that can come from different locations. Like I was saying with Eclipse you can talk about a tool bar in that different modules can contribute to that tool bar, you can do the exact same thing using HiveMind which really makes sense in any kind of application, web application, desktop application.
Great. Can you use HiveMind and Spring together?
You can't use them together yet, but there is no real reason like any of these containers, HiveMind, Spring, Avalon can't run one of the other containers as a managed bean or service or whatever the right terminology is. I think everyone is going to integrate with everyone else. People have done pictures of this and I fully expect to have a way in HiveMind of having Spring as a service that can provide beans managed by Spring as other HiveMind services that will be fairly simple to do and I think doing something similar from the Spring side into HiveMind would also be very simple and we are talking dozens of lines of code.