Uploaded image for project: 'MyFaces CODI'
  1. MyFaces CODI
  2. EXTCDI-140

explicitely annotate @Dependent scoped beans and make them non-final

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.9.2
    • 0.9.3
    • Core
    • None

    Description

      Currently we have lots of Producers which are not annotated with any scope. That means they will be treated as @Dependent scoped beans by default.
      I suggest to explicitly annotate them either @Dependent or @ApplicationScoped (if no state information is being used) because the automatic pickup as @Dependent has side effects which not all people are aware off.

      I also suggest to not declare any bean as final because this prohibits the CDI container to create a proxy for such classes. This currently doesn't happen with @Dependent scoped beans, but this might get changed in future spec versions (auto serialisation support). It also makes it impossible to @Specializes such producers.

      Attachments

        Activity

          People

            struberg Mark Struberg
            struberg Mark Struberg
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: