2 Replies Latest reply on Jul 26, 2005 1:58 PM by Tom Baeyens

    are there contexts in microcontainer

    Tom Baeyens Master

      > For Seam, Gavin worked out a mechanism of contexts. I think this a great simplification for the app developer.
      > Now, all the contextual information is scattered around various specs
      > and a lot is left to the user. For a container, i think a centralized
      > context mechanism for request, persistence, security, ... would be
      > great to have in the microcontainer.
      >
      > Is there something similar in the microcontainer ? Can you give me a
      > pointer or classname to look for ? or is this considered and rejected for some reason ?

      regards, tom.

        • 1. Re: are there contexts in microcontainer
          Adrian Brock Master

          We discussed this a while back.

          The idea of context is an application level issue. e.g. a web context is different
          from an ejb context and more different from request, page, session or
          even JVM or cluster context.

          Gavin and I decided that such relationships are better built on top of the MC
          rather than inside the MC, because only the user/application really knows what the
          relationships are.

          AOP does have a model for such contexts, but this is to load/query "metadata" and apply
          aspects, but these are not linked to application level contexts like page/session.
          http://docs.jboss.org/aop/1.3/aspect-framework/reference/en/html_single/index.html#xml-metadata

          AFAIK, nobody has started this work, despite lots of people asking this question.

          • 2. Re: are there contexts in microcontainer
            Tom Baeyens Master

            i agree. such a framework is better build on top of the MC.

            in my opinion, the most important part is having typed thread local context. meaning that all information related to the current contexts (web-request, web-session, transaction, hibernate session, security context, ...) is available via a thread local lookup. and typed so that a user can use code completion.

            e.g. Contexts.getSecurityContext().getUserPrincipal() or Contexts.getPersistenceContext().getPersistenceManager()

            all this information is now (in current enterprise development) scattered all over the different specs.

            i would happy to work out a prototype to show all features that i want in there. but finding time for that will be difficult. to take on the development of the real stuff, i lack time, i think. we'll see how it goes.

            regards, tom.