Part II: Other Benefits Gained from the Code Document Object Model

The Code Document Object Model presents us with other benefits, except for the ones describe in part I of this article:

  1. Working with .NET is not limited to a single language and one could code in languages such as C#, VB.NET, Managed C++, JScript.NET, J#, NetCOBOL, Eiffel# and other languages that implement the CLI. Using the Code DOM gives a single representation for all of these languages.
    For instance, using the Code DOM, I could save my object graph to both a C# document and a VB.NET document, by altering only a few lines of code.
  2. The logical structure of a code document is not a flat one, even though its physical structure is flat. A code document contains namespaces, classes, methods, loops, etc.
    All of these code structures are contained inside one another, creating a hierarchical structure. This is the way Code DOM represents the document.
    For instance, should we take a document describing one class with one method, the object representing the method would be contained in the object representing the type, which in turn would be contained in the object representing the namespace, and so on.

Please note: The Code DOM is not a compiler. It simply represents code in an object graph. In order to check for the code’s correctness, it must be sent to a compiler.

Advertisements

One thought on “Part II: Other Benefits Gained from the Code Document Object Model

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s