Try OpenEdge Now
skip to main content
GUI for .NET Programming
Overview : Object model and architecture : Incorporation of the .NET object model
 

Incorporation of the .NET object model

ABL supports access to .NET objects by essentially incorporating the entire .NET class hierarchy within the ABL class hierarchy. ABL does this by viewing the .NET root class, System.Object, as an immediate subclass of the ABL root class, Progress.Lang.Object. In this way, every .NET class appears to be a part of the ABL class hierarchy and functions like an ABL class when referenced by another ABL class or procedure.
For example, if you reference the .NET class, System.Windows.Forms.Button, in an ABL session, ABL shows it to have the following class hierarchy:
Progess.Lang.Object<----------------------------- ABL root class
  System.Object    <----------------------------- .NET root class

    System.MarshalByRefObject                     .NET class hierarchy
      System.ComponentModel.Component             |
        System.Windows.Forms.Control              |
          System.Windows.Forms.ButtonBase         |
            System.Windows.Forms.Button           V
Thus, any System.Windows.Forms.Button instance inherits the properties and methods of Progress.Lang.Object. This means that .NET class instances appear on the ABL session object chain, and you can manage them in much the same way as ABL class instances.
Note: In addition to classes, all supported .NET types, such as interfaces, enumerations, and structures are accessible as defined by the .NET type hierarchy derived from System.Object. For more information, see the sections on data type mapping in Accessing and Managing .NET Classes from ABL.
Similarly, if you derive a .NET class with an ABL class, it appears in the class hierarchy as you might expect:
Progess.Lang.Object<----------------------------- ABL root class
  System.Object    <----------------------------- .NET root class

    System.MarshalByRefObject                     .NET class hierarchy
      System.ComponentModel.Component             |
        System.Windows.Forms.Control              |
          System.Windows.Forms.ButtonBase         |
            System.Windows.Forms.Button           V
              Acme.Controls.CustomButton           ABL-derived .NET class
In reality, such an ABL-derived class exists at run time as both an ABL class in the ABL Virtual Machine (AVM) and as a parallel .NET class in the CLR, hence the reference to an ABL-derived .NET class. Also, if you implement one or more .NET interfaces in an ABL class, that ABL class also exists as an ABL extension of a .NET class in both the AVM and CLR. For more information, see GUIfor .NET run-time architecture.
* .NET objects on the session object chain
* Compile-time access to .NET objects