Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Loading datasources using inheritance

    If I have a datasource with an inheritsFrom attribute set, I find that I need to cause the 'parent' datasource to be loaded first:

    ... " there is no DataSource of that name currently loaded. Ignoring the inheritsFrom declaration."

    Which makes sense, but it would be nice if the DataSourceManager (I think that's where it would go) loaded it up for me instead of ignoring the declaration.

    It seems to behave that way when resolving references to other datasources from fields using an inheritsFrom attribute - can we do the same here?

    #2
    It does so on the server. On the client, loading a DataSource is an asynchronous network operation, so we can't just follow dependencies transparently.

    Comment


      #3
      I guess I'm missing the point.

      The client issues a request to the server for the first datasource anyway... right? So then why shouldn't dependency resolution happen as a result of that request?

      Comment


        #4
        One reason is that the parent DataSource may already have been loaded when the child is being loaded, and loading it again would be the equivalent of the forceReload flag for DataSource.load(), which would be a surprising consequence.

        However it could be a useful feature to a variant of DataSource.load() which would force all inherited or even related DataSources to be loaded, we'll consider this for the future.

        Comment


          #5
          I'm sure I'm oversimplifying, but if I call DataSource.load now on a ds that's already been loaded, I just get a warning telling me so - I don't believe it forces a reload, unless you've set that flag to true... I don't see why this would need to be any different.

          In any case, it seems like you'd know whether it had already been loaded - so just don't do it if you don't need to.

          Whatever the details, it would really be nice to get that hooked up.

          Comment


            #6
            On the client, when you just pass us a DataSource ID to load, we won't know it has dependencies until the request hits the server. On the server, we'll know the dependencies but won't know what the client has loaded.

            The could all ultimately be worked out - just explaining why it's not trivial.

            Comment


              #7
              Sure, fair enough.

              Is this perhaps a candidate for feature sponsorship?

              Comment

              Working...
              X