Uploaded image for project: 'Fluid Infusion'
  1. Fluid Infusion
  2. FLUID-4914

Should be possible to match a demands block context name against any element in a grade hierarchy

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.4
    • Fix Version/s: 1.5
    • Component/s: IoC System
    • Labels:
      None

      Description

      A crucial requirement for polymorphism is to resolve a context name onto any grade name in a component's hierarchy. A paradigmatic case, for example, is GPII's "dataSource" hierarchy -

      fluid.defaults("gpii.dataSource", {
      gradeNames: ["autoInit", "fluid.littleComponent"],
      components: {

      modelParser:

      { type: "gpii.dataSource.modelParser" }

      },
      invokers:

      { get: "gpii.dataSource.get" }

      ,
      nickName: "dataSource", // framework bug FLUID-4636 - this is not resolved
      });

      fluid.demands("gpii.dataSource.modelParser.parse", "gpii.dataSource.modelParser", {
      args: ["

      {dataSource}

      .options.responseParser", "

      {arguments}

      .0"]
      });

      gpii.dataSource.preInit = function (that)

      { that.nickName = "dataSource"; // work around FLUID-4636 }

      etc. - it is a clear expectation of any concrete standin for dataSource that the demands block appearing above, for example, should continue to resolve, even if its concrete class is different. Historically the only means of dealing with this situation has been manual application of a "nickName", the only available source for user customisation of context names. To add insult to injury, due to a further bug FLUID-4636 it was impossible even to write this in component options but it had to be stuck in using a preInit function as above.

      All the full names and nicknames for all names through the grade hierarchy should be available for matching as context names.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jobara Justin Obara
              Reporter:
              antranig Antranig Basman
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: