Discussions

News: ItsNat v0.3: Pure SVG and Mobile Browsers with AJAX

  1. ItsNat, Natural AJAX, is an open source Java AJAX Component Web Application Framework. ItsNat approach "The Browser Is The Server" (TBITS) simulates a Universal W3C Java Browser in the server, client events are sent to the server via AJAX and converted to W3C Java DOM Events, changes in DOM server are automatically sent to the client as JavaScript updating the client DOM. In ItsNat the markup is defined using pure X/HTML files with no logic (templates). View logic is coded in pure Java using Java W3C DOM APIs promoting reusing and the goodness of Object Oriented Programming. ItsNat is heavily based on AJAX, AJAX is not a simple add-on, because UI events are sent to the client using AJAX when a DOM event listener is registered in the server. Defines optional components like buttons, lists, tables and trees reusing Swing data and selection models. Any DOM element/subtree can be associated to a component including SVG elements. Based on AJAX ItsNat allows COMET programming and server-sent events without special servers and browsers (you do not need to wait for HTML 5). New features introduced in version 0.3: * Added support in addition to MSIE 6+ and FireFox 1+ to the following desktop browsers: Safari 3+, Opera 9+ and QtWebKit (Qt 4.4). * ItsNat brings AJAX, COMET, server-sent events etc to the following mobile browsers: Opera Mini 4, Opera Mobile 8.6, NetFront 3.5, Minimo 0.2, IE Mobile 6 (Windows Mobile 6), iPhone/iPod Touch, Android, S60WebKit (S60 3rd, Nokia phones), Iris 1.0.8 and QtWebKit (Qt 4.4). * Pure SVG support FireFox 1.5+, Safari 3+, Opera 9+ and QtWebKit support SVG pages with scripting and AJAX. Version 0.2 supported SVG elements embedded in XHTML, v0.3 introduces pure SVG support. ItsNat manages pure SVG pages the same as X/HTML including DOM events, COMET, server-sent events etc. SVG is a very important web technology because is necessary to compete with non-web technologies like Flex or Silverlight. Links: Project Web site Download and Release Notes Online Demo with explained examples and source code. * Do you think this is the time of the mobile web revolution? * Does AJAX/COMET support in mobile browsers start a new generation of "ever connected" web applications? * Are SVG and canvas are the way to compete against Flex using standard web technologies?
  2. Looks like a cool framework to me, I very much like the concept of programming on the server and have the client updated automatically, what i dont like is the w3c dom api, why not a less verbose and more type safe api?
  3. Looks like a cool framework to me, I very much like the concept of programming on the server and have the client updated automatically, what i dont like is the w3c dom api, why not a less verbose and more type safe api?
    ItsNat promotes coding in the server with the same paradigm as in client, and in client the standard API is W3C DOM (OK with some differences in MSIE). In Java you only need to access DOM node properties using get and set methods but the programming style is the same. There are some utilities to make your DOM coding life easier, for instance: * ItsNatDOMUtil with methods like get/setTextContent * ItsNatTreeWalker is very similar to the standard org.w3c.dom.traversal.TreeWalker with only static methods and specific methods to traverse a tree by Element, ignoring text nodes, comments etc (99% we traverse a DOM tree in this way). * ElementListFree : manages an indexed list of the Element nodes below a parent node, furthermore implements java.util.List including Iterators and ListIterators. You can use the typical algorithms of java.util.Collections * ElementList : similar to ElementListFree but in this case any data object can be rendered as the content of a list item using pluggable renderers (a default renderer is provided). * ItsNatList based components: binds a Swing data model a selection model a list of elements and UI events. * The same for tables and trees... The Feature Showcase contains many examples about these utilities.
  4. I clicked through the demo. It seems that is has nice support for various events although sending all mouse clicks and movement to the server is probably not a good idea anyway (and the demo text says it). How do you see your framework compared to GWT and AjaxSwing? GWT would allow pure Java application to run in the browser without server roundtrip. It's components are basic but ItsNat components seem to be even more basic. GWT has its issues but fundamentally it allows writing a browser based JavaScript client in pure Java. AjaxSwing does a very nice job at converting Swing applications into AJAX websites. It has the same limitations that ItsNat and other server side frameworks in that many operations have to go over the network which slows done the response time. But AjaxSwing has nice support for all Swing components and doesn't require programming with custom API. And you can still run your app as Java Swing. So why would someone use ItsNat instead of the other two choices that exist for a while?
  5. I clicked through the demo. It seems that is has nice support for various events although sending all mouse clicks and movement to the server is probably not a good idea anyway (and the demo text says it).
    No, no, no, only client events are sent to the server when a DOM event listener was registered on the server. May be you are referring to the mouse over/out and mouse move examples, they only want to show you that can be received too if you want (and managed by the Swing data model of the button too), in fact you don't need button components, any server DOM element can receive these events. Of course these event types (mouse over,out,move) are discouraged in any typical application but may very useful if you run a UI intensive web application in local.
    How do you see your framework compared to GWT and AjaxSwing?
    GWT would allow pure Java application to run in the browser without server roundtrip.
    First of all: GWT is for me a brilliant technology. In GWT you don't need server requests if you don't need server data. Most of the web sites of the world are data-intensive, you are requesting server data again and again. Ok, some UI events are managed in the client in GWT. Think this scenario: you have a data table in a and you want to set in order by column (first by column 1, next by column 2 and so on) when the user clicks something. GWT must to send to the client the necessary JavaScript code to order the data, this code may be more complex than the typical lexicographic order. Besides GWT must to send to the client the code necessary to rearrange the DOM in a table where each cell may decorated in different ways. Think if this approach scales down to a mobile browser. In a server centric approach the server knows how to set in order the data because this data is managed in the original state (your Java data model) and sends to the client only those basic DOM actions to do. In a web with big computing resources and Internet connections speeder and speeder every day accessing to the server is not a serious problem (and we are supposing AJAX).
    It's components are basic but ItsNat components seem to be even more basic.
    What is a component? In ItsNat any server DOM node IS a component: * Can be used to change the UI of the client (DOM APIs). * Receives UI events if you want, dispatching to registered event listeners. * A way to inject user data to the UI: again DOM APIs (value property of an , data in text nodes etc). * A container of other components: if a node is removed then any child node is removed too. Therefore: * Does ItsNat need a "Panel" component? NO. Any node is a container. * Does ItsNat need a "Label" component? NO. Any text node is "a label". ItsNat has a label component, actually is a special pattern based list with 0-1 elements beyond the typical concept of label. * Does ItsNat need a "Image" component? NO, is not a server "img" node enough? * Does ItsNat need a "Link" component? NO, is not a server "a" node enough? * Does ItsNat need a "Frame" component? NO, is not a server "frame" node enough? * Does ItsNat need checkboxes, radio buttons, text boxes and select components? NO. You can believe me, with a bit of work these elements can be used without special components. ItsNat provide components to avoid direct DOM code, to bind data and selection models to markup etc. To show that markup is enough these components have a "markup driven" mode where only server DOM code is necessary to manage these "client components". In ItsNat only pure server DOM (W3C DOM APIs) and a very small subset of ItsNat APIs are enough to develop very complex AJAX applications. I must recognize some typical components are missing like "suggest", date picker, floating menus etc. Current ItsNat components are not full blown and closed, the view is designed by the developer. Components like data picker, suggest, menus are very hard to design with this principle. The problem of "closed" components is the appearance is imposed, CSS may not be enough, when you develop a GWT application the result is a Google-like application, this is a problem in web-site centric applications. And finally in some way ItsNat is a solid foundation to build your "custom web framework" easily. For instance, nothing prevents you of building your custom made full blown components, in typical frameworks outside of provided components there is no hope. You can combine ItsNat with your preferred JavaScript library in the client, in fact this library could be controlled from server and could send data to the server easily.
    GWT has its issues but fundamentally it allows writing a browser based JavaScript client in pure Java.
    The problem is what type of application you are going to code, because in GWT you absolutely lost the control of markup. The UI is fully coded programmatically and is sent entirely in JavaScript to the client, say good bye to web designers. This a problem if you want to develop web sites (today almost any web site is a web application). And finally a paradox: GWT applications are not Google Search friendly. ItsNat uses the classical approach of templates, templates are pure X/HTML (or SVG) with no logic (ItsNat approach is not the typical view-pull). ItsNat has a "fast load" mode (the default) in this mode the server DOM is rendered as normal HTML when the initial page is loaded. And with "permalinks" any desired state of a ItsNat based application with AJAX is "searchable" by search engines.
    AjaxSwing does a very nice job at converting Swing applications into AJAX websites. It has the same limitations that ItsNat and other server side frameworks in that many operations have to go over the network which slows done the response time. But AjaxSwing has nice support for all Swing components and doesn't require programming with custom API. And you can still run your app as Java Swing.
    ItsNat IS NOT a Swing forced clone in web, it reuses Swing when possible, for instance data models and selection models are UI agnostic, is an error to reinvent the wheel. And is not pixel based. One of the most interesting features of HTML is how a page is resized automatically without using special artifact like layout managers. ItsNat has nothing to do with AjaxSwing.
    So why would someone use ItsNat instead of the other two choices that exist for a while?
    I haven't talked about COMET, server-sent events, remote views, wide range of mobile browsers... I'm waiting for new arguments :) Final note: ItsNat isn't all for all.