Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

Intro

Prior to V40.14 language gmBasic used the MigrationSupport conventions for stubbing the language runtime support (RTS) framework. MigrationSupport conventions had the following features:

  • The namespaces of the language runtime support stub framework are hard-coded into the system and included MigrationSupport, MigrationSupportUI, and VB6Controls.
  •  Extension method stubs are placed in the MigrationSupport.SystemExtensions class.
  • Stub framework references are identified by scanning the generated code for the string "MigrationSupport" and also scanning the operation streams for references to status="extension" operations.
  • MigrationSupport conventions are deprecated.

Beginning with gmBasic V40.14, gmBasic system uses the gmRTL conventions for stubbing the language runtime support framework. gmRTL conventions have the following features:

  • The namespaces of the language runtime support stub framework are driven by the metalang files. The default RTS namespaces include gmRTL.Core, gmRTL.GUI, and gmRTL.ASP.
  • Extension method stubs may be placed in any namespace. The stubs for status=extensions extension methods are placed in the namespace specified by the Select.ExtensionMethods select. By default this is set in VB7Lang.xml <Select ExtensionMethods="gmRTL.Core" />
  • The gmRTL framework has more classes than MigrationSupport framework providing a more descriptive structure for organizing the framework members.
  • Stub framework references are identified by details in the metalang and by scanning the generated code scanning the operation streams for references to RTS namespaces.
  • gmRTL conventions should be used for all new projects.

Note: stubs for references to COM APIs are handled differently from stubs for references to language operations. COM stub declarations are driven by COM IDFs and based on scanning operation streams for references to COM API elements. 

Impact

Implementing the gmRTL conventions required numerous changes to the metalang and the gmBasic logic. The resulting RTS stubbing process is more precise, faster, and flexible. Furthermore, gmRTL translations look very different from MigrationSupport translations, the changes are refactoring: mainly changing the classes holding the RTS members. Although the organization and structure of the RTL stub framework changes, the locations of RTS references in generated code is the same.

Backward compatibility

Although the internal implementation and gmRTL language mappings are considerably different from MigrationSupport mappings, it is possible to reproduce MigrationSupport-style translations if you apply custom migration rules.  The ScriptRules file below is an example of how to revert gmRTL translations back to MigrationSupport conventions if you must complete a project using the deprecated MigrationSupport.dll assembly.

<ScriptRules>
<!--
Description: Rules to restore MigrationSupport conventions in a gmRTL code.
-->
<ScriptRule id="MSRollBack" Condition="%TaskTag%=='upg'">

<Option>
</Option>

<PostAnalyse>
<refactor>
      <Migrate id="[gmRTL.Core]" migName="MigrationSupport"/>
</refactor>
</PostAnalyse>

<Author>
<Fix name="PostEdit">

   <Replace status="active" name="Reference MigrationSupport.dll rather than gmRTL.Core" lang="csproj">
   <OldBlock><![CDATA[
        <Reference Include="gmRTL.Core">
        ...
        </Reference>
   ]]></OldBlock>
   <NewBlock><![CDATA[
      <Reference Include="MigrationSupport">
         <Name>MigrationSupport</Name>
         <HintPath>..\MigrationSupport\bin\Debug\MigrationSupport.dll</HintPath>
      </Reference>
   ]]></NewBlock>
   </Replace>
   <Replace status="active" name="Remove gmRTL.GUI.dll reference" lang="csproj">
   <OldBlock><![CDATA[
        <Reference Include="gmRTL.GUI">
        ...
        </Reference>
   ]]></OldBlock>
   </Replace>

   <Replace name="gmRTL.Core.GlobalException">
   <OldBlock><![CDATA[gmRTL.Core.GlobalException]]></OldBlock>
   <NewBlock><![CDATA[MigrationSupport.GlobalException]]></NewBlock>
   </Replace>
   <Replace name="using gmRTL.Core;">
   <OldBlock><![CDATA[using gmRTL.Core;]]></OldBlock>
   <NewBlock><![CDATA[using MigrationSupport;]]></NewBlock>
   </Replace>
   <Replace name="using gmRTL.GUI;">
   <OldBlock><![CDATA[using gmRTL.GUI;]]></OldBlock>
   </Replace>
   <Replace name="gmRTL.Core.Enums">
   <OldBlock><![CDATA[gmRTL.Core.Enums]]></OldBlock>
   <NewBlock><![CDATA[MigrationSupport.Utils]]></NewBlock>
   </Replace>
   <Replace name="gmRTL.Core.Enums">
   <OldBlock><![CDATA[gmRTL.GUI.Enums]]></OldBlock>
   <NewBlock><![CDATA[MigrationSupport.Utils]]></NewBlock>
   </Replace>
   <Replace name="gmRTL.Core.App">
   <OldBlock><![CDATA[gmRTL.Core.App]]></OldBlock>
   <NewBlock><![CDATA[MigrationSupport.App]]></NewBlock>
   </Replace>
   <Replace name="gmRTL.Core.ErrorHandling">
   <OldBlock><![CDATA[gmRTL.Core.ErrorHandling]]></OldBlock>
   <NewBlock><![CDATA[MigrationSupport.Utils]]></NewBlock>
   </Replace>
   <Replace name="gmRTL.Core.ErrorHandling">
   <OldBlock><![CDATA[gmRTL.Core.FormatHelper]]></OldBlock>
   <NewBlock><![CDATA[MigrationSupport.Utils]]></NewBlock>
   </Replace>
   <Replace name="gmRTL.Core.ErrorHandling">
   <OldBlock><![CDATA[gmRTL.Core.FormatHelper]]></OldBlock>
   <NewBlock><![CDATA[MigrationSupport.Utils]]></NewBlock>
   </Replace>
   <Replace name="gmRTL.GUI.LineControl">
   <OldBlock><![CDATA[gmRTL.GUI.LineControl]]></OldBlock>
   <NewBlock><![CDATA[MigrationSupport.Line]]></NewBlock>
   </Replace>
   <Replace name="gmRTL.GUI.ShapeControl">
   <OldBlock><![CDATA[gmRTL.GUI.ShapeControl]]></OldBlock>
   <NewBlock><![CDATA[MigrationSupport.ShapeControl]]></NewBlock>
   </Replace>
   <Replace name="gmRTL.GUI.ControlHelper">
   <OldBlock><![CDATA[gmRTL.GUI.ControlHelper.]]></OldBlock>
   <NewBlock><![CDATA[MigrationSupport.Utils.]]></NewBlock>
   </Replace>   
   <Replace name="gmRTL.GUI.FontHelper.">
   <OldBlock><![CDATA[FontHelper.SetName]]></OldBlock>
   <NewBlock><![CDATA[FontHelper.FontChangeName]]></NewBlock>
   </Replace>
   <Replace name="gmRTL.GUI.FontHelper.">
   <OldBlock><![CDATA[FontHelper.SetBold]]></OldBlock>
   <NewBlock><![CDATA[FontHelper.FontChangeBold]]></NewBlock>
   </Replace>
   <Replace name="gmRTL.GUI.FontHelper.">
   <OldBlock><![CDATA[FontHelper.SetSize]]></OldBlock>
   <NewBlock><![CDATA[FontHelper.FontChangeSize]]></NewBlock>
   </Replace>
   <Replace name="gmRTL.GUI.FontHelper.">
   <OldBlock><![CDATA[gmRTL.GUI.FontHelper.]]></OldBlock>
   <NewBlock><![CDATA[MigrationSupport.Utils.]]></NewBlock>
   </Replace>
   <Replace name="gmRTL.Core.InformationHelper.">
   <OldBlock><![CDATA[gmRTL.Core.InformationHelper.]]></OldBlock>
   <NewBlock><![CDATA[MigrationSupport.Utils.]]></NewBlock>
   </Replace>
   <Replace name="gmRTL.Core.InteractionHelper.">
   <OldBlock><![CDATA[gmRTL.Core.InteractionHelper.]]></OldBlock>
   <NewBlock><![CDATA[MigrationSupport.Utils.]]></NewBlock>
   </Replace>
   <Replace name="gmRTL.Core.DateTimeHelper.">
   <OldBlock><![CDATA[gmRTL.Core.DateTimeHelper.]]></OldBlock>
   <NewBlock><![CDATA[MigrationSupport.Utils.]]></NewBlock>
   </Replace>
   <Replace name="gmRTL.Core.MathHelper.">
   <OldBlock><![CDATA[gmRTL.Core.MathHelper.]]></OldBlock>
   <NewBlock><![CDATA[MigrationSupport.Rand.]]></NewBlock>
   </Replace>
   <Replace name="gmRTL.Core.MathHelper.">
   <OldBlock><![CDATA[gmRTL.Core.MathHelper.]]></OldBlock>
   <NewBlock><![CDATA[MigrationSupport.Utils.]]></NewBlock>
   </Replace>
   <Replace name="Source.GetControlIndex()">
   <OldBlock><![CDATA[Source.GetControlIndex()]]></OldBlock>
   <NewBlock><![CDATA[MigrationSupport.Utils.GetControlIndex(Source)]]></NewBlock>
   </Replace>
   <Replace name="MigrationSupport.Utils.OLEDropConstants">
   <OldBlock><![CDATA[MigrationSupport.Utils.OLEDropConstants]]></OldBlock>
   <NewBlock><![CDATA[OLEDropConstants]]></NewBlock>
   </Replace>
</Fix>   
</Author>


</ScriptRule>
</ScriptRules>



  • No labels