![]() |
Openode
Tools |
|||||||
|
||||||||
ASK |
ASK is intended to facilitate the server side programming of WEBAPPs. The objective is to allow developers focus on the Business and Graphical Logic but working in Java. When developing WEBAPPs we have to deal with the HTML/HTTP complexities...that is, navigation, event handling, session...ASK provides a way to develop your WEBAPPs without caring about all of these complexities letting you focus on your Java Development. The key to success with that is to provide a transparent layer in charge of managing all the communication between the client and the server. This layer will be in charge of keeping the link between the client and the server side application as well as to take the data from the client and put it correclty in the server, either events or data. By the use of this approach it is neither necessary to use Cookies nor URL rewriting, and there is not HTTP Session management at all. The solution implemented is quite simple, first the Application itself is the session, and it is kept in memory and secondly the generated HTML code corresponding with the Graphical Objects include already the necessary information to keep the link. All the information sent from the client is processed by ASK notifying the Graphical Objects with the data coming from the client, including the events management. Here is a small example of how creating a couple of buttons and listen to their event... public
void init(){ public
void mouseDown(SMouseDownEvent evt){ The main difference with other approaches is that an ASK Application and all the Graphical Objects created within it constitute a real client dedicated Application, that means that the Application Components are not shared with other Applications, resuming : ASK Applications are fully stateful. This approach simplifies development quite a lot since the developer do not have to worry about static messages and configurations. If you add to this that he does neither has to worry about navigation nor Session issues the advantadges are evident. |
| Technology |
ASK is developed in Java and runs in the context of any HTTP Server supporting Servlets. The reason why is because the entry point to deliver requests to ASK is by a small Servlet... ASK was tested with Tomcat (4.1.18 at this moment), Jetty 4.0.4, JRun... with no problems at all. As ASK is part of the Openode set of tools it uses other packages like Openode Util... There is no use of technology like JSPs nor Struts... |
| Styles |
Obvioulsy there is something you need to do in order to create the presentation, there is no magic. A typical approach would use XSL/XSLT but ASK does not use this, the reason ? simplicity. When you describe the presentation in ASK all you are doing is writing the HTML code that shall be used to paint your Java Object. Lets see how does this work: we have a Java Graphical Object and a piece of HTML...what we need to do is to put some data of the Java Object in some places in the HTML one...at runtime !!! and this has to be fast, very fast... For doing that ASK uses xengine. This tool takes an object, a xengine style, and an OutputStream and does the following: the xengine style is a plain text file containing several xengine tags which are of type: <xen:pd property="name"/> and <xen:pc name="name"/>. xengine renders the style file sending to the OutputStream everyting in between the tags...but when a tag is found interacts with the Java Object: In case of <xen:pd... requires the Java Object for the data detailed following the getter pattern and sends the result (if not null) to the OutputStream. And in case of <xen:pc... calls a special method of the java object passing the name and the OutputStream...(see Xengine). Lets see a small style example, the HEditBox one when enabled:
Anyway the ASK Graphical Objects contain a method paint(OutputStream out) as Swing ones have a paint(Graphics g). By simply overriding the method you can 'paint' whatever you need...For example here we have the paint method corresponding with the HListBoxOption Graphical Object:
|
| Services & Applications |
With ASK you can develop two kind of applications: Stateful and stateless. A Stateless Application is known as a service and a Stateful as an application. The difference between them is that the Service does not have a link with the client and can serv any number of clients while the Application is linked with a client and provides its functionality only to its client |
| Crash & Recovery |
An important issue when talking about WEBAPPs is transactionability...this is a quite big word...and thus normally big (and heavy) solutions are provided... The answer of ASK to this is the implementation of an application crash & recovery mechanism. The way it works is as follows: if you want your application to use this then after every request your application shall be Serialized...Uff, well, you have the possibility to listen to events regarding this so that you can keep the information you consider necessary to be able to recover the application and continue execution... So, what happens when Server where your application is running crashes ? The previous server will tell the server where the application was said to be re-constructed to recover it by reading the last Serialized Application Data from the Server where it was serialized...as simple as that!! |
| Clustering |
Performace is an issue. The ASK philosophy regarding this is that it has to provide a way to scale easily when the processing requirements increase. ASK proposes a distributed server side architecture where you can setup as many ASK Servers as you need, where you can specify in which Servers run what applications and also the charge each of the servers must support. All the server side architecture is defined in a unique XML file, therefore its configuration is very easy to setup. Honestly I am of the opinion that it is better to have lots of small but powerful and low cost machines rather than big but expensive ones. In fact I have never understood why is it necessary to setup a server with things like Solaris or hosts like HP9000...In my experience Intel low cost machines with Linux are great, powerful and cheap...but anyway this is usually (in my opinion) more a question of marketing against the client rather than real requirements necessities... |
| Other Uses |
| ASK can be used to deliver any kind of data...for example you can use us to provide XML information or any other type of Objects... |