3 Replies Latest reply on Aug 29, 2006 1:17 PM by gavin.king

    Seam suggestion -> change Scope and ScopeType annotation

      I find myself constantly trying to maintain a mental mapping of sorts when it comes to Seam vocabulary. For example, the terms Context and Scope essentially are the same 'thing' in the documentation. In fact, the (terse) javadocs for Scope say:

      Specifies the scope (context) of a seam component.


      Instead of using two terms to say what you mean, why not use something like TargetContext as the name of the annotation class and ContextType for the enumeration of Context types?




        • 1. Re: Seam suggestion -> change Scope and ScopeType annotation

          I think of a context as a closure over a scope. Scopes are static constructs in the source, contexts are instances in the runtime. I think context is one of the most overloaded terms in programming, but seam's use is pretty consistent with the way JEE (or at least the servlet spec) uses it.

          It's certainly a better notation than my old perl framework that had conversation-like constructs, and it called them "scopes" throughout, giving rise to the notion of a scope going out of scope.

          The javadoc could probably stand some more detail though :-/

          • 2. Re: Seam suggestion -> change Scope and ScopeType annotation

             

            I think of a context as a closure over a scope.


            yikes! But that's not what I'm getting at - mainly, it's about simplifying the number of terms used to express the same thing.

            • 3. Re: Seam suggestion -> change Scope and ScopeType annotation
              gavin.king

              I think I usually use "context" when I'm thinking of multiple instances of the same scope, and "scope" when I'm thinking of different scope granularities. But I'm not always very strict about that, and the docs may not always adhere to that.

              So for example, there is a many-to-one mapping between instances of org.jboss.seam.contexts.Context (a "context") and org.jboss.seam.ScopeType (a "scope").

              Really, I should have called ScopeType simply Scope, to remove the confusion, but I was trying to be consistent with EJB3 enum naming conventions.