Como Elegir Framework
Como Elegir Framework
and be surprised
Agosto 2010
THE PROBLEM OF CHOOSING Choosing the appropriated web framework which fits your requirements and needs, conveniences, desires, tastes is not an easy task
August 2010
THE PROBLEM OF CHOOSING These slides propose and advocate some criteria to pick the right framework
Advocating for freedom of choice, freedom of design, robust, security Discarding options (that is, frameworks)
Click
August 2010
Many of them are very similar Some strong criteria are very important Most of frameworks can be classified by groups
August 2010
CRITERION: JVM in server The Java platform is the most robust, secure, speediest and richest for web development
August 2010
Coding in JavaScript
Do you really want to code this way?
August 2010
CRITERION: Client-Centric?? (cont.) Coding in JavaScript: the myth of Rich Interface Application = JS Library
RIA = beautiful web, Single Page Interface, with movements and opacity changes Beautiful Web
Good design of HTML, CSS, images (nothing to do with JS)
10
August 2010
Coding in JavaScript
NO THANKS!!
11
August 2010
GWT
Allows coding JS in Java GWT compiles Java code as JavaScript sent to the client Visual logic (and some business logic) is executed only in client Solves the problem of coding in JS BUT MORE PROBLEMS REMAIN
12
August 2010
Components black-boxed
Almost only CSS customization
Cryptic generated JS
Only debugging in Java
Jose Mara Arranz 13 August 2010
Client-server custom communication data bridges (GWT-RPC) Duplicity of data management in client and server SOFEA: utopian approach
Impossible sending SQL from browser Eternal fight about what is on each side
Jose Mara Arranz 14 August 2010
CRITERION: Server-Centric
In server-centric business logic and visual logic are executed in server
The server generates markup and/or JavaScript
No need of JavaScript programming
ClientCentric
Data and visual state are together Safer Better options for freedom of web design (templates) Easier Search Engine Optimization compatibility Rule: life in server is more comfortable
Jose Mara Arranz 15 August 2010
16
August 2010
Click
17
August 2010
CRITERION: Dynamic Language?? Initially are very productive But they become a problem when
The source code grows (1000 classes?) Several persons in the same code IDEs cannot help very much
Slooow
http://www.codecommit.com/blog/java/groovys-performance-is-not-subjective
Jose Mara Arranz 18 August 2010
Can you live without a true Find Usages of NetBeans? Can you live without refactoring tools?
19
August 2010
20
August 2010
Event based programming and only partial changes designed and coded
The same as desktop applications
21
August 2010
23
August 2010
26
August 2010
Click
27
August 2010
CRITERION: Not a forced web Tools like EclipseRAP and AjaxSwing are interesting for quickly porting desktop applications to web
The result is a forced web application
28
August 2010
30
August 2010
CRITERION: Templates based on plain HTML with no logic (cont.) JSF flavours. NO!
Black-boxed components
Visual aesthetic is imposed Hard to change, is what you get
Mixed visual design and logic (lots of Java bindings and EL expressions)
Too much Java Reflection, security risk
Struts security hole (in ONGL): http://struts.apache.org/2.2.1/docs/s2-005.html Spring security hole: http://securityreason.com/securityalert/7526
ZK? . NEITHER!
Similar to JSF
I don't think UI Designer would have patient to learn how to polish his web site in ZUL file, they want CSS and HTML
http://stackoverflow.com/questions/327328/any-real-world-experience-of-the-zk-ajaxframework
32
August 2010
Vaadin? NO TEMPLATING!
Visual design fully programmatic!
33
August 2010
(again)
Jose Mara Arranz 34 August 2010
Click
36
August 2010
37
August 2010
38
August 2010
NO ONE??!!
39
August 2010
40
August 2010
Vaadin
Template? What is a template?
42
August 2010
43
August 2010
NO ONE??!!
44
August 2010
45
August 2010
Answer to the fine but can it do? JavaScript minimum or nothing New markup defined as markup (sort of template)
Not as JavaScript We can decide what elements send events Event processing in server can insert/modify/remove our markup
Jose Mara Arranz 46 August 2010
CRITERION: Easy Creation of Custom AJAX Components (cont.) JSF pre 2.0
Tons of hacks Markup management with client JavaScript
https://bpcatalog.dev.java.net/ajax/textfield-jsf/design.html http://www.oracle.com/technetwork/java/javaee/tutorial-jsp-140089.html http://media.techtarget.com/tss/static/articles/content/JSFReference/JSFReferenceCH11.pdf
47
August 2010
48
August 2010
Vaadin
According the manual is not an easy task. The reference manual is sincere:
Creation of new widgets involves a number of rather intricate tasks
http://vaadin.com/book/-/page/gwt.html
A new GWT component must be created, another one for server, code for client/server coordination and data communication, several registries Positive: fortunately management of new markup is Java based (GWT) but pure programmatic (bye web designers)
Jose Mara Arranz 49 August 2010
Click
51
August 2010
52
August 2010
NO ONE??!!
53
August 2010
54
August 2010
A custom tag or custom API is needed for a simple button or text box
Hundreds of custom tags including the basics Web knowledge thrown away
Beyond already made components there is no very much hope (complex task)
56
August 2010
57
August 2010
NO ONE??!!
58
August 2010
59
August 2010
60
August 2010
JSF and ZK
Full of XMLs for configuration and custom tags (a kind of declarative programming)
Vaadin
Is not free of XML based registries
61
August 2010
NO ONE??!!
62
August 2010
63
August 2010
64
64
August 2010
ANOTHER CHANCE TO JSF (with AJAX), ZK and Vaadin This will be the last one!!
65
August 2010
This implies any SPI state should be bookmarkable and in the same time generated with markup
Jose Mara Arranz 66 August 2010
67
67
August 2010
Easy Creation of Custom AJAX Components Not Steep Learning Curve Free of XML and declarative programming SPI in many mobile browsers SPI SEO compatible
August 2010
Click
69
August 2010
NO ONE??!!
70
August 2010
REALLY??!!
71
August 2010
73
August 2010
CRITERION: JVM in server / Java Language ItsNat is coded with Java in server
Other JVM languages are not excluded for development ItsNat applications
CRITERION: Server-Centric
In ItsNat user JavaScript code is not needed
In spite of developers can easily inject custom JavaScript from server In spite of custom JS code and JS libraries can fit together with ItsNat
Generated markup is CLEAN of ItsNat artifacts (id and onXXX attributes not used by ItsNat) Markup layout is absolutely controlled by developers, jQuery /Dojo can play with style attributes for visual effects (movements, opacity)
Jose Mara Arranz 75 August 2010
CRITERION: Single Page Interface ItsNat strongly supports the SPI paradigm But nothing prevents you of page navigation
There is a utility called Referrers Form auto-fill of browsers is automatically canceled (load time) to ensure all data shown are given by the server
Jose Mara Arranz 76 August 2010
CRITERION: Not a forced web Developers have absolute control of layout including in SPI No aesthetic is imposed, no pixel based desktop simulation Swing is optionally used only because its data/selection models (view independent)
Jose Mara Arranz 77 August 2010
Visual logic is executed using Java W3C DOM APIs in the server (including events)
Any change performed to the DOM in server is replicated to the client (custom JavaScript is generated and sent to the client)
Jose Mara Arranz 78 August 2010
80
August 2010
81
August 2010
http://www.innowhere.com:8080/itsnat/feashow_servlet?itsnat_doc_name=feashow.main&featur e=feashow.core.domutils.markupFragments.ex
82
August 2010
CRITERION: Templates based on plain HTML with no logic (cont.) 2. String containing markup converted to W3C Java DOM by
ItsNatDocument.toDOM(String)
http://www.innowhere.com:8080/itsnat/feashow_servlet?itsnat_doc_name=feas how.main&feature=feashow.core.domutils.toDOM.ex
83
August 2010
http://www.innowhere.com:8080/itsnat/feashow_servlet?itsnat_doc_name=fe ashow.main&feature=feashow.core.man.htmlExampleInManual.ex
84
August 2010
ItsNat easily allows to convert any paged web site or app web to Single Page Interface
Clone of ElCorteIngles.es as SPI: http://www.innowhere.com:8080/insites/ Clone of an ExtJS application: http://www.innowhere.com:8080/inexperiments/inexpservlet? itsnat_doc_name=extjsexample
85
August 2010
87
August 2010
CRITERION: Easy Creation of Custom AJAX Components (cont.) Do we need components for reusing in ItsNat? NO!!
A markup fragment (or string converted toDOM() o Java DOM code) and a Java class with DOM management and event listeners => can be reused without some kind of component registration
89
August 2010
90
August 2010
CRITERION: Easy Creation of Custom AJAX Components (cont.) Component creation is so easy like binding a plain HTML pattern
Defined as markup fragment, toDOM o Java DOM code
The HTML pattern (layout) can be defined outside the component and be plugged on component creation
with a data (and selection) model and predefined actions (Java) and DOM (AJAX) events
http://www.innowhere.com:8080/itsnat/feashow_servlet?itsnat_doc_name= feashow.main&feature=feashow.comp.other.customComponent.ex
91
August 2010
100% XML and declarative programming free Nothing prevent of building declarative layers on top
Config. and registries based on XML, custom tags Configuration based on DI frameworks (Spring, Guice) ItsNat is consciously a low/middle level framework
93
August 2010
Mobile Browsers
Android 1.0+, BlackBerry JDE 4.6+ (Flip, Bold, Storm etc), Bolt, Fennec 1.0a1 (a.k.a FireFox Mobile), Pocket IE 6 (Windows Mobile 6 and 6.1), IE Mobile 6 (since Windows Mobile 6.1.4), iPhone/iPod Touch 2.0+, Iris 1.0.8+, Minimo 0.2, Motorola Symphony 1.1, NetFront 3.4+, Opera Mini 4.x, Opera Mobile 8.6x (WinMob and UIQ), 9.5, 9.7 and 10, S60WebKit (since S60 3rd), S40WebKit (since S40 6th), Palm Pre webOS, QtWebKit of Qt for Embedded Linux (Qt v4.4) and Windows CE, SkyFire 1.0 and UCWEB (Java and WinMob).
SVG Plugins
Adobe SVG Viewer v3 and v6 beta, Renesis Player v1.1.1, Savarese Ssrc SVG (adds XUL to MSIE too), SVGWeb, and Batik as applet.
Jose Mara Arranz 94 August 2010
CRITERION: SPI in many mobile browsers (cont.) Pocket IE support of Windows Mobile 6.0 y 6.1 is INCREDIBLE
In later versions (>= 6.1.4) IE Mobile is much better
95
August 2010
The same Java DOM code can generate markup (load phase) or JavaScript (events)
ElCorteIngles.es as SPI SEO compatible: http://www.innowhere.com:8080/insites/
96
August 2010
EPILOGUE ItsNat has many more characteristics some of them are unique
Pure SVG and embedded SVG in XHTML/HTML, remote control of other users, server-sent events, integrated functional testing, modal layers, iframe auto-binding in server, extreme mashups, remote templates, client JavaScript integration
Jose Mara Arranz 97 August 2010
Online Demo
http://www.innowhere.com:8080/itsnat/
98
August 2010