javascript AngularJS 和企业应用程序
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17496730/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
AngularJS and Enterprise applications
提问by Mantzas
we are currently evaluating the use of AngularJS in a Enterprise Application (e-Banking) as a Single Page Application. Many of the devs@work are already convinced that there no other way to go. It is the trend, it is future proof (html, css and js) it is easy to do, less burden on the server etc etc. Despite the interesting part of this framework, i am not convinced that there are factors that must be considered before going this road. These can be:
我们目前正在评估 AngularJS 在企业应用程序(电子银行)中作为单页应用程序的使用。许多 devs@work 已经确信别无他法。这是趋势,它是未来证明(html,css 和 js)它很容易做到,服务器的负担更小等等。尽管这个框架的有趣部分,我不相信有必须考虑的因素在走这条路之前。这些可以是:
- Maintainability of code
- Testability of code, not only the ui part
- Continuous integration (like TeamCity or TFS)
- Developer friendliness like debugging, navigating through code
- Security (if there is a risk)
- 代码的可维护性
- 代码的可测试性,不仅仅是ui部分
- 持续集成(如 TeamCity 或 TFS)
- 开发人员友好,如调试、浏览代码
- 安全性(如果有风险)
Has anyone any experience on enterprise apps build like that? I would rather go with Asp.Net MVC4. Please no hypothetical answers, i don't want to start a war. Real life experience is really appreciated.
有没有人在构建这样的企业应用程序方面有任何经验?我宁愿使用 Asp.Net MVC4。请不要假设答案,我不想发动War。真实的生活经历真的很感激。
Regards
问候
采纳答案by John Tseng
I had thought about this when incorporating Angular into our enterprise application. First, some optional background information. I really needed to keep all my page state on the client side since recreating it on the server side is a very resource intensive task. I started off with building it with just JQuery, since I only needed a few things, but soon I found myself having trouble keeping track of the callbacks I wrote just last week. Hence, I wanted to refactor. While I was at it, Angular looked like the best fit for my programming style.
在将 Angular 整合到我们的企业应用程序中时,我曾考虑过这一点。首先,一些可选的背景信息。我真的需要将所有页面状态保留在客户端,因为在服务器端重新创建它是一项非常耗费资源的任务。我开始只用 JQuery 构建它,因为我只需要一些东西,但很快我发现自己无法跟踪我上周写的回调。因此,我想重构。当我在做的时候,Angular 看起来最适合我的编程风格。
To address your concerns:
解决您的疑虑:
I think that it is more maintainable, since it encourages you to split things up. This, however, depends totally on your team and your discipline to keep things maintainable.
我认为它更易于维护,因为它鼓励您拆分事物。然而,这完全取决于你的团队和你的纪律,以保持事情的可维护性。
The Angular team definitely thought about testing when they were making it. Things are very easy to test, from unit testing to e2e testing. Others have even found a middle ground in between.
Angular 团队在制作时肯定考虑过测试。事情很容易测试,从单元测试到 e2e 测试。其他人甚至在两者之间找到了一个中间立场。
We use Jenkins at our Microsoft shop for continuous integration since it was easier for us to plug in our own programs to make it work with our complex environment setups. However, I don't think this relates much to which framework you decide to go with.
我们在 Microsoft 商店使用 Jenkins 进行持续集成,因为我们可以更轻松地插入我们自己的程序以使其与我们复杂的环境设置一起工作。但是,我认为这与您决定采用哪个框架没有太大关系。
Coming from Visual Studio, I find JavaScript in general leaves something to be desired. I love edit and continue, unwinding the stack, and dragging that yellow arrow around. That stuff is just pure magical bliss. Debugging on the browser just doesn't give you all of that.
来自 Visual Studio,我发现 JavaScript 总体上有一些不足之处。我喜欢编辑并继续,展开堆栈,然后拖动黄色箭头。那东西只是纯粹的魔法幸福。在浏览器上调试并不能为您提供所有这些。
Security is pretty good. Looking through the docs, you can see that the team is concerned with security issues such as XSS and CSRF attacks. However, anything done over the browser is hard to secure. There are new attacks and bugs discovered every other day. If you are really concerned about security, you wouldn't have an online app. You would make sure that your customers only banked in the branch with multiple forms of ID. With that said, I don't think Angular is any less secure than any other JavaScript solution.
安全性还不错。查看文档,您可以看到团队关注安全问题,例如 XSS 和 CSRF 攻击。然而,通过浏览器完成的任何事情都很难保证安全。每隔一天就会发现新的攻击和错误。如果您真的很关心安全性,您就不会拥有在线应用程序。您将确保您的客户仅使用多种形式的 ID 在分行进行银行业务。话虽如此,我认为 Angular 并不比任何其他 JavaScript 解决方案更不安全。
I would like to raise another issue with all of these JavaScript frameworks/libraries. They're all fairly new and constantly evolving. Look at how many functions JQuery has deprecated recently, and you'll get a sense of how hard it is to keep on top of your libraries. Many of these are also forgotten and left to rot. Angular being one of Google's products also makes me a little scared, since they have been cancelling waves of their projects. Hopefully, Angular does not become one of those.
我想对所有这些 JavaScript 框架/库提出另一个问题。它们都是相当新的并且不断发展。看看最近 JQuery 有多少函数被弃用了,你就会明白保持库的顶部是多么困难。其中许多也被遗忘并任其腐烂。Angular 作为 Google 的产品之一也让我有点害怕,因为他们一直在取消他们的项目。希望 Angular 不会成为其中之一。
The documentation is also lacking. Although the community is good, the documentation is not. Many pages are half done. Again, compared to the latest stuff from Microsoft, the documentation is pretty sparse.
文档也很缺乏。虽然社区很好,但文档不是。许多页面已完成一半。同样,与 Microsoft 的最新内容相比,文档非常少。
This being one of the new things, it is harder to hire someone to help/take over this stuff.
这是新事物之一,雇用某人来帮助/接管这些东西变得更加困难。
Despite all these drawbacks, I really like it, and I'm definitely going to push my company towards adopting it.
尽管有所有这些缺点,但我真的很喜欢它,我肯定会推动我的公司采用它。
回答by Ajay Beniwal
Yes I have used Angular with Asp.net WebAPI along with MongoDB .Pls find my findings
是的,我已经将 Angular 与 Asp.net WebAPI 以及 MongoDB 一起使用。请找到我的发现
1)Testability is absolutely fantatic .You can easily test you unit test using karma and jasmine
1) 可测试性绝对是梦幻般的。您可以使用 karma 和 jasmine 轻松测试您的单元测试
2) CI. Integration of Jenkins is available with Karma
2)CI。Jenkins 与 Karma 的集成可用
3) Easy to debug similar to Javascript debugging can use chrome extension Bartrang to debug angular apps easily
3) 易于调试类似于 Javascript 调试可以使用 Chrome 扩展 Bartrang 轻松调试 Angular 应用程序