You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-dev@portals.apache.org by Ken Weiner <kw...@unicon.net> on 2004/12/22 21:01:05 UTC
Dependency injection in Pluto 1.1
Is the Spring IoC container being used in Pluto 1.1 to achieve the
dependency injection pattern? I remember reading that it was going to
be used, but I don't see it in there.
-Ken
====
This message and any attachments are confidential. Unauthorized use
or disclosure of this message is strictly prohibited, and this message
must be destroyed immediately if received by an unauthorized recipient.
====
Re: Dependency injection in Pluto 1.1
Posted by Jeremy Boynes <jb...@apache.org>.
David H. DeWolf wrote:
>
>> A guess the advantage I'm after is to have all the collaborator
>> implementation declarations specified outside of the java code.
>>
>> -Ken
>
>
> I can definitely see the benefit of that. I guess I'm having a hard
> time figuring out if that really belongs in the pluto container or if
> that is really a function of the portal which surrounds it.
>
> In my head the container is really just a set of libraries which is
> managed by a portal. The portal injects these libraries with interface
> implementations which allow the container to become compatible with it's
> surrounding environment. Because of this point of view, I seem to think
> that it's the responsibility of the surrounding portal to configure
> pluto - and thus it would be the portal driver's responsibility to use
> spring (or whatever other IoC technique/container) for that configuration.
>
> FWIW, Currently Pluto 1.1 uses a very simple xml file for this
> abstraction/configuration. It is digested by commons-digester which
> takes care of the configuration/injection.
>
> Do you view these responsibilities differently than I do?
>
I would add another participant here - whatever is performing deployment
and hooking portlet applications to the portal. Whilst this can be done
using standalone tools, I would like to be able to have the app server
participate in this - for example, portlet deployment could be
integrated into its JSR-88 deployment infrastructure or it could notify
the portal when the portlet application modules were being
(re-)deployed. Some of this can be hooked to context listeners but
having the server involved may make for a cleaner solution.
--
Jeremy
Re: Dependency injection in Pluto 1.1
Posted by Ralph Goers <Ra...@dslextreme.com>.
Ken Ramirez wrote:
> Now wait a minute, isn't HiveMind also licensed under Apache License
> 2.0? It relies on Javassist, which is licensed under LGPL.
>
> Ken
I believe this is OK because Javaassist is dual licensed under both the
MPL and LGPL. I believe the MPL is OK for use in Apache projects - at
least it better be because Cocoon has at least one that I know of.
From the Javaassist home page:
Javassist version 3.0 RC1 is available (September 13th, 2004). new
This version is distributed under the dual license of the MPL and the LGPL.
Re: Dependency injection in Pluto 1.1
Posted by Ken Ramirez <kr...@thejavathinktank.org>.
Now wait a minute, isn't HiveMind also licensed under Apache License
2.0? It relies on Javassist, which is licensed under LGPL.
Ken
Ralph Goers wrote:
> Ken Ramirez wrote:
>
>> I'm not a die hard either. I think that you have to evaluate the
>> situation and provide the right solution for the problem. That said,
>> I think that it's important to choose a container that allows both. I
>> believe that all three major implements do (HiveMind, Pico, and Spring).
>>
>> Ken
>
>
> Apparently there are license issues with Spring. Although Spring
> itself is Apache licensed, it imports Hibernate classes in some of its
> code. Since Hibernate is LGPL these must be stripped out to be
> compliant with Apache.
>
>
>
Re: Dependency injection in Pluto 1.1
Posted by Ralph Goers <Ra...@dslextreme.com>.
Ken Ramirez wrote:
> I'm not a die hard either. I think that you have to evaluate the
> situation and provide the right solution for the problem. That said, I
> think that it's important to choose a container that allows both. I
> believe that all three major implements do (HiveMind, Pico, and Spring).
>
> Ken
Apparently there are license issues with Spring. Although Spring itself
is Apache licensed, it imports Hibernate classes in some of its code.
Since Hibernate is LGPL these must be stripped out to be compliant with
Apache.
Re: Dependency injection in Pluto 1.1
Posted by Ken Ramirez <kr...@thejavathinktank.org>.
I'm not a die hard either. I think that you have to evaluate the
situation and provide the right solution for the problem. That said, I
think that it's important to choose a container that allows both. I
believe that all three major implements do (HiveMind, Pico, and Spring).
Ken
David H. DeWolf wrote:
> Ken,
>
> I'm typically a fan of constructor injection for immutable
> services/properties. That's why you'll probably find some places
> where the setters don't exist.
>
> That said, I'm not a die hard that's against setter injection. What
> do the rest of you think?
>
> David
>
> Ken Weiner wrote:
>
>> David,
>>
>> I think I share your view that the portal could take responsibility
>> for configuring the container via dependency injection. It will make
>> things much easier if the PortletContainerImpl and all other
>> container impls are true java beans with setter methods. This is
>> mostly the case already, but there are a few places where setters
>> could be added - I'll submit them to JIRA as I encounter them.
>>
>> -Ken
>>
>> David H. DeWolf wrote:
>>
>>>
>>>> A guess the advantage I'm after is to have all the collaborator
>>>> implementation declarations specified outside of the java code.
>>>>
>>>> -Ken
>>>
>>>
>>>
>>>
>>> I can definitely see the benefit of that. I guess I'm having a hard
>>> time figuring out if that really belongs in the pluto container or
>>> if that is really a function of the portal which surrounds it.
>>>
>>> In my head the container is really just a set of libraries which is
>>> managed by a portal. The portal injects these libraries with
>>> interface implementations which allow the container to become
>>> compatible with it's surrounding environment. Because of this point
>>> of view, I seem to think that it's the responsibility of the
>>> surrounding portal to configure pluto - and thus it would be the
>>> portal driver's responsibility to use spring (or whatever other IoC
>>> technique/container) for that configuration.
>>>
>>> FWIW, Currently Pluto 1.1 uses a very simple xml file for this
>>> abstraction/configuration. It is digested by commons-digester which
>>> takes care of the configuration/injection.
>>>
>>> Do you view these responsibilities differently than I do?
>>>
>>> David
>>
>>
>>
>> ====
>> This message and any attachments are confidential. Unauthorized use
>> or disclosure of this message is strictly prohibited, and this message
>> must be destroyed immediately if received by an unauthorized recipient.
>> ====
>>
>
Re: Dependency injection in Pluto 1.1
Posted by "David H. DeWolf" <dd...@apache.org>.
Ken,
I'm typically a fan of constructor injection for immutable
services/properties. That's why you'll probably find some places where
the setters don't exist.
That said, I'm not a die hard that's against setter injection. What do
the rest of you think?
David
Ken Weiner wrote:
> David,
>
> I think I share your view that the portal could take responsibility for
> configuring the container via dependency injection. It will make things
> much easier if the PortletContainerImpl and all other container impls
> are true java beans with setter methods. This is mostly the case
> already, but there are a few places where setters could be added - I'll
> submit them to JIRA as I encounter them.
>
> -Ken
>
> David H. DeWolf wrote:
>
>>
>>> A guess the advantage I'm after is to have all the collaborator
>>> implementation declarations specified outside of the java code.
>>>
>>> -Ken
>>
>>
>>
>> I can definitely see the benefit of that. I guess I'm having a hard
>> time figuring out if that really belongs in the pluto container or if
>> that is really a function of the portal which surrounds it.
>>
>> In my head the container is really just a set of libraries which is
>> managed by a portal. The portal injects these libraries with
>> interface implementations which allow the container to become
>> compatible with it's surrounding environment. Because of this point
>> of view, I seem to think that it's the responsibility of the
>> surrounding portal to configure pluto - and thus it would be the
>> portal driver's responsibility to use spring (or whatever other IoC
>> technique/container) for that configuration.
>>
>> FWIW, Currently Pluto 1.1 uses a very simple xml file for this
>> abstraction/configuration. It is digested by commons-digester which
>> takes care of the configuration/injection.
>>
>> Do you view these responsibilities differently than I do?
>>
>> David
>
>
> ====
> This message and any attachments are confidential. Unauthorized use
> or disclosure of this message is strictly prohibited, and this message
> must be destroyed immediately if received by an unauthorized recipient.
> ====
>
Re: Dependency injection in Pluto 1.1
Posted by David Jencks <da...@yahoo.com>.
I hope you will consider constructor dependency injection rather than
setter dependency injection. My experience is that it produces a truly
remarkable simplification of code.
thanks
david jencks
On Dec 22, 2004, at 5:28 PM, Ken Weiner wrote:
> David,
>
> I think I share your view that the portal could take responsibility
> for configuring the container via dependency injection. It will make
> things much easier if the PortletContainerImpl and all other container
> impls are true java beans with setter methods. This is mostly the case
> already, but there are a few places where setters could be added -
> I'll submit them to JIRA as I encounter them.
>
> -Ken
>
> David H. DeWolf wrote:
>>> A guess the advantage I'm after is to have all the collaborator
>>> implementation declarations specified outside of the java code.
>>>
>>> -Ken
>> I can definitely see the benefit of that. I guess I'm having a hard
>> time figuring out if that really belongs in the pluto container or if
>> that is really a function of the portal which surrounds it.
>> In my head the container is really just a set of libraries which is
>> managed by a portal. The portal injects these libraries with
>> interface implementations which allow the container to become
>> compatible with it's surrounding environment. Because of this point
>> of view, I seem to think that it's the responsibility of the
>> surrounding portal to configure pluto - and thus it would be the
>> portal driver's responsibility to use spring (or whatever other IoC
>> technique/container) for that configuration.
>> FWIW, Currently Pluto 1.1 uses a very simple xml file for this
>> abstraction/configuration. It is digested by commons-digester which
>> takes care of the configuration/injection.
>> Do you view these responsibilities differently than I do?
>> David
>
> ====
> This message and any attachments are confidential. Unauthorized use
> or disclosure of this message is strictly prohibited, and this message
> must be destroyed immediately if received by an unauthorized recipient.
> ====
>
Re: Dependency injection in Pluto 1.1
Posted by Ken Weiner <kw...@unicon.net>.
David,
I think I share your view that the portal could take responsibility for
configuring the container via dependency injection. It will make things
much easier if the PortletContainerImpl and all other container impls
are true java beans with setter methods. This is mostly the case
already, but there are a few places where setters could be added - I'll
submit them to JIRA as I encounter them.
-Ken
David H. DeWolf wrote:
>
>> A guess the advantage I'm after is to have all the collaborator
>> implementation declarations specified outside of the java code.
>>
>> -Ken
>
>
> I can definitely see the benefit of that. I guess I'm having a hard
> time figuring out if that really belongs in the pluto container or if
> that is really a function of the portal which surrounds it.
>
> In my head the container is really just a set of libraries which is
> managed by a portal. The portal injects these libraries with interface
> implementations which allow the container to become compatible with it's
> surrounding environment. Because of this point of view, I seem to think
> that it's the responsibility of the surrounding portal to configure
> pluto - and thus it would be the portal driver's responsibility to use
> spring (or whatever other IoC technique/container) for that configuration.
>
> FWIW, Currently Pluto 1.1 uses a very simple xml file for this
> abstraction/configuration. It is digested by commons-digester which
> takes care of the configuration/injection.
>
> Do you view these responsibilities differently than I do?
>
> David
====
This message and any attachments are confidential. Unauthorized use
or disclosure of this message is strictly prohibited, and this message
must be destroyed immediately if received by an unauthorized recipient.
====
Re: Dependency injection in Pluto 1.1
Posted by "David H. DeWolf" <dd...@apache.org>.
> A guess the advantage I'm after is
> to have all the collaborator implementation declarations specified
> outside of the java code.
>
> -Ken
I can definitely see the benefit of that. I guess I'm having a hard
time figuring out if that really belongs in the pluto container or if
that is really a function of the portal which surrounds it.
In my head the container is really just a set of libraries which is
managed by a portal. The portal injects these libraries with interface
implementations which allow the container to become compatible with it's
surrounding environment. Because of this point of view, I seem to think
that it's the responsibility of the surrounding portal to configure
pluto - and thus it would be the portal driver's responsibility to use
spring (or whatever other IoC technique/container) for that configuration.
FWIW, Currently Pluto 1.1 uses a very simple xml file for this
abstraction/configuration. It is digested by commons-digester which
takes care of the configuration/injection.
Do you view these responsibilities differently than I do?
David
Re: Dependency injection in Pluto 1.1
Posted by Ken Weiner <kw...@unicon.net>.
David,
Thanks for clarifying that. I am about to start trying to embed Pluto
1.1 into the next generation of uPortal, uPortal 3, which uses Spring
IoC for the majority of its components. I can't say I have a good
enough feel for the current design to make meaningful comments yet, but
I hope to shortly. My initial approach will be to declare the
implementation of the portlet container and its collaborators in a
Spring bean config file, and possibly avoid using a servlet context
listener as the means to wire it up. A guess the advantage I'm after is
to have all the collaborator implementation declarations specified
outside of the java code.
-Ken
David H. DeWolf wrote:
> It currently is not.
>
> My personal goal for 1.1 is to simplify pluto. Specifically I want to
> 1) make it easier to embed pluto within other portals 2) make it easier
> for portlet developers to use pluto out of the box 3) make it easier to
> understand and maintain pluto. Whether these goals can be accomplished
> by using Spring IoC has yet to be determined IMHO.
>
> My hope was that by committing a simplified and more traditional
> architecture for pluto we would begin to see more discussions and code
> being generated around ideas like using Spring. Unfortunately, to date,
> that has not happened.
>
> If you're interested in this, please feel free to jump in. I'm very
> interested in your thoughts about what the advantages of this approach
> are and am very open to criticism of the current 1.1 implementation. I'm
> very hopefully that several others will jump into it's development.
>
> David
>
====
This message and any attachments are confidential. Unauthorized use
or disclosure of this message is strictly prohibited, and this message
must be destroyed immediately if received by an unauthorized recipient.
====
Re: Dependency injection in Pluto 1.1
Posted by Jeremy Boynes <jb...@apache.org>.
Ken Ramirez wrote:
> On the downside, it does mean that some of the connecting pieces would
> first have to be coded as an interface, and then an implementation
> provided. From conversations that David and I have had, I know that one
> of the goals in 1.1 was to eliminate some of the interfaces and lessen
> the amount of code.
>
I think keeping the right interfaces will be the key here - we will need
to allow different portals to provide different implementations.
Removing some of the unnecessary abstractions though will really help
make Pluto easier to maintain.
--
Jeremy
Re: Dependency injection in Pluto 1.1
Posted by Ken Ramirez <kr...@TheJavaThinkTank.org>.
From my point of view, I would imagine that an IoC container would
allow the various services used by Pluto's internal to become very
loosely coupled, allowing others to change out any service they wish.
And if Pluto itself is implemented utilizing the same concepts, it might
make it easier to integrate into the various Portal platforms, making it
more appealing as the container platform of choice.
Another advantage is that much of the Service Lookup that would need to
be implemented within Pluto (e.g. logger lookup service) could be
totally removed, making the Pluto code much easier to understand.
On the downside, it does mean that some of the connecting pieces would
first have to be coded as an interface, and then an implementation
provided. From conversations that David and I have had, I know that one
of the goals in 1.1 was to eliminate some of the interfaces and lessen
the amount of code.
However, even if we still need to have interface files and
implementation files, the amount of code that would be removed (for
service lookup and so forth) and the advantages of making all of the
pieces connect in a very loose fashion may make the effort well worth it.
Ken
David H. DeWolf wrote:
> It currently is not.
>
> My personal goal for 1.1 is to simplify pluto. Specifically I want to
> 1) make it easier to embed pluto within other portals 2) make it
> easier for portlet developers to use pluto out of the box 3) make it
> easier to understand and maintain pluto. Whether these goals can be
> accomplished by using Spring IoC has yet to be determined IMHO.
>
> My hope was that by committing a simplified and more traditional
> architecture for pluto we would begin to see more discussions and code
> being generated around ideas like using Spring. Unfortunately, to
> date, that has not happened.
>
> If you're interested in this, please feel free to jump in. I'm very
> interested in your thoughts about what the advantages of this approach
> are and am very open to criticism of the current 1.1 implementation.
> I'm very hopefully that several others will jump into it's development.
>
> David
>
>
> Ken Weiner wrote:
>
>> Is the Spring IoC container being used in Pluto 1.1 to achieve the
>> dependency injection pattern? I remember reading that it was going
>> to be used, but I don't see it in there.
>>
>> -Ken
>>
>> ====
>> This message and any attachments are confidential. Unauthorized use
>> or disclosure of this message is strictly prohibited, and this message
>> must be destroyed immediately if received by an unauthorized recipient.
>> ====
>>
>
--
*----*----*----*----*----*----*----*----*----*----*----*----
Stay on top of all things to do with JSR-168 Portlet and
Portal development by bookmarking the authority on the
subject: http://community.java.net/portlet
*
* News
* Weblogs
* Community Tips
* Portlet and Portal Projects
* Featured Articles
* And much more
*
*----*----*----*----*----*----*----*----*----*----*----*----
Ken Ramirez
Send mail to: mailto://kramirez@TheJavaThinkTank.org
Check out the website: http://www.TheJavaThinkTank.org
Check out my Blog at: http://weblogs.java.net/blog/ken_ramirez
*----*----*----*----*----*----*----*----*----*----*----*----
Re: Dependency injection in Pluto 1.1
Posted by "David H. DeWolf" <dd...@apache.org>.
It currently is not.
My personal goal for 1.1 is to simplify pluto. Specifically I want to
1) make it easier to embed pluto within other portals 2) make it easier
for portlet developers to use pluto out of the box 3) make it easier to
understand and maintain pluto. Whether these goals can be accomplished
by using Spring IoC has yet to be determined IMHO.
My hope was that by committing a simplified and more traditional
architecture for pluto we would begin to see more discussions and code
being generated around ideas like using Spring. Unfortunately, to date,
that has not happened.
If you're interested in this, please feel free to jump in. I'm very
interested in your thoughts about what the advantages of this approach
are and am very open to criticism of the current 1.1 implementation.
I'm very hopefully that several others will jump into it's development.
David
Ken Weiner wrote:
> Is the Spring IoC container being used in Pluto 1.1 to achieve the
> dependency injection pattern? I remember reading that it was going to
> be used, but I don't see it in there.
>
> -Ken
>
> ====
> This message and any attachments are confidential. Unauthorized use
> or disclosure of this message is strictly prohibited, and this message
> must be destroyed immediately if received by an unauthorized recipient.
> ====
>