TObject

Top  Previous  Next

TObject

 

In traditional Object Pascal all classes inherit from a root type called TObject. This was also the case for Delphi Web Script, from which Smart Pascal evolved. In order to better be able to import classes written in Javascript - which is extremely important with regards to having full support for the DOM (document object model) and the full spectrum of JavaScript modules - dependency on TObject as the root of all class types had to be altered. See for instance, TVariant in the example bellow:

 

mytoggle_plus1TObject: the root type of Pas2JS

 

 

 

 Simple example

 

True object inheritance

JavaScript does not support true OOP in the ordinary sense of the word, which makes it exceedingly difficult for classical web-designers to create reusable components or manage large scale projects. But Smart delivers full OOP running under JavaScript!. Our compiler technology generates a real-life VMT (virtual method table) in JavaScript, which means that you can write objects and inherit from them just like you do in Delphi. This gives you a tremendous advantage over classical web developers that must rely on a wide scope of JavaScript libraries, libraries that rarely co-exist without causing browser instabilities. With Smart this is not the case � here you can enjoy the same freedom of rapid, object oriented software architecture as you would under Delphi or Visual Studio.