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.
此外,静态横切可以把扩展和实现附加到对象的基本结构中。
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.
一个更优雅且根本上更灵活的解决方案就是使用静态横切来对预期对象添加行为。
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)的灵活性。
Static crosscutting differs from dynamic crosscutting in that it does not modify the execution behavior of a given object.
静态横切和动态横切的区别在于它不修改一个给定对象的执行行为。
Static crosscutting differs from dynamic crosscutting in that it does not modify the execution behavior of a given object.
静态横切和动态横切的区别在于它不修改一个给定对象的执行行为。
应用推荐