3 Replies Latest reply on Sep 25, 2005 9:49 PM by gavin.king

    JIRA: Multiple @Roles Feature Request (64)

    jpaagt

      While issuing a new Feature Request about the Internationalization of Validation Messages I found this feature posted by Gavin King. I find it very important that it be implemented.

      Currently, a component class cannot be multiple components.

      If we introduce this:

      @Roles({@Role(name="currentUser", scope=SESSION), @Role(name="user", scope=CONVERSATION)})

      Then that problem would be fixed.

      This is a very serious limitation to JBoss Seam. EJBs should be reusable components, if they area stuck to only one context in Seam, there reusability would be affected.

      Another question: ¿What if I would like to use my components outside of seam? Do I have to modify the code and strip them of all Seam annotations? (I fear that the answer is yes).

        • 1. Re: JIRA: Multiple @Roles Feature Request (64)
          christian.bauer

          Seam components are plain Java classes. The rule is simple: if you don't access the annotations, you don't need to have the annotation libraries (in this case Seam) on your classpath.

          • 2. Re: JIRA: Multiple @Roles Feature Request (64)

             

            "christian.bauer@jboss.com" wrote:
            Seam components are plain Java classes. The rule is simple: if you don't access the annotations, you don't need to have the annotation libraries (in this case Seam) on your classpath.


            Not that this is the best place for debate, but think @Role isn't such a good idea when you can simply outject components that exist within the scope you wish to operate on. You really have to take a look at the component concept in a much larger scope and how object relate. The solution isn't to simply aggregate everything as @Role would promote.

            -- Jacob (Facelets/JSF EG)

            • 3. Re: JIRA: Multiple @Roles Feature Request (64)
              gavin.king

              Jacob and I continue to disagree on this issue. As long as there are a "small" number of roles (2, perhaps 3), I don't see any problem at all with @Role.