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

ComponentProvider should lookup superclasses and interfaces of the required component

    XMLWordPrintable

Details

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

    Description

      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

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Checklists

                    Task DoD