在我们的微服务应用中,是否应该将Angular替换为ASP.NET CORE MVC?

huangapple go评论50阅读模式
英文:

In our microservices app, should we replace Angular with ASP.NET CORE MVC?

问题

我们团队决定实施微服务。关于前端,我们决定使用Angular。使用Angular可能会有陡峭的学习曲线,对于大型应用来说,熟悉Angular是必须的工作经验。我们的团队从未使用过像Angular这样的前端框架,为了避免项目交付日期的任何延迟,我正在考虑将Angular替换为ASP.NET CORE MVC来与API通信。

我已决定发布我的问题,听听您对我们可能采取的方法有何看法。

英文:

Our team has decided to implement Microservices. Regarding the front-end we decided to use Angular. With Angular the learning curve can be cumbersome and a working experience in Angular is a must for large application. Our team never working with a front-end framework like Angular and to avoid any delays in the project delivery date. I was thinking of replacing Angular with ASP.NET CORE MVC to communicate with the APIs.

I have decided to post my question to hear your thoughts on the approach we might adopt.

答案1

得分: 1

Backend:
ASP.Net MVC 不适用于创建微服务,您应该使用 Web API 项目,它们具有 MVC 的模型和控制器,但没有视图。

通常在微服务中,视图是使用前端技术完成的,最常见的是 JavaScript Web 框架(或移动 Swift、Android、MAUI),它们在客户端运行。这些前端使用 JSON 通过 REST HTTP 调用与 Web API 进行通信。

您不应该将 MVC 应用程序打包为前端以与 Web API 后端通信。

Frontend:
如果您的公司选择了 Angular,而且没有人有经验,那听起来就像是一场灾难。

如果选择 MVC,很难在微服务之间重复使用前端组件,而在 React 和 Angular 中可以轻松实现这一点。另一方面,Angular 的流行程度也很重要,您最好选择 React 并学习它,因为它的学习曲线更容易,招聘人员也更简单(您可以在学习的同时外包一些 UI 工作,然后再提高技能),而且由于其在内部的流行,员工更愿意学习它,以保持他们未来的就业能力。

英文:

Backend:
ASP.Net MVC isn't how you make Microservices, you use Web API projects and they have the Models and Controllers of the MVC, but not the View.

Typically in Microservices the View you do with a Front-End technology, most commonly JavaScript Web Frameworks (or Mobile Swift, Android, MAUI) that run on the client. These frontends communicate using JSON over REST HTTP calls to the Web API.

You don't want to package an MVC application as the Front-End to talk to a Web API Back-End.

Frontend:
If your company has chosen Angular and no one has experience with it, that sounds like a recipe for disaster.

If you choose MVC, it's hard to reuse Front-End Components between Microservices like you easily can in React and Angular. The other thing about Angular is its popularity, you're better off choosing React and learning that which has a much easier learning curve and it's simpler to recruit people (you could out source some of this UI work to start while you skill up), plus due to its popularity in-house devs will be more open to learning it to maintain their employability into the future:

在我们的微服务应用中,是否应该将Angular替换为ASP.NET CORE MVC?

huangapple
  • 本文由 发表于 2023年6月5日 15:19:39
  • 转载请务必保留本文链接:https://go.coder-hub.com/76404244.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定