Ext JS 3.0 vs CP2JavaWS & Direct2CP

Posted: September 20, 2009 in IT/Dev
Tags: , , , , , , , , , , , , , ,

The RC2 of Ext JS 3.0, unveiled last June, 3 (that was just one day after the 0.7 version of CP2JavaWS, that brought management for automatic asynchronous and buffered remote access for TableView) provides a CRUD mode that is close to CP2JavaWS’s Direct2CP one (presented last July, 14, and completed August, 2 – I wasn’t aware of Ext JS new features at that time).

Using Ext JS we create a Reader object (manages deserializing/JSON to fields mapping), Writer (for serializing/fields to JSON mapping) and Store object (url of remote programs that manage read, create, update and delete). We can see examples here and there (RESTFull store), and simpler examples wihout server backend (Dynamic Form and binding from a local xml file). On the Proxy object we can also specify an index range (autoLoad), that allows buffered access (Buffer Grid).

The Ext JS architecture ensures a good separation and provides advanced customization of rendering and behaviours for master and detail views. However CP2JavaWS provides these specific features :

  • only one line of code needed to create a fully working CRUD master/detail view (see here the required code when using Ext JS), automatic asynchronous and buffered access, sorting, form (detail view) controls that depends from their property type (as with Ext JS’s Dynamic Form). We just have to specify the CP business class name. All of the Ext Js features are accessible from a unique component, that allows same level of customization : columns displayed in the table view, custom detail view if needed, custom remote service if needed (instead of the provided generic DAO service).
  • provides a generic DAO service that doesn’t require any coding or setting on the server side, works on the object level and manages full database access cycle (through Hibernate) – Ext JS’s RESTful Store demo just simulates a database using session. Then CP2JavaWS’s Direct2CP is probably the most suited for a Java backend (instant work without any coding nor config).
  • allows to call directly an existing Java application/business services layer (based on Spring or another container) as it works at object level, and without additional configuration.
  • manages complex objects (objects graphs with nested, heterogeneous collections and references) both on client and server side : it then allows to display/edit any nested property, using paths, and the generic detail view creates an editing field for all of these nested objects attributes. Next version of CP2JavaWS will allow to specify (restrict) the editables properties in detail view (as we still can for the table view) – for now we can either edit all the object’s graph properties, or pass a custom detail view (has then to manage controls creation).
  • provides management for technical or business (and multiple) key(s), without additional configuration. Hidding of id field(s) depending on the mode and editing step is automatic, as new id affectation.
  • manages retreiving of value/label pairs for combo lists and radio buttons groups (through a remote service or local data).
  • choose automatically proper control from combo lists and radio buttons.
  • completely free (a 329$ license per developper is required for Ext JS).

Moreover CP2JavaWS provides full Digest authentication (Basic only with Ext JS), automatic switch to JSONP if required, and full jsession id tracking per endpoint.

Note : support for in-table editing (instead of using a detail view), still available in Ext JS, will be added soon into Cappuccino’s CPTableView. In fact it is an historical feature of Next/Cocoa’s NSTableView (the proper delegate method is still listed – commented – in CPTableView). In the same way columns reordering is planned.

Ext GWT 2.0 (available since July, 9, and priced the same as Ext JS 3.0) includes the new buffered Grid View, Row Editor, and still allowed (thanks to its generation step) to easily add Java CRUD management on the server side. However we still have to write a lot of code (see the source code of GXT Grid Store Data Binding example – also not faster to load than a CP application) and we are then stick with GWT limitations compared with Cappuccino :

  • requires a generations step (not elegant and less smooth development cycle), whose generator isn’t open source,
  • generated javascript very hard to deep debug,
  • based on the old Swing components model (very limited compared with Cocoa concepts),
  • does not allow integrating with Cappuccino (we then lack high level features like evolved graphics engine, undo/redo, drag&drop, advanced and automatic layout management, delegation chain and powerful runtime, etc.).

By using Ext JS 3.0 (pure javascript), integration with Cappuccino is more likely, however it is of very limited interest from the previous statements (and CP2JavaWS’s Direct2CP mode still is built on top of standard/expected Cocoa delegate methods).


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s