1. Put the client on the client
thin servers and rich clients
on the Open Web
André Heie Vik
Consultant, Miles AS
2. Miles and Open Source
We are 36 consultants in Bergen and Oslo
Miles is a company driven by its values
• competence
• «warmth»
Open Source fits well with these values
Quality more important than ideology
Activities
• Open Source tools are a part of most of our work
• develop OpenSSO integration (with Sun)
• releasing our development tools as OSS
2009 CommunityOne Conference: North | no.sun.com/communityone 2
3. Learn about the advantages of moving logic
from the server to the client, and why and
how this can be done using the
technologies of the Open Web
2009 CommunityOne Conference: North | no.sun.com/communityone
4. Where is the client in
your web application?
The server stores all client state
The server generates the user interface
Most user actions result in a page reload
The application can’t work at all without the server...
So what is the browser really? Client or viewer?
What is the alternative?
2009 CommunityOne Conference: North | no.sun.com/communityone 4
5. Thin Server Architecture
http://www.thinserverachitecture.com/
All functionality that can possibly
be implemented on the client side
should be implemented on the client side.
All communication with the application server
should be using services.
No part of the client should be evoked,
generated or templated from the server-side.
The logic in the server will only implement
the following functionality:
• Security
• Business logic
• Proxying
2009 CommunityOne Conference: North | no.sun.com/communityone 5
6. Scalability
Thin Server advantages
Client state does not consume server resources
All UI generation is moved to the clients
• If it can be moved to the client,
it will scale with the number of clients
Application download can be separated
from the application server
Application server serves data only
Data is less specific to the user, and can be cached
more easily
2009 CommunityOne Conference: North | no.sun.com/communityone 6
7. Faster response
Thin Server advantages
User interaction is handled locally
No full page reloads
Server calls are asynchronous, and
only needed to fetch new data
2009 CommunityOne Conference: North | no.sun.com/communityone 7
8. Service reuse
Thin Server advantages
Services built for the client
can be reused for integration
Existing services can be used by the client
Reduces duplication, no need to maintain separate
interfaces for web clients and service clients
2009 CommunityOne Conference: North | no.sun.com/communityone 8
9. Offline use
Thin Server advantages
User interfaces logic resides on the client
Client can be used without the server
Easier to create offline modes
Can be handled seamlessly by the framework
2009 CommunityOne Conference: North | no.sun.com/communityone 9
10. Clean programming model
Thin Server advantages
Clear division between client and server
Less complexity
• no abstracted client on the server
• less magic
Easier to test and debug, both together and separate
Client side (UI) can be developed
without server and vice versa
• designers: pure HTML/CSS
• front-end developers: pure HTML/JS
• back-end developers: no UI logic
2009 CommunityOne Conference: North | no.sun.com/communityone 10
11. The Rich Open Web
and why it matters
The Open Web is the vision of a web based on
open standards, as opposed to technologies
controlled by a single company
Mozilla wants to create a «Open Web Platform»
In the next generation of browsers, most of the
applications that currently require proprietary RIA
runtimes could be implemented in the browser
Works well on advanced mobile platforms
2009 CommunityOne Conference: North | no.sun.com/communityone 11
12. Why the browser?
The browser is a mature and evolving platform
Rock-solid HTTP client
Huge improvements in JavaScript performance
HTML 5 adds client storage, canvas, and
concurrency (web workers)
Advanced and solid JavaScript frameworks
Desktop integration is possible too
Builds on what we already use and know well
2009 CommunityOne Conference: North | no.sun.com/communityone 12
13. What kind of services?
JSON is JavaScript's native language
HTTP is the browser’s native language
REST and JSON is much easier to do in
JavaScript than SOAP and XML
But of course, you can do SOAP
in JavaScript if you really want to!
2009 CommunityOne Conference: North | no.sun.com/communityone 13
14. Challenges
Deep linking, history and the «back»-button
Search engines
Existing services
Cross Domain AJAX
Browser support
Accessibility
Rich interaction is difficult
2009 CommunityOne Conference: North | no.sun.com/communityone 14
15. How do you get started?
Client: The Dojo framework is a good starting point
• easily bind services to UI controls as data stores
• comet support for live updates, seamless offline mode
• ExtJs has similar features
• JQuery is good at what is does
Server: Keep It Simple, Stupid
• Persevere is interesting (RESTful JSON database)
• CouchDB as an application server?
• or use or build your own services
• Just keep it simple and thin!
2009 CommunityOne Conference: North | no.sun.com/communityone 15
16. Summary
Thinner servers can make web development
less complex, so you can build better applications
The Open Web is a great platform – do you really
need to use a proprietary RIA technology?
It’s easy to get started!
• http://www.dojotoolkit.org/
• http://www.persvr.org/
• http://www.sitepen.org/blog/
2009 CommunityOne Conference: North | no.sun.com/communityone 16
17. Put the client on the client
thin servers and rich clients
on the Open Web
André Heie Vik
andre.vik@miles.no