O'Reilly logo

Programming Atlas by Christian Wenz

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 8. Client Script Library

In addition to delivering a lot of Ajax functionality in an easy-to-use framework, Atlas provides a number of additions to JavaScript that can make its use for client coding easier. Among these are OOP-style constructs, such as namespaces, inheritance, and interfaces, as well as client-side reimplementations that resemble .NET constructs such as StringBuilder.

Atlas OOP Features for JavaScript

As you have seen in Chapter 2, JavaScript does have some OOP capabilities, but they are no match for those in programming languages like Visual Basic or C#. However, it’s relatively easy to add new features to JavaScript using JavaScript itself, something that the Atlas team has exploited.

To facilitate OOP development, Atlas adds to JavaScript some OOP-type features, which are covered in this chapter. These include namespaces, abstract classes, and interfaces. The additional features are designed to help you architect and write more structured client-side code. They apply not only to Ajax applications, but can also be used with any JavaScript code that you write.

The Atlas runtime script library is sufficient for using the JavaScript OOP features. To use this runtime library, include the Atlas ScriptManager element in the page. It will look like this:

<atlas:ScriptManager ID="ScriptManager1" runat="server"
  EnableScriptComponents="false" />

If the EnableScriptComponents attribute is set to false, you do not have access to Atlas controls, but still can use the client-site ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required