如何将 AOP 引入生产性软件开发? [英] How to introduce AOP into productive software development?

查看:24
本文介绍了如何将 AOP 引入生产性软件开发?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道以前有人问过这个问题,但这是一年半前的事了,虽然我认为现在可能是重新提问的时候了.我也认识到它可能被视为主观的,但我想有一些客观的原因支持/反对 AOP.

I know this question has been asked before, but this was one and a half years ago, though I thought it might be the time for a re-questioning. I also recognized it might be seen as subjective, but I guess there are objective reasons for/against AOP.

我会对谁在软件开发中使用 AOP 以及为什么为什么不使用它感兴趣.

I would be interested in who is using AOP in software development and also why or why not using it.

我认为 AOP 是一种非常强大的范例,它可以使许多开发任务变得更容易.但是当谈到在实际项目中使用 AOP 时,我的经验是许多决策者几乎不接受它.您是如何将 AOP 引入您的项目的?

I see AOP as a very strong paradigm which can make a lot of development tasks easier. But when it comes to using AOP in real world projects I have made the experience that many decision makers are barely open to it. How did you manage to introduce AOP into your projects?

之前在 2008 年 8 月提出的问题:你在生产软件中使用 AOP(面向方面​​编程)?

Previously asked question from August 2008: Do you use AOP (Aspect Oriented Programming) in production software?

推荐答案

我们的经理倾听他们架构团队的意见.

Our managers listen to their architecture team.

我们告诉他们 AOP 是实现交叉关注特性的唯一解决方案:

We tell them that AOP is the only solution to implement cross-concern features:

  • 首先以合理的成本
  • 不会弄乱开发团队编写的功能代码
  • 永远不要忘记(与手动向数千个方法添加 try-catch 相比),现在和将来
  • 无需培训或控制开发人员正在做什么(有些很棒,有些则一团糟)
  • 具有良好的可维护性

确实,我们的项目有 20 名开发人员,并且持续了几年,因此代码量很大.这是唯一的解决方案.

True, our project is 20 developers and lasted for several years, so there is a huge mass of code. It's the only solution.

我认为关键是仅将其用于横切关注点.如果您可以使用常规代码对其进行编码,请这样做.但是如果它太大了,那么 AOP 是有吸引力和合理的.不限制AOP会导致上百个AOP小代码,很难理解.

I believe the key is to use it only for cross-cutting concerns. If you can code it using regular code, do so. But if it is way too big, then AOP is attractive and justified. Failing to limit AOP would lead to hundred AOP little codes, that would be very hard to understand.

是的,我们的软件是生产软件.数百家诊所依赖它!

And yes, our software is production-software. Hundreds of clinics depend on it!

这篇关于如何将 AOP 引入生产性软件开发?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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