The CSO Gateway
Classes, Interfaces, Enums
The CSO Gateway supports not only client-side classes but also interfaces and enums. The Microsoft Ajax client-side library provides 3 methods to register new client-side types: registerClass, registerInterface and registerEnums. Once a type is registered, it can take full advantage of the Type class and other extensions provided by the Microsoft AJAX library.
Inheritance, Interface implementation, composition
Client side classes can have a base class, derived classes and implement interfaces. Instances can be composed of instances of other classes, not just primitive types.
Usually, almost no action from the developer is necessary to create a client-side type as the CSO Gateway is creating them at runtime by introspection of the equivalent type on the server-side. Some control on how the type is generated is given to the developper through code attributes.
Automatic creation and ordering of script tags for external scripts
Using of the CSO Gateway will cause a certain number of external script files to be needed on the client side: one script 'file' per type (classes, interfaces, enums) used, classes might have an extension file, etc... All these scripts will have dependencies one on another and will have to be imported with <script> tags in a certain order. Fortunately all of this is managed automatically by the CSO Gateway Importer control.
Easy to use
The CSO Gateway is powerfull but very easy to use. You install the CSO Gateway in your web project by creating a reference to a dll and simple entity objects are brought on the client side by decorating a class with an attribute and assign the object to a web control.
Customizable and Extensible
This section describes features that will be available in future releases
About this document
The CSO Gateway is in its BETA phase and the documentation is not complete. Perharps the most important piece missing is the reference (the exact behavior of the CSO Gateway). On the other hand, the API is pretty complete, both client-side and server-side, and what is in the Getting started section is more than enough to get you started with the CSO Gateway.
To make the discussion consice, this document uses a number of custom terms like cso-native type and cso-compatible type. Refer to the Glossary for their definition.
In its current state, this document is strongly C#-biased. It is a goal though not a priority to make it equal for C#/VB.NET/C++.
The first line of codes of what is now the CSO Gateway were written in March of 2007. At that time, people at my workplace were using JSON without the help of a serializer. Huge, complex and buggy for loops nested 10 deep were used to generated chaotic JSON strings and I hated it. Around the same time I was reading an AJAX book and I became aware of the object-oriented extension of the Microsoft AJAX library.
If you use the CSO Gateway, you can contriubte by:
- letting me know of bugs you encounter. Go to the CSO Gateway developement website and create a new item in the Issue Tracker section.
- telling me what the next features of the CSO Gateway should be by starting a new thread in the the discussion section of the development website.
- implementing new features yourself or fix bugs yourself. And if you wish to see these changes added to the CSO Gateway please send them to me.
The CSO Gateway is an open source project developed on my personal time. If you use the CSO Gateway, find it usefull and would like to see it improve,
you can support future development by making a donation. Paypal is an easy, fast and secure way to donate.