October 10 2010

modern development goodness for native apps

The explosion of smartphone app development and usage is a great thing for programmers and users alike. People are productive and entertained in so many more places and situations than they ever were.

But as exciting as new smartphones and their apps are, developing for them is like going back three decades in computer science. I remember complaining about the awkwardness of Objective C in the early 80s (almost thirty years ago). It isn’t just iPhone developers who have to suffer with antiquated approaches to software development. Android developers work with Google’s own strange J2ME superset/J2SE subset, created just for Android. As powerful as Android devices are now, the need to not just standardize on J2SE is very dubious (J2SE is certainly not too big for today’s Android). BlackBerry also introduces their own strange superset of J2ME for phones. And it is notoriously difficult to install and develop for. Both environments feature painfully slow emulators that are so cumbersome that most developers just dispense with the emulator entirely and use a device. Windows Mobile is such a travesty to develop for (with a cumbersome multistep provisioning process to their emulator) and such resultant low developer adoption, that Microsoft was forced to start back at square one and create a whole new operating system for smartphones.

Rhodes provides benefits of the last thirty years of progress in computer science to today’s mobile developers. Specifically Rhodes has the following aspects core to its architecture. Our apologies for the long post. In the past we have highlighted these core differences as “MVC, sync, all devices, hosted service”. But we have had many requests to be a bit more comprehensive in our description.

Model View Controller

All major web development languages (Java, PHP, ASP, Python and Ruby) now feature MVC frameworks that are preferred for development. Though there isn’t, and will never be, one language for web development, there isn’t much debate on the value of MVC. But for mobile there is just one way to use the power and maintainability of MVC: Rhodes.

Rhodes allows you to write apps which separate business logic in a Controller from interface design and appearance in a View. Other smartphone app frameworks force you to put everything, interface and business logic, together in the View. Specifically as JavaScript in your HTML pages. If you really want to you can do this in Rhodes: write your whole app as HTML and JavaScript.

But you’d be missing out on the maintainability and separation of concerns that MVC offers. With Rhodes you can write your app logic in Ruby in the controller. And then write interfaces for each controller action in HTML.

App Generator

Rhodes even offers an application generator that creates an initial app based on the structure of your models or business objects in your app. It’s very similar to the scaffolding offered by most modern web frameworks: a controlled with basic “list/create/read/update/delete objects” functionality. For each basic CRUD action views in HTML are also offered. App developers spend most of their time just modifying views as they see fit. No other framework provides an app generator, nor does any SDK. But modern web developers have gotten to expect it and find Rhodes offering it very comforting, familiar and massively productive.

Object Relational Manager

Regardless of your language or development tool used for web development it is doubtful that you are doing most of your development handcrafting SQL statements. You are using Hibernate with Java or ActiveRecord with Rails or Python Django’s built-in ORM or ADO or LINQ with ASP.NET. Code is generally “.find” instead of “SELECT * FROM WHERE…” or “.create instead of INSERT”.

But whether you are writing in Objective C for iPhone or Java for Android or BlackBerry, though, you probably you to hack out your own INSERT and SELECT statements yourself if you want to work with local data. Rhodes provides the only Object Relational Manager available on any mobile device whether from another framework or another local SDK.

Synchronization

Enterprise apps pretty much require local synchronized data to get used. And informational consumer apps benefit as well from local data that is kept current with data from the backend. Older sync servers don’t support modern smartphones such as iPhone and Android. Most iPhone developers that need sync just end up writing their own synchronization. Doing synchronization well though requires supporting “push sync”: data is pushed to the phone when updates happen on the backend (the alternative is polling which results in “always somewhat stale data” and battery drain on the device. Building a one-way polling based sync server is sometimes possible by talented app developers. I have yet to see bidirectional sync OR push-based sync successfully implemented by a mobile app developer.

Enter Rhodes. Though Rhodes supports connecting directly and live to backend applications, Rhodes was built from the ground up to support synchronized data well, with its built-in support for the RhoSync mobile sync server. In additional RhoSync has several compelling advantages over every other sync server yet built. Specifically it is the only sync server that has a built in “no SQL” key value store, making it more scalable than other sync servers which all feature internal relational database servers for caching. RhoSync also performs its push-based sync using the native smartphone push SDKs, which no other sync server does.

Metadata Framework

Every enterprise application used to run a company’s core business has a different schema for its business objects. For every example every application (whether it is Oracle CRM On Demand, SalesForce, or SugarCRM) has varying and customized structure for their core abstractions of accounts, customers, tasks, leads, opportunities or field service issues. The dilemma for software developers trying to provide generically usable true native smartphone apps (not just mobile websites) is that the structure of those objects needs to be present locally on the device.

So how do you ship a generic usable smartphone app that works with any installation of a population enterprise application (CRM or otherwise) on an App Store? In fact, this is a huge problem. Most App Store “enterprise apps” for CRM, ERP or other categories are in fact just “teaser apps”. They are a chance for the consulting services driven company that wrote them to do some paid customer engagements, but aren’t really used by end customers “out of the box” from an App Store. But independent software vendor that want to ship immediately useful mobile app software for backend enterprise applications (and not make money by selling customization services) need some solution to this “varying enterprise app metadata” problem. The metadata framework offered by Rhodes and RhoSync provides this.

Support for All Devices

Rhodes was the first smartphone app framework (we even coined the term) when it was released two years ago. Because of that and its widespread adoption Rhodes now supports far more device operating systems than any other framework: iPhone, Android, Windows Mobile, BlackBerry and Symbian. We only kept Symbian support up to Rhodes 1.1 due to the seeming falloff of Symbian app development. But we are working on support for new Nokia devices with Meego. And of course we will be released Windows Phone 7 support (a separate implementation than Windows Mobile) soon as well.

There are other frameworks that support just iPhone and Android and claim to be “cross-platform”. Some of these frameworks introduce their own user interface abstractions in JavaScript versus using HTML for their user interface as Rhodes does (of course we style that HTML to look native so our user interfaces are just as, if not more, attractive). Frameworks that introduce their own user interface abstractions will find it very difficult to support other operating systems as the porting process is much more difficult than it is for Rhodes. Smartphone diversity is just increasing more and more so such frameworks will just fall farther and farther behind.

Hosted Development and Build

In addition to inventing the smartphone framework category, Rhomobile also created the first Development as a Service for mobile: RhoHub. Local Rhodes development is still possible of course. But, as with all frameworks, Rhodes wants to build a true native project and app. Hence you need to install the SDKs for the different smartphone operating systems in order to build apps for them. While Rhodes is very easy to install (“gem install rhodes”) smartphone SDK installation can be quite painful. Hence we created RhoHub. RhoHub can perform the builds for every major smartphone operating system on your behalf without you installing any SDKs locally.

The combination of all of these capabilities make Rhodes far more productive than writing with any other framework or underlying SDK. Especially for modern web developers. And it gives them an environment that truly leverages all of their background in good and modern development habits rather than forcing them to give up on those modern skills and productivity.