Results 1 to 2 of 2

Thread: Container Hierarchy

  1. #1
    Join Date
    Sep 2004
    Location
    Montréal
    Posts
    3

    Default Container Hierarchy

    The integration of Webwork2 and PicoContainer (found in NanoContainer) creates a container hierarchy (Application, Session, Request).

    Actions are registered in the request container (a new container is created for every request) and therefore can have dependencies on components defined at all levels.

    I am not fully sure about the usefullness of the request container vs the potential overhead but I certainly find it usefull to have a container per session.

    Actions could be defined as prototypes in the session container (or automatically registered as beans with autowiring?). This allows to have singleton components per session and dependency resolving is done independently of the scope. I suppose this would involve a ServletContextListener to listen for session creation and expiration.

    Is it possible do that currently in Spring?
    Anyone tried to do something like this?

    Regards,
    François

  2. #2
    Join Date
    Aug 2004
    Location
    San Mateo, CA
    Posts
    1,265

    Default

    It wouldn't be hard to do. A listener or handler interceptor could create a new context whose parent was the application context. But why not use a strongly typed session object to hold whatever objects are required for the session? It would seem worrying if large numbers of objects were required to be held in a session...
    Rod Johnson - GM, SpringSource Division, VMware
    http://www.springsource.com
    Spring From the Source

Similar Threads

  1. Replies: 11
    Last Post: Jul 19th, 2005, 10:24 PM
  2. Container standard?
    By jbetancourt in forum Architecture
    Replies: 3
    Last Post: Apr 11th, 2005, 01:01 PM
  3. Replies: 2
    Last Post: Mar 27th, 2005, 10:50 PM
  4. Replies: 1
    Last Post: Nov 4th, 2004, 09:11 AM
  5. AOP and pattern design
    By moo in forum AOP
    Replies: 12
    Last Post: Oct 19th, 2004, 01:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •