开发基于REST的网站和iPhone(可能还有其他的智能手机)应用程序中使用ASP.NET MVC [英] Developing RESTful website and iphone (and possibly other smart phones) application using ASP.NET MVC

查看:123
本文介绍了开发基于REST的网站和iPhone(可能还有其他的智能手机)应用程序中使用ASP.NET MVC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在开发一个网站,也有智能手机(从iPhone,但有可能加入Android和黑莓版本)同行(像Yelp的或都市汤匙例如功能的子集),我们正在考虑使用ASP.NET以下REST范式MVC。我们的团队是相当新的这方面的软件开发,我们有以下的问题:

we are developing a website that also have smart phone (starting with iphone but possibly adding android and blackberry later) counterparts (a subset of functions like Yelp or Urbanspoon for example) and we are thinking about following REST paradigm using ASP.NET MVC. Our team is fairly new to this area of software development and we have the following questions:

(1)对于iPhone应用程序,我们正在考虑开发使用Objective-C的应用程序。其实,我们的应用程序并不需要在断开连接模式和Web应用程序模式可能会更好,但我们正在考虑开发Objective-C的应用程序的唯一原因就是工作,我们要使它可在App Store这样人们可以在他们的iPhone下载并把它而不是让书签在其iPhone上的Safari。 (iphone用户不要去,发现在iPhone上新的网站),但这种方法因无力更新和修复客户端上的是现实的,因为我们希望这个错误受到影响。我不知道是否有嵌入一个Objective-C的应用程序内部的网页的方式?

(1) For the iphone application, we are thinking about developing an application using Objective-C. Actually, our application doesn't need to work in the disconnected mode and the web application paradigm might be better but the only reason that we are thinking about developing Objective-C app is that we want to make it available in the app store so that people can download and have it on their iphone as opposed to having to bookmark it in Safari on iphone. (iphone users don't go and discover new website on the iphone) But this approach suffers from not being able to update and fix the bug on the client side as immediate as we hope. I wonder if there is a way to embed a web page inside an Objective-C app?

(2)我们的目标是按照REST风格的范例:

(2) Our goal is to follow RESTful paradigm:

- Access resoures through standard method (GET, PUT, POST, DELETE)  
- Multiple representations (XHTML for the website and perhaps POX for the smart phones)
- Statelessness whenever possible

什么是通过ASP.NET MVC中这些提供RESTful服务的最佳方法?

What would be the best approach to provide RESTful service through ASP.NET MVC among these?


  • 使用ADO.NET数据服务(我们使用的是实体框架的O / R映射)

  • 实施RESTful服务在WCF

  • 使用最近发布的 REST ASP.NET MVC SDK

  • Use ADO.NET Data Services (We are using Entity Framework for O/R mapping)
  • Implement RESTful services over WCF
  • Use the recently released REST for ASP.NET MVC SDK

(3)应如何ASP.NET MVC从智能手机接收数据?它应该是什么样的数据格式?对于网站,我们将必须处理HTML表单POST / PUT但不相同的模式工作Objective-C的客户端(或其他智能手机客户端)?

(3) How should the ASP.NET MVC receive data from the smart phone? What data format should it be? For the website, we will have to process HTML form POST/PUT but does the same paradigm work for the objective-C client (or other smart phone client)?

任何建议/关于这三个问题的意见是高度AP preciated!

Any suggestions/comments about these three questions are highly appreciated!

推荐答案

关于问题1。

是的,你可以使用嵌入一个UIWebView的原生iPhone应用程序中的网页。这听起来像你想被称为混合应用程序,在您使用一个UIWebView加载大部分的内容,然后使用原生UI控件用于提供额外的功能是什么。

Yes you can embed a webpage inside a native iphone application using UIWebView. It sounds like what you want is known as a hybrid application, where you use a UIWebView to load most of the content and then use native UI controls for providing additional functionality.

查看<一个href=\"http://developer.apple.com/iphone/library/documentation/UserExperience/Conceptual/MobileHIG/DevelopingSoftware/DevelopingSoftware.html#//apple%5Fref/doc/uid/TP40006556-CH5-SW5\"相对=nofollow> IPhone HIG 了解一些这方面的基本信息。

See the IPhone HIG for some basic information on this.

另外一个iPhone用户能够书签保存到自己的主屏,这样加载页面很像启动本机应用程序。他们只是去到主屏幕,然后单击该图标。但是如果你想使用的应用程序商店市场您的网站,这将可能无法满足您的需求。

Also users on an iphone are able to save bookmarks to their home screen so that loading the page is a lot like launching a native app. They just go to the home screen and click the icon. But if you want to use the app store to market your site, this will probably not suit your needs.

这篇关于开发基于REST的网站和iPhone(可能还有其他的智能手机)应用程序中使用ASP.NET MVC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆