简体   繁体   中英

architecture approach for app supporting web and mobile

I'm developing an application that will be consumed by various websites and mobile devices. The application is HTML 5 with jQuery thrown in. Each consuming site/device will have it's own CSS to style the content accordingly.

I've been playing around with a couple of different approaches for delivering the content to the consuming devices: ASP.NET MVC 3 app which delivers the content + html and jQuery Template approach where the html templates are loaded on the client then the app makes calls to a services delivering the content as JSON. The JSON is then fed through the HTML templates on the consuming sites/devices.

Here are the pros/cons as I see them:

The MVC 3 app delivery content + html is good because it's a simpler approach. Less moving parts in that the content and html are managed on the server. It produces a heavier payload which becomes an issue for mobile devices.

The jQuery template approach has more moving parts but produces smaller chunks of data going across the wire, however, the app becomes more chatty as you are making calls to retrieve the templates then a call to retrieve the JSON data. Also, I've discovered cross domain calls becomes an issue with jQuery.

So, I'd like some advice on which approach you think is better please. What have your experiences been? Thank you for your time.

I'm pretty sure jquery template is no longer being supported/developed.

Just due to that, it makes more sense to go with MVC 3 eh? ;)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM