Atlas, scripting functionality and delegates
Atlas promises a lot of things, and one of the things I wanted to mention was the way it brings a familiar .Net development paradigm to the javascript world. Atlas makes the javascript look very much like its .Net server side counterpart in terms of development framework. What does that mean? Well lets take an example.
Delegates are a typical .Net framework feature, and Atlas has made them available and useable on javascript. In fact, they are an integral part of the Atlas client script framework. To create a delegate using the Atlas framework, simply use the:
_myDelegate = Function.prototype.createDelegeate(this,this._myFunction);
function _myFunction(sender, eventArgs)
{
....
}
This delegate can then be used for specifying callback functions to other system events that require callbacks. Again, another example using the Atlas provided timer object:
_timer = new Web.Timer();
_tickHandler = Function.CreateDelegate(this,this._onTimerTick);
_timer.set_Interval(500);
_timer.tick.add(_tickHandler);
_timer.set_enabled(true);
Here we are creating a new timer object. Then creating a new delegate which is assigned to the 'tick' event and will be invoked every 500 milliseconds. Finally we enable the timer so that it begins to fire events at the designated intervals.
Atlas provides a large abstraction over current scripting methods and attempts to provide the familiar server side development model on the client. Part of this is the base class framework implementation that Atlas offers. Note: This does not mean it is the goal of Atlas to get everyone coding in javascript again, but it does provide a powerful and rich framework from which to build upon. I shall be posting more details on this as time progresses so keep an eye out.