原文:http://jroller.com/page/rickard/20050605#the_three_kinds_of_aspect
As I look through our aspect configuration I notice that there is a distinct pattern throughout. The configuration, some of which is XML and some of which is provided by Java source code, can be divided into three kinds.
The first kind is the configuration about a single aspect. It defines the aspect, be it an advice or introduction, and declares its relationship with the world. Its dependencies and what it provides. What goes in and what comes out.
The second kind is the configuration that declares how different aspects should relate in a specific system. It imports aspects, declares precedence between them, and how they should be grouped depending on annotations and what interfaces specific objects implement. What goes in and what comes out. But on a higher level.
The third kind is the configuration that describes specific classes, or "sets of objects". It defines the introductions applied to particular classes, which in a cascading fashion will also determine to some degree what advice will be added. Introductions can be added on a very granular basis, i.e. to a specific class, or to sets of classes, like a package.
The first kind forms the atoms of an AOP application. The smallest lego blocks available. The second kind determines the rules for how the atoms form together into molecules; the natural laws so to speak. These become the building blocks of real structures, and depending on how they are formulated you get different orders of stability, flexibility and/or chaos. The third kind is the actual application, as it is perceived by clients of it, and hence it can be extremely varied.
In terms of reusability the first kind of configuration is extremely reusable as each individual aspect make minimal assumptions about how they are used, even though "minimal" can be quite substantial in some cases. The second kind is less reusable since it imposes assumptions about what set of aspects need to be available for its "laws" to function properly. This is because the second kind is what it responsible for describing how aspects interact, and if some of them cannot be used for some reason the laws suddenly don't behave as they were intended. The third kind is even less reusable as it makes a lot of assumptions about what is available, and the configuration is rather specific in terms of what the end result is supposed to do.
The resulting components adhere to a strictly defined behaviour (depending on the quality of the second kind of configuration, of course), which can be used by other components, and even individual aspects. In this sense, even though everything is separate, they are also inherently intertwined in a symbiotic fashion where it is difficult to separate one from the other.
By acknowledging that there are different kinds of configuration it is possible to introduce a degree of order into an AOP application. Everything is not equal, everything is not the same, which is what gives the developer a possibility to ensure that any new aspect (s)he creates fits into an existing system in a non-disruptive manner.
Harmony follows and everyone is happy.
The End.
分享到:
相关推荐
根据提供的文件信息,我们可以推断出《The Myth of The First of Three Years》这本书主要探讨了早期大脑发展与终身学习的关系,以及围绕这一主题所存在的误区。以下是对标题、描述及部分文本内容中提及的关键知识点...
英文名称:ROMANCE OF THE THREE KINGDOMS XIV 游戏类型:策略类(SLG)游戏 游戏制作:KOEI TECMO GAMES CO., LTD. 游戏发行:KOEI TECMO GAMES CO., LTD. 游戏平台:PC 发售时间:2020年1月16日 官方网站:...
In this book, the application of the compensation technique and circuits to three different systems is proposed: a highprecision digital-to-analog converter, a SOI (silicon on insulator) 1T DRAM...
mathematically rigorous exposition of a broad and vital area in computer vision: the problems and techniques related to three-dimensional (stereo) vision and motion. The emphasis is on using geometry...
1)Select one number q and then divide the sequence S into three sub-suquences: S1 in which all of elements are less than q, S2 in which all of elements are equal to q, and S3 in which all of elements ...
标题“three-kinds-of-encrypt.rar_加密解密vc6”提示我们,这个压缩包包含三个不同的加密算法的示例代码,这对于初学者理解和调试加密算法非常有帮助。标签“加密解密vc6”进一步确认了这个主题。现在,让我们逐一...
An efficient algorithm that make use of the evolution cone of GC maxima to detect the instant of GC is presented together with three erformance measurements regarding the accuracy of location, false ...
Proofs from THE BOOK is a book of mathematical proofs by Martin Aigner and Günter M. Ziegler. The book is dedicated to the mathematician Paul Erdős, who often referred to "The Book" in which God ...
The three main topics considered are judgment heuristics and biases, mental accounting, and behavioral finance. Part VIII considers behavioral welfare economics; the main topics are soft ...
This is a project of image-cutting in Android, which provides three kinds of picture sources(1.camera shot. 2.gallery. 3.get from the folder). There is a is original and the other is cropped. Also you...
To begin the fourth and later volumes of the set, and to update parts of the existing three, Knuth has created a series of small books called fascicles, which will be published t regular intervals....
To begin the fourth and later volumes of the set, and to update parts of the existing three, Knuth has created a series of small books called fascicles, which will be published at regular intervals....
This paper reviews three recent books on data mining written from three different perspectives, i.e., databases, machine learning, and statistics. Although the exploration in this paper is suggestive ...