Martes, Enero 10, 2012

Layers of Protocol

What is a Cloud Application

Cloud applications are a sort of hybrid between traditional desktop applications and traditional web applications.  They offer the benefits of both of these types of software without many of the drawbacks.  Like desktop apps, cloud applications can offer a rich user experience, immediate response to user actions, and offline mode.  Like web apps, cloud applications do not need to be installed on a computer and can be updated at any time simply by uploading a new version to your web server.  They also store their data in the cloud - offsite under your control.

To write effective SproutCore code, its important for you to understand the differences between web applications, desktop applications, and cloud applications.

 

Behold the Web App


Traditional web applications are designed to run on a server.  Both the app business logic and user data lives "in the cloud".  Sure you may move some of these bits temporarily to the web browser via Ajax, but for the most part the heavy lifting is done in the cloud.


From this point of view, tools like GWT actually make a lot of sense.  You spend most of your time thinking about what's happening in the server.  It's both annoying and difficult to switch over and think about styling HTML and hacking JavaScript on the client.

Using Java for both sides allows you to think more abstractly about your business logic and let the client take care of itself.  Logical.

The drawback here is that all of your important business logic potentially happens many thousands of miles away from your user.  This necessarily limits your ability to provide rich interaction, immediate feedback, or to work offline.

Even apps like Gmail, which are blazingly fast for web apps, have a generally slower pace than something like a native Outlook client because of these limitations of the web.

 

And Also the Desktop


Traditional desktop applications, on the other hand, work completely the opposite way.  In many desktop apps, there is no cloud.  All of your application data and business logic lives on the client.


This is the world in which Cocoa, .Net, Java Swing and the various desktop frameworks were written.  Everything is local.  Always there.  You can provide rich interaction, immediate feedback, and, of course, working while on an airplane is no problem.

Of course, the desktop approach has a lot of drawbacks.  It's not very portable for one.  Also, in a world where connectedness and the communication are central to just about everything, it takes a lot of code to build a great desktop app that works well with a cloud-based service.

About those Client-Sever apps.  A particular type of desktop app is a traditional "thick" client server app like Outlook or Lotus Notes.  These apps basically fall into the Desktop category.  Although they have the added benefit of storing their data in the cloud, they share all the other benefits and drawbacks of a desktop app. 

 

If the Web App and a Desktop App Had a Baby...


Now enter the Cloud Application.  Cloud apps blend parts of the web and desktop worlds to create something new.  Like the web app, your data lives in the cloud.  Like the desktop app, your business logic downloads to the web browser and lives there instead.


With this approach you really get the best of both worlds.  Your app is easily accessible to anyone with a web browser.  It's really easy and natural to write cloud-centric tools.

Yet at the same time, all of your interaction happens right there next to the client.  Although you can't entirely hide the fact that you are running over the Internet, most of the time you can easily provide rich interactions and immediate feedback.

With this design, of course, it is also easy to cache the user's data locally, enabling full offline mode without any kind of hackery.

One other benefit of this model is that it means you can make your server much smaller and simpler.  Mostly your server needs to process data efficiently and return results as quickly as possible.  As with any service exposed to the internet, you need to also make sure your server is secure - authenticating requests and validating data.  But the overall task is much simpler.  And best of all, better suited to the kinds of things server frameworks are naturally good at.

Cloud apps clearly offer a superior user experience to traditional web apps.  They have largely only become feasible for broad internet use in the last few years though, which is you'll see a lot more of them coming along soon.

Walang komento:

Mag-post ng isang Komento