put the client on the client
DESCRIPTION
Put the client on the client - thin servers and rich clients on the Open Web Presented at CommunityOne North in Oslo, 2009-04-15TRANSCRIPT
Put the client on the client
thin servers and rich clientson the Open Web
André Heie VikConsultant, Miles AS
2009 CommunityOne Conference: North | no.sun.com/communityone 2
Miles and Open Source
We are 36 consultants in Bergen and OsloMiles is a company driven by its values• competence• «warmth»
Open Source fits well with these valuesQuality more important than ideologyActivities• 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
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 stateThe server generates the user interfaceMost user actions result in a page reloadThe 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 5
Thin Server Architecturehttp://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 6
ScalabilityThin Server advantages
Client state does not consume server resourcesAll 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 serverApplication 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 7
Faster responseThin Server advantages
User interaction is handled locallyNo full page reloads
Server calls are asynchronous, and only needed to fetch new data
2009 CommunityOne Conference: North | no.sun.com/communityone 8
Service reuseThin Server advantages
Services built for the client can be reused for integration
Existing services can be used by the clientReduces duplication, no need to maintain separate interfaces for web clients and service clients
2009 CommunityOne Conference: North | no.sun.com/communityone 9
Offline useThin Server advantages
User interfaces logic resides on the clientClient can be used without the server
Easier to create offline modesCan be handled seamlessly by the framework
2009 CommunityOne Conference: North | no.sun.com/communityone 10
Clean programming modelThin Server advantages
Clear division between client and serverLess complexity• no abstracted client on the server
• less magic
Easier to test and debug, both together and separateClient 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 11
The Rich Open Weband why it matters
The Open Web is the vision of a web based on open standards, as opposed to technologies controlled by a single companyMozilla 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 12
Why the browser?
The browser is a mature and evolving platformRock-solid HTTP client
Huge improvements in JavaScript performanceHTML 5 adds client storage, canvas, and concurrency (web workers)Advanced and solid JavaScript frameworksDesktop integration is possible too
Builds on what we already use and know well
2009 CommunityOne Conference: North | no.sun.com/communityone 13
What kind of services?
JSON is JavaScript's native languageHTTP 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 14
Challenges
Deep linking, history and the «back»-buttonSearch engines
Existing servicesCross Domain AJAX
Browser supportAccessibilityRich interaction is difficult
2009 CommunityOne Conference: North | no.sun.com/communityone 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 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/
André Heie [email protected]
Put the client on the client
thin servers and rich clients on the Open Web