Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-3079

ComponentProvider should lookup superclasses and interfaces of the required component


    • Icon: Improvement Improvement
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • None
    • core
    • None

      If ComponentProvider.getSingleton(com.foo.SomeSubInterface.class) is called, and no component is registered specifically for com.foo.SomeSubInterface, the ComponentProvider should look up registration for parents of com.foo.SomeSubInterface (i.e com.foo.SomeInterface, if SomeSubInterface extends SomeInterface)

      This should:

      • remove the need for casting when depending on a specific implementation:
        // instead of:
        SomeSubInterface z = (SomeSubInterface) Components.getSingleton(SomeInterface.class);
        // you should be able to do:
        SomeSubInterface z = Components.getSingleton(SomeSubInterface.class);
        // even if only SomeInterface was configured (i.e if there's only a property for com.foo.SomeInterface)
      • likewise, this should fix MAGNOLIA-3059 – TODO: insert details as to how/why

        Acceptance criteria

              Unassigned Unassigned
              gjoseph Magnolia International
              0 Vote for this issue
              1 Start watching this issue