所有这些都是所谓横切关注点的例子。
那么它们是否也适用于横切关注点呢?
Are they also appropriate for dealing with crosscutting concerns?
因此,怎样才能实现一个横切关注点,例如日志?
So how do we implement a cross-cutting concern such as logging?
一个要掌握的关键概念是横切关注点分为两个区域。
A key concept to grasp is that crosscutting concerns divide into two different areas.
AOP是在应用程序开发中管理横切关注点的关键。
AOP is key to managing crosscutting concerns in application development.
避免将所有代码与横切关注点类的特殊实例联系起来。
Avoided tying all code to particular instances of cross-cutting concern classes.
实际上,横切关注点代码的注入,就是一种类型的模式。
In fact, the injection of code for crosscutting concerns is a pattern of sorts.
用注解捕获应用中特定的横切关注点是一种很简单的方式。
Annotations are an easy way to capture certain crosscutting concerns in the applications.
不过,它可帮助您理解并获得对应用程序的横切关注点的信任。
However, it will help you to understand and gain confidence in your application's crosscutting concerns.
抓取策略是个业务层的横切关注点,它会随着业务的变化而变化。
Fetching strategy is a business level cross cutting concern and it changes based on the business use case.
一个横切关注点,在用传统OO方法实现时,会分解成很多类和方法。
A crosscutting concern, when implemented in a traditional OO approach, cuts across many classes and methods.
关于测试广泛分布的横切关注点的一个难题是它会报告太多的联结点。
One of the hard things about testing a widespread crosscutting concern is that it can advise so many join points.
因此,横切关注点(如日志、事务和安全)不会再干扰应用程序代码。
As a result, crosscutting concerns like logging, transactions, and security no longer intrude on your application code.
AOP模块化横切关注点。因此应该寻找那些分散和纠缠在代码中的代码。
AOP modularizes crosscutting concerns, so I should look for code that is scattered and tangled in my code.
AOP模块化了横切关注点,因此我要在代码中寻找横切关注点。
AOP modularizes crosscutting concerns, so I should look for crosscutting concerns in my code.
区别是现在将系统的横切关注点映射到使用了投射到相关维中的多维接口的方面。
The difference is that you now map the system's crosscutting concerns to aspects that use a multidimensional interface, which is projected into the associated dimensions.
该架构从功能和数据两方面实现了核心关注点和横切关注点彻底解耦。
It realizes the decoupling of the core concerns and the crosscutting concerns from function and data.
团队认为,在软件体系结构中,只有某些形式的全局实例才能处理特定的横切关注点。
The team thought that the handling of certain cross-cutting concerns within the software architecture could only be provided by some form of global instance.
方面化构件组装平台需要将横切关注点织入业务构件,其组装实现依赖于方面编织。
Aspectual component assembling platform has to weave cross-cut concerns into business components. Its assembling process relies on aspect weaver.
一些关注点可适当地通过封装的类或组件来表达,另一些最好通过横切关注点来表达。
Some concerns are appropriately expressed as encapsulated objects, or components. Others are best expressed as cross-cutting concerns.
摘要:在应用系统构建中,如何处理系统中的横切关注点问题是系统开发成功的关键。
Absrtact: in constructing application, how to deal with the problem of system crosscutting concern is key to the success of developing application.
确保横切关注点不混淆主要的业务逻辑——随着开发的进展,这很有可能成为危险之处。
Ensuring that crosscutting concerns do not obscure mainline business logic-a real danger as different concerns add up as development progresses.
不过,如果用方面实现横切行为,那么就有了测试(并理解)应用程序的横切关注点的新方法。
If you implement your crosscutting behavior with aspects, however, you gain new ways to test (and understand) your application's crosscutting concerns.
提供一种更为灵活的方法以便在系统中应用横切关注点,并使现有代码和新代码之间拥有一定的共同性。
Provided a more flexible approach to applying cross-cutting concerns in the system, while maintaining a degree of commonality between existing and new code.
在建立了系统核心、可扩展机制和可接受的性能之后,最后一个步骤就是将横切关注点应用到系统。
Having established the system core, extensibility mechanisms, and acceptable performance, the final step was to apply cross-cutting concerns to the system.
解决横切关注点的组件,例如异常管理与规范(Instrumentation)就是这一常用功能的典型例子。
The Components to address cross-cutting concerns, for instance Exception management and instrumentation are examples of this common functionality.
识别一个横切关注点的经验法则是:如果一个关注点反复出现在不同类及层次中,那它是一个横切关注点。
The basic thumb rule toidentify a cross-cutting concern is: If a concern is repeated across classesspread over layers / tiers, then it is a cross-cutting concern.
熟悉面向方面编程(或AOP)的人们会把它认为是横切关注点,这意味着防御性编程技术横跨了代码库。
Those familiar with aspect oriented programming, or AOP, will recognize this as a crosscutting concern, meaning that defensive programming techniques span horizontally across a code base.
如果对横切关注点(例如日志和事务管理)进行了模块化,那么不用修改每个单独的类,就可以向代码中添加新特性。
If you modularize crosscutting concerns, such as logging and transaction management, it becomes possible to add new features to your code without modifying each class individually.
寻找单个的关注点(即使是横切关注点),就丢失了关系和协议,在规范化为模式时,关系和协议是编码实践的支柱。
By looking for a single concern (even if it is crosscutting), you miss the relationships and protocols that, when normalized as patterns, form the backbone of code practice.
应用推荐