Uploaded image for project: 'Seam Social'
  1. Seam Social
  2. SEAMSOCIAL-14

Avoid using an Enum to qualify services

    Details

    • Type: Enhancement
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: OAuth Core
    • Labels:
      None

      Description

      Today the @RelatedTo qualifier use an Enum type to choose the right service (i.e @RelatedTo(Service.Twitter)). This solution is too closed and could be a problem if someone need to extend the framework by adding a new Service since one need to add a value in the Service Enum type...

        Gliffy Diagrams

          Activity

          Hide
          antoinesabot-durand Antoine Sabot-Durand added a comment -

          @RelatedTo should disapear and a new meta annotation need to be created @RelatedToService. It will be used to annotate service qualifier to help distinguish them for other qualifier.

          We also need to create an extension that will create the list of service at the initialisation of CDI container.

          Show
          antoinesabot-durand Antoine Sabot-Durand added a comment - @RelatedTo should disapear and a new meta annotation need to be created @RelatedToService. It will be used to annotate service qualifier to help distinguish them for other qualifier. We also need to create an extension that will create the list of service at the initialisation of CDI container.
          Hide
          antoinesabot-durand Antoine Sabot-Durand added a comment -

          Created Meta annotation @SocialRelated to qualify qualifiers.

          Show
          antoinesabot-durand Antoine Sabot-Durand added a comment - Created Meta annotation @SocialRelated to qualify qualifiers.
          Hide
          antoinesabot-durand Antoine Sabot-Durand added a comment -

          After think for it more deeply, I went back to @relatedTo qualifier with a String Value and not an Enum Value.
          The extension check RelatedTo Annotation on OAuthService bean to find all existing value for @RelatedTo value. Thus if someone add a new Social network it will taken into account automatically when the @RelatedTo(<value>) qualifier is added to the bean.

          Show
          antoinesabot-durand Antoine Sabot-Durand added a comment - After think for it more deeply, I went back to @relatedTo qualifier with a String Value and not an Enum Value. The extension check RelatedTo Annotation on OAuthService bean to find all existing value for @RelatedTo value. Thus if someone add a new Social network it will taken into account automatically when the @RelatedTo(<value>) qualifier is added to the bean.

            People

            • Assignee:
              antoinesabot-durand Antoine Sabot-Durand
              Reporter:
              antoinesabot-durand Antoine Sabot-Durand
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 3 days
                3d
                Remaining:
                Remaining Estimate - 3 days
                3d
                Logged:
                Time Spent - Not Specified
                Not Specified

                  Development