In this article, I am concerned with static crosscutting, although I will briefly discuss both.
在本文中,尽管我将简要地同时讨论二者,但我主要关注静态横切。
We'll use an example to better see how static crosscutting can be implemented in an existing class.
我们将用一个例子来更好地展示静态横切是怎样在一个现有的类中实现的。
Within the world of crosscutting, there are two types: dynamic crosscutting and static crosscutting.
在横切的世界里,横切有两种类型:动态横切和静态横切。
For the remainder of the article I will focus on the technique and application of static crosscutting.
在本文剩下的篇幅中,我将重点讲解静态横切的技术和应用。
Moreover, static crosscutting lets you affix extensions and implementations to the fundamental structure of an object.
此外,静态横切可以把扩展和实现附加到对象的基本结构中。
Static crosscutting differs from dynamic crosscutting in that it does not modify the execution behavior of a given object.
静态横切和动态横切的区别在于它不修改一个给定对象的执行行为。
These concepts are central to dynamic crosscutting, although as we'll see they are not all required for static crosscutting.
这些概念是动态横切的核心,虽然正如我们即将看到的,它们并不全都是静态横切所必需的。
A more elegant and ultimately more flexible solution is to employ static crosscutting to add the behavior to desired objects.
一个更优雅且根本上更灵活的解决方案就是使用静态横切来对预期对象添加行为。
Rather, static crosscutting allows you to alter the structure of an object by introducing additional methods, fields, and properties.
相反,它允许通过引入附加的方法字段和属性来修改对象的结构。
While the API example is contrived, it has hopefully demonstrated how simple it can be to apply static crosscutting in an enterprise architecture.
虽然这里的API例子是人为的,但它有望证明在企业体系结构中应用静态横切是多么简单。
I'll start with an overview of both dynamic and static crosscutting, and then move quickly into an implementation scenario that demonstrates the latter technique.
我将首先概述动态和静态横切,然后迅速切入一个实现场景来展示后一种技术。
Given an object (such as Foo, defined below), static crosscutting makes it quite simple to create new methods, add additional constructors, and even alter the inheritance hierarchy.
给定一个对象(比如下面定义的Foo),静态横切使得创建新方法、添加附加的构造函数,甚至改变继承层次都变得十分简单。
While dynamic crosscutting — in which the runtime behavior of objects can be altered — is considered one of the foundations of AOP, static crosscutting is a far less known technique.
虽然动态横切(其中对象的运行时行为可以改变)被认为是AOP的根基之一,但静态横切却是一种远不为人所知的技术。
You'll see for yourself how handily static crosscutting meets one of the most common enterprise challenges: how to keep an application's codebase flexible while leveraging third-party code.
您将亲自体会到静态横切是多么方便地克服了如下这个最常见的企业挑战之一:如何在利用第三方代码的同时保持应用程序代码库(codebase)的灵活性。
Taking the lessons learned with static crosscutting the Email object, the team further refines its strategy by moving the contractual behavior up the hierarchy into the Sendable base interface.
从静态横切民email对象中吸取教训之后,他们通过把契约行为在对象层次中提升到sendable基接口,从而进一步精炼了其策略。
Another problem is that the crosscutting views only show matches based on static join point shadows.
另一个问题是横切视图只显示了基于静态联结点shadow的匹配。
Another problem is that the crosscutting views only show matches based on static join point shadows.
另一个问题是横切视图只显示了基于静态联结点shadow的匹配。
应用推荐