pros and cons of developing a thick clientside app

20
Thick Client-side App Pros and Cons of developing a Raviteja Dodda Co-Founder, Pipal Tech Ventures/DelightCircle [email protected] Twitter, Facebook - @raviteja2007 www.DelightCircle.com Sep 15 th 2012

Upload: ravi-teja

Post on 22-May-2015

5.133 views

Category:

Technology


2 download

DESCRIPTION

This is a presentation/talk given at BangaloreJS second meetup. In this talk, I talked about why and when we should use rendering and templating on the client-side rather than onthe server-side to develop a web app. Then I demonstrated the DelightCircle web app, which is centered around Backbone.js using Mustache.js templating, and some unique hacks!

TRANSCRIPT

Page 1: Pros and Cons of developing a Thick Clientside App

Thick Client-side AppPros and Cons of developing a

Raviteja DoddaCo-Founder, Pipal Tech Ventures/DelightCircle

[email protected], Facebook - @raviteja2007

www.DelightCircle.com

Sep 15th 2012

Page 2: Pros and Cons of developing a Thick Clientside App

What is

Clientside

Templating ?

Page 3: Pros and Cons of developing a Thick Clientside App

What is Clientside Templating?

• Server sends client templates, along with ‘application code’.

• Application code initializes the view

• As user interacts with the view, requests/responses happen between client and the server in JSON.

• Application code updates the view by applying data to the templates.

Page 4: Pros and Cons of developing a Thick Clientside App

What are the downsides of Serverside

Rendering?

Page 5: Pros and Cons of developing a Thick Clientside App

Coupling

Page 6: Pros and Cons of developing a Thick Clientside App

Server-side Load

• Infrastructure• Caching• Dynamic-pages can be expensive.

A Post on Facebook + comment

9.1 KB of Markup

• Transfer of Data + markup for every request

Not Efficient

Page 7: Pros and Cons of developing a Thick Clientside App

Leading to

• Dumb Clients

• Lag

• Unoptimal UX

• Ugly Clientside Code

Page 8: Pros and Cons of developing a Thick Clientside App

Pros of a

Thick Client

Page 9: Pros and Cons of developing a Thick Clientside App

Good Architecture

Decoupled Design

API’s

Page 10: Pros and Cons of developing a Thick Clientside App

API based Multiplatform approach

API

Mobile App Web Mobile Web ????

Page 11: Pros and Cons of developing a Thick Clientside App

Leading to

• Better Structure

• Separation of Responsibilities

• Modular caching

• More static assets

• Simplicity and Power

Page 12: Pros and Cons of developing a Thick Clientside App

Template Engine benefits

• Readable

• Maintainable

• Usable

Page 13: Pros and Cons of developing a Thick Clientside App

Cons of a Thick Client ?

• Complexity

• Performance varies with device

• A build process is generally required

• More state management

• Indexing pages to Search Engines.

Page 14: Pros and Cons of developing a Thick Clientside App

What’s the sweet spot then ?

100% Serverside 100% Clientside

Serverside rendering+ AJAX HTML

Mostly Serverside rendering + JSON viaAJAX with Clientsidetemplates

Only render layoutwith client, everythingelse rendered with JS

Hybrid model

Twitter, Facebook, Google all render HTML server side for initial page load.

Reduces the number of requests

Shares rendering load between clientside/serverside

Page 15: Pros and Cons of developing a Thick Clientside App

How did we develop DelightCircle webapp ?

UWSGI on AWS

Page 16: Pros and Cons of developing a Thick Clientside App

Components

• API Platform approach – our webapp is just another client.

• Backbone.js – Clientside MVC – ProvenLinkedIn Mobile, Foursquare, Do.com,

Groupon, Basecamp mobile, etc.

• Mustache.js – for clientside templating

• JQuery – Of course for DOM manipulation, and ICanHaz.js – which works well with both JQuery and mustache.

Page 17: Pros and Cons of developing a Thick Clientside App
Page 18: Pros and Cons of developing a Thick Clientside App

Crossing Domains• How to communicate between delightcircle.com and api.delightcircle.com

• An iframe from api.delightcircle.com is embedded in delightcircle.com webpages.

• Through the magic of same-origin policy, this technique enables inter-frame communication, while still allowing the iframe to make AJAX requests to its original domain, api.delightcircle.com

• When we need to make api calls, we just need to use iframe’s XMLHttpRequest object from delightcircle.com pages

Page 19: Pros and Cons of developing a Thick Clientside App

Questions?

Next Steps: http://DelightCircle.com,

Thank You

Page 20: Pros and Cons of developing a Thick Clientside App

Download for your Mobile

Scan QR code

DelightCircle is available on Android, Blackberry and iPhone

Search for ‘DelightCircle’ in App Stores

Visit http://DelightCircle.com

Other Phones ? SMS ‘@delight’ to 92431-92431