hk2
  1. hk2
  2. HK2-13

FactoryFor should be automatically applied

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: 2.1.*
    • Fix Version/s: 2.1.*
    • Component/s: None
    • Labels:
      None

      Description

      Consider this code

      @Service
      @FactoryFor(DomainMBean.class)
      public class DomainMBeanAccess implements ConextualFactory<DomainMBean> {
      ...
      }

      The FactoryFor declaration and use of generics makes this have redundant definitions that can also lead to mismatches / errors.

      I propose that the inhabitant generation infrastructure is made aware to look for generics so that FactoryFor becomes optional and implicitly defined, required only in cases where the generic form is not used (i.e., defaulting to Object).

      I further would like to see a level of validation that if they are both used, and inconsistent with one another than an error is generated.

        Activity

        Hide
        tlcksnyder added a comment -

        no longer applies.

        Show
        tlcksnyder added a comment - no longer applies.

          People

          • Assignee:
            Unassigned
            Reporter:
            jeff_trent
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: