Announcement

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

    FileAssembly as opposed to DataSourceLoader

    isc = "8.3.js";
    IscBuild = "3.1p.2014-06-02";


    Hi Isomorphic,

    when loading the application DataSourceLoader is always requesting the javascript representation of the datasources from the server, which takes in my environment about 2.5 sek. I have created a FileAssembly file which include all ds file like this:

    <FileAssembly>
    <assemblies>
    <FileAssemblyEntry uri="/datasourceAssembly.js">
    <components>
    <component><type>ds</type><name>tenants</name></component>
    <component><type>ds</type><name>portalGlobalData</name></component>
    <component><type>ds</type><name>currencies</name></component>
    <component><type>ds</type><name>countries</name></component>
    .
    .
    .
    .
    .
    .

    and so on and so forth.

    The result is a javascript which can be then cached from the browser. I have seen the content of that file is the same as the result of the datasourceloader (without this: if (window.isc == undefined || window.isc.DataSource == undefined){ alert("Can't load DataSources - SmartClient runtime not loaded");}) and the order is different.

    Can I use this technique to improve loading performance or there is a better way to do it?

    Thanks in advance
    zapryano

    #2
    You can use this approach, but:

    1. Declarative Security rules that affect the display of fields won't work, since these affect the generated DataSource definition delivered to the user

    2. any DynamicDSGenerators that are user-dependent or time-dependent in some way also won't work

    3. although the file generated by the FileAssembler is cachable, you should still make it protected by your authentication system (assuming you have one), or you'll have some information leakage you may care about

    Comment


      #3
      .. and, for completeness, since you don't seem to have investigated enough to find a root cause for DataSourceLoading being slow, you may be spending a bunch of effort on an optimization that isn't needed.

      Comment


        #4
        ...then I am asking myself why is this approach showed here at all:

        http://www.smartclient.com/smartgwt/javadoc/com/smartgwt/client/docs/FileAssembly.html

        .
        .
        .
        <component>
        <type>datasource</type>
        <name>myDatasource1</name>
        </component>
        .
        .
        .

        Comment


          #5
          Since this is a working approach with known trade offs, why are you surprised that the docs cover it?

          Comment


            #6
            Now I know about these compromises,
            thank you!

            Best
            zapryano

            Comment

            Working...
            X