5

We have a website written in the traditional Jquery selector-callback spagetti code. We are planning to begin migration to backbone to help clean things up.

We use mustache and use the same templates for rendering in php server-side and javascript client-side. But there are some mustache alternatives (handlerbars/dust) that we are interested in but can't explore because there is currently no php alternative. We are considering moving all server-side rendering to node so we can use the same logic/code for client and server rendering. We would be porting all our php view classes to javascript/backbone and just use php as our data/controller layer.

In parallel, we are preparing to develop a sencha touch website/app which would normally be written using the sencha/ext approaches in javascript.

The actual templating will be very different between the sencha and main site, but much of the view models could probably be the same.

There are three approaches I can think of:

  1. use backbone as the main view models including inside sencha
  2. use sencha everywhere using the sencha/ext classes/approach in the main site
  3. keep them separate and either deal with duplication or try to abstract out the essential logic to other classes.
Yehosef
  • 17,987
  • 7
  • 35
  • 56
  • found this questions http://stackoverflow.com/questions/7254791/sencha-touch-vs-backbone-js but I'm still interested in how this would apply to a unified website/mobile/app approach, if possible. – Yehosef Mar 18 '12 at 12:04

1 Answers1

2

One advantage of the ExtJS route is you can use the same models, stores, etc and just have separate views, grids, whathaveyous for mobile/non-mobile. Then you can just serve up the same JSON/XML from PHP. The JsonStore/XmlStores will be the same on each platform. Been a while since I've used ExtJS so cannot offer more concise example.

Morgan ARR Allen
  • 10,556
  • 3
  • 35
  • 33
  • From what i can remember the models in SenchaTouch and Ext have very similiar API, but not exactly the same, so im not even sure that you could use the same models in ExtJS and SenchaTouch. – macwier Mar 19 '13 at 11:44