Thursday, August 04, 2011

Mobile devices and good architecture

I'm in the midst of a project that includes a significant mobile device component. The build out requires super engaging user experience (UX) for the interactions on the mobile devices. The project also includes a companion web portal where people will have further insight into their mobile device interactions. The project is very social and has a good possibility in innovating some monetary processes. Very exciting!

The other day I attended a meetup with focus on sproutcore. Great introduction to the product with some very useful insight into how the framework was put together and how it should be utilized. What was cool about the whole meetup is I posted a photo from the AppNovation offices where the event was being hosted. I posted directly from my Android phone to Google+ with no effort (nice feature) and added a comment. The really cool part was the discussion that occurred between myself and two guys I worked with on a really innovative client-server C++ / Sybase SQL Server application 20 years back. Weird thing is we are all still coding in different capacities. Anyhow, the really interesting conversation was around the MVC pattern and business logic in the browser. We all agreed this was not the right way to go, and the sproutcore site was wrong in promoting business logic in the browser as a marketing message.


So why isn't business logic in the browser a good architecture?
Because pushing it out to the browser means it can no longer run on the server. Business logic can be reused for other services (think RESTful) where browsers are consumers of the logic (not the producers), business logic is intellectual property and shouldn't always be exposed in the browser, business logic often needs data and implements business decisions, this should stay on the server. Don't get me wrong a framework that supports HTML5 and implements the MVC pattern is a good architecture. Just pushing the business logic out to the browser is not good architecture. Now we may be getting into the definition of business logic, and if the Model within the MVC is considered the business logic and is only responsible for acting as a proxy for the data and business decisions through a web service API like REST then we are good.


So what does this have to do with mobile devices and good architecture?
HTML5 and the MVC pattern are very good practices when developing on mobile devices. This is mostly because of HTML5's ability to target multiple devices and the MVC being a very mature and proven pattern. The issue then becomes how should the application be architected? I'd suggest the following practices;
  1. Use a HTML5 / MVC approach when building the User eXperience (UX)
  2. Keep the Model thin and it should act mostly as a proxy to the server hosted web services
  3. Build the server hosted services using a well thought out RESTful design, ensure these services could also be consumed by non-mobile devices
  4. Be mindful of which features are required for mobile and which are better implemented within a browser based portal (consider the difference between the Google+ mobile app and the Google+ browser portal)
  5. Separate the database reads from the writes within the RESTful API (this will greatly help scalability)

Practices for IT stewardship

I completely agree! Information Technologies role is shifting into stewardship away from control. There are many forces at play that are leading to this end and this linked article does a good job of identifying these forces. As the article points out, much of the change will be a gradual cultural change and there are many practices that can encourage the change. This is what I see as important to facilitate the change from an IT perspective;

  1. Define IT stewardship - doing IT right the first time
  2. Every organization needs to create a shared understanding of IT Stewardship. I agree with the Merriam-Webster definition of Stewardship.
    the conducting, supervising, or managing of something; especially : the careful and responsible management of something entrusted to one's care
    It's the idea of being entrusted, responsible and careful with IT so it supports and empowers all those who use it. It's how IT professionals get out of the way and facilitate the organizations innovation so it doesn't have to look elsewhere. This also means doing the right thing the first time, instead of compromising the future with a quick fix or half-baked approach. Most seasoned IT professionals know the right answer when selecting and proposing approaches, they need to trust themselves and gain the trust of others.
  3. Empower the middle tier - they should be interpreting and contributing to the strategic planning, writing the business cases and executing on plans, discussing with front line staff all customer issues, working diligently to make senior executives irrelevant or at least let them know there is a solid group of up and comers!
  4. Encourage the front line staff - they know the heartbeat of the organization from the customers perspective, this is every organizations most important resource.
  5. Engage your customers - all you design should be done with the assistance of your customers