建立.NET网站的最佳架构是什么,该网站将来也可能支持本机移动应用程序? [英] What is the best architecture for building a .NET website that may also support a native mobile app in the future?

查看:76
本文介绍了建立.NET网站的最佳架构是什么,该网站将来也可能支持本机移动应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在计划建立一个新的ASP.NET网站的阶段.该网站实际上是一个交易Web应用程序,用户将在其中登录并执行基本的CRUD数据操作.目前,可以通过传统的桌面浏览器和移动浏览器访问该网站.对于移动浏览器,我们将构建一个单独的按比例缩小版本的网站.

I am in the planning phases of building a new ASP.NET website. The website is really a transactional web application where the users will log in and perform basic CRUD data operations. For right now this website will be accessible through a traditional desktop browser and a mobile browser. For the mobile browser we will build a separate scaled down version of the site.

将来,我们可能会决定也为Android或iOS设备创建本机移动应用程序.

In the future we may decide to create native mobile applications for Android or iOS devices also.

所以我的问题是,设计易于支持该系统的最佳方法是什么?这就是我的想法.我正在考虑将3层构建到该站点.后端将是数据库-SQL Server2008.我们将使用存储过程进行所有数据访问.中间层将是Web服务层.该层将使用RESTful Web服务构建,并将包含所有业务逻辑.这些Web服务将提供对数据库的访问.前端将使用ASP.NET构建.前端将仅包含表示逻辑.这些层实际上将部署在物理上独立的服务器上.

So the question I have is what is the best way to design the system to easily support that? Here is what I am thinking. I am thinking of building out 3 tiers to the site. The back end will be the database - SQL Server 2008. We will use stored procedures for all data access. The middle tier will be a web services tier. This tier will be built using RESTful web services and will contain all of the business logic. These web services will provide access to the database. The front end will be built using ASP.NET. The front end will only contain presentation logic. These tiers will actually be deployed on physically separate servers.

然后,我在考虑,当我们决定构建本机Android或iOS应用程序时,可以构建这些应用程序以简单地调用与主站点正在调用的相同RESTful Web服务.

Then I am thinking that when we decide to build a native Android or iOS app that we could build those apps to simply call the same RESTful web services that the main site is calling.

这似乎是一种合理的方法吗?我唯一能想到的是,我们现在构建它的方式将使Web服务位于防火墙之后,并且外界将无法访问.当我们要支持本机移动应用程序时,我们需要使外界可以访问Web服务.

Does this seem like a reasonable approach? The only thing I can think of is that the way we are building it right now the web services would be behind the firewall and would not be accessible to the outside world. When we want to support a native mobile app then we would need to make the web services accessible to the outside world.

有什么想法吗?对于构建将来需要支持本机移动应用程序的高可用性,高使用率的Web应用程序,这似乎是一种好方法吗?

Any thoughts? Does this seem like a good approach for building a high availability, high usage web app that needs to support native mobile apps in the future?

谢谢, 科里

推荐答案

我和Rober Harvey在一起.使用ASP.NET MVC,您可以立即创建演示站点,并用作Web服务的模型.使用他给您的链接,设置网站进行移动浏览并使用网络在构建移动应用程序时为其提供服务.

I'm with Rober Harvey there. With ASP.NET MVC you can make the presentation site in no time, use as Models your web service; with the link that he gave you, set the site for mobile browsing, and use the web services for the mobile apps when you build them.

对我来说,这似乎是个好计划.对于公开的Web服务,您可以通过在Web服务中实现API密钥来保护自己,因此只有您的应用程序才能使用它.

For me it looks like a good plan. Regarding the web services being public, you can protect yourself by implementing API keys in the web service, so only your apps can use it.

这篇关于建立.NET网站的最佳架构是什么,该网站将来也可能支持本机移动应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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