首页 | 本学科首页   官方微博 | 高级检索  
相似文献
 共查询到20条相似文献,搜索用时 31 毫秒
1.
AOP技术在面向用户的软件组件测试中的应用   总被引:1,自引:0,他引:1  
面向方面编程AOP(Aspect-Oriented Programming)是一种支持横切关注点的分解技术,表达了更高的抽象层次,能够提供明确的截获横切结构的语言机制.讨论AOP技术在面向用户的软件组件测试技术中的应用,分析了如何使用AOP提高组件测试的可维护性和可复用性.  相似文献   

2.
关于AOP实现机制和应用的研究   总被引:20,自引:2,他引:20  
AOP(Aspect-Oriented Programming)是一种支持横切关注的分解的技术,表达更高的抽象层次。它对于横切关注点就像面向对象程序设计对于对象封装和继承一样,提供了能够明确捕获横切结构的语言机制。一个模块化良好的横切关注点叫一个侧面(aspect)。首先介绍了AOP的基本思想,然后针对侧面代码和功能代码的编织问题讨论了几种典型的AOP实现机制的特点,优势及缺陷,最后展望了AOP的应用和发展方向,为进一步研究提供参考。  相似文献   

3.
Software engineers of multi‐agent systems (MASs) are faced with different concerns such as autonomy, adaptation, interaction, collaboration, learning, and mobility, which are essentially different from classical concerns addressed in object‐oriented software engineering. MAS developers, however, have relied mostly on object‐oriented design techniques and programming languages, such as Java. This often leads to a poor separation of MAS concerns and in turn to the production of MASs that are difficult to maintain and reuse. This paper discusses software engineering approaches for MASs, and presents a new method for integrating agents into object‐oriented software engineering from an early stage of design. The proposed approach encourages the separate handling of MAS concerns, and provides a disciplined scheme for their composition. Our proposal explores the benefits of aspect‐oriented software development for the incorporation of agents into object‐oriented systems. We also illustrate our aspect‐oriented approach through the Portalware multi‐agent system, a Web‐based environment for the development of e‐commerce portals. Copyright © 2004 John Wiley & Sons, Ltd.  相似文献   

4.
This paper presents an in‐depth study of the adequacy of the AspectJ language for modularizing and reusing exception‐handling code. The study consisted of refactoring existing applications so that the code responsible for implementing error‐handling strategies was moved to newly created exception handler aspects. We have performed quantitative assessments of five systems—four object‐oriented and one aspect‐oriented—based on four key quality attributes, namely separation of concerns, coupling, cohesion, and conciseness. Our investigation also included a multi‐perspective analysis of the refactored systems, including (i) the extent to which error‐handling aspects can be reused, (ii) the beneficial and harmful aspectization scenarios for exception handling, and (iii) the scalability of AOP to support the modularization of exception handling in the presence of other aspects. Copyright © 2009 John Wiley & Sons, Ltd.  相似文献   

5.
Aspect‐oriented programming yields new types of programming faults due to the introduction of new constructs for dealing with crosscutting concerns. To reveal aspect faults, this paper presents a framework for testing whether or not aspect‐oriented programs conform to their state models. It supports two families of strategies (i.e. structure‐oriented and property‐oriented) for automated generation of aspect tests from aspect‐oriented state models. A structure‐oriented testing strategy derives tests and test code from an aspect‐oriented state model to meet a given structural coverage criterion, such as state coverage, transition coverage, or round trip. A property‐oriented testing strategy generates test code from the counterexamples of model checking. Two such strategies are checking an aspect‐oriented state model against trap properties and checking mutants of aspect models against system properties. Mutation analysis of aspect‐oriented programs is used to evaluate the effectiveness of these testing strategies. The experiments demonstrate that testing aspect‐oriented programs against their state models can detect many aspect faults. The comparative evaluations also reveal that the structure‐oriented and property‐oriented testing strategies complement each other—some aspect faults were detected by the structure‐oriented strategies, but not by the property‐oriented strategies and vice versa. Copyright © 2010 John Wiley & Sons, Ltd.  相似文献   

6.
Many profilers for virtual execution environments, such as the Java virtual machine (JVM), are implemented with low‐level bytecode instrumentation techniques, which is tedious, error‐prone, and complicates maintenance and extension of the tools. In order to reduce the development time and cost, we promote building profilers for the JVM using high‐level aspect‐oriented programming (AOP). We show that the use of aspects yields concise profilers that are easy to develop, extend, and maintain, because low‐level instrumentation details are hidden from the tool developer. In order to build efficient profilers, we introduce inter‐advice communication, an extension to common AOP languages that enables efficient data passing between advices that are woven into the same method using local variables. We illustrate our approach with two case studies. First, we show that an existing, instrumentation‐based tool for listener latency profiling can be easily recast as an aspect. Second, we present an aspect for comprehensive calling context profiling. In order to reduce profiling overhead, our aspect parallelizes application execution and profile creation, resulting in a speedup of 110% on a machine with more than two cores, compared with a primitive, non‐parallel approach. Copyright © 2011 John Wiley & Sons, Ltd.  相似文献   

7.
Aspect-oriented programming (AOP) seeks to improve software modularity via the separation of cross-cutting concerns. AOP proponents often advocate a development strategy where programmers write the main application (base code), ignoring cross-cutting concerns, and then aspect programmers, domain experts in their specific concerns, weave in the logic for these more specialized cross-cutting concerns. This purely oblivious strategy, however, has empirically been shown to tightly couple aspects to base code in many cases, hindering aspect modularity and reuse. In essence, the more intricate the weaving between the cross-cutting concern and the base code (lexically and/or semantically), the harder it becomes to: (a) robustly specify how to weave the aspects in at the required points, (b) capture interactions between aspects and base code, and (c) preserve the correct weaving as the base code evolves.We propose an alternate methodology, termed cooperative aspect-oriented programming (Co-AOP), where complete lexical separation of concerns is not taken as an absolute requirement. Instead, cross-cutting concerns are explicitly modeled as abstract interfaces through explicit join points (EJPs). Programmers specify where these interfaces interact with base code either through explicit lexical references or via traditional oblivious aspects. This explicit awareness allows base code and aspects to cooperate in ways that were previously not possible: arbitrary blocks of code can be advised, advice can be explicitly parameterized, base code can guide aspects in where to apply advice, and aspects can statically enforce new constraints upon the base code that they advise. These new techniques allow aspect modularity and program safety to increase, and bring us towards a cooperative AOP paradigm.We illustrate our methodology via an example on transactions, and also give an initial evaluation of cooperative AOP through an empirical study on program extensibility comparing both the traditional and cooperative AOP methodologies. Initial results show that cooperative AOP techniques result in code that is less complex with lower overall coupling, facilitating extensibility.  相似文献   

8.
面向方面编程技术研究   总被引:6,自引:3,他引:3  
面向方面编程是一项允许编程人员模块化横切关注点的新的编程技术,它引入了“方面”这一概念,“方面”把影响多个模块的行为封装到一个单独的可重用模块中,利用Xerox PARC发行的AspeetJ,Java开发者可以很方便地进行面向方面编程。本文介绍了AOP、AspeetJ的基本概念并举例说明了AOP在仓储管理系统中的应用。  相似文献   

9.
目前AOP作为OOP的扩展和补充,成为软件工程领域中的研究热点,其核心思想是分离关注点,实现横切关注点的模块化。实现关注点分离的关键技术之一是方面的编织。重点阐述了AOP系统中方面的具体编织策略,包括方面编织实现策略和织入时间策略。详细介绍了目前四种主流AOP系统:AspectJ、AspectWerkz、Spring AOP以及JBoss AOP的编织机制和技术,通过分析和总结目前AOP系统方面编织策略的优缺点,提出了一种基于XML的图形化方面编织框架——XbGAWF,以及XbGAWF与不同AOP平台的集成模式。  相似文献   

10.
ContextSince the emergence of the aspect oriented paradigm, several studies have been conducted to test the contribution of this new paradigm compared to the object paradigm. However, in addition to this type of studies, we need also comparative studies that assess the aspect approaches mutually. The motivations of the latter include the enhancement of each aspect approach, devising hybrid approaches or merely helping developers choosing the suitable approach according to their needs. Comparing advanced separation of concerns approaches is the context of our work.ObjectiveWe aim at making an assessment of how the aspect approaches deal with crosscutting concerns. This assessment is based on quantitative attributes such as coupling and cohesion that evaluate the modularity as well as on qualitative observations.MethodWe selected three of well-known aspect approaches: AspectJ, JBoss AOP and CaesarJ, all the three based on Java. We conducted then, a comparative study using the GoF design patterns. In order to be fair we asked a group of Master students to achieve the implementation of all patterns with the three approaches. The use of these implementations as hypothetical benchmarks allowed us to achieve two kinds of comparison: a quantitative one based on structural and performance metrics, and qualitative one based on observations collected during the implementation phase.ResultsThe quantitative comparison shows some advantages like the using of fewer components with AspectJ and the strong cohesion with CaesarJ and weaknesses, as the high internal coupling caused by the inner classes of CaesarJ. The qualitative comparison gives comments about the approach understandability and others qualitative concepts.ConclusionThis comparison highlighted strengths and weaknesses of each approach, and provided a referential work that can help choosing the right approach during software development, enhancing aspect approaches or devising hybrid approaches that combine best features.  相似文献   

11.
为了分离软件系统中的核心关注点和横切关注点,通过引入面向方面软件开发的思想设计了一种面向方面软件体系结构模型,并详细分析了该模型的三个基本构成单元,即构件、连接件和方面构件。最后通过一个网上支付实例验证了该模型具有一定的理论意义和实用价值。  相似文献   

12.
AOP(Aspect-Oriented Programming)是一种支持分离系统横切关注点的软件复用技术。模块化良好的横切关注点就是方面,方面在编译时或运行时被织入系统。介绍了AOP的基本概念和CGLIB提供的动态扩展机制,详细阐述了如何在拦截器中执行指示并最终基于CGLIB动态实现AOP的方法。  相似文献   

13.
面向方面编程分离了核心关注点和横切关注点,提供了模块化横切关注点的机制,很好地解决了面向对象技术处理横切关注点时存在的代码散布和代码纠缠问题.和日记记录、安全验证等业务一样,持久化也被认为是经典的横切关注点业务,适合用AOP来实现.分析了现有的基于AOP的持久化实现,发现大部分实现过于追求AOP要求的obliviousness特性,而在功能或性能上难以满足现实应用的需求.探讨了持久化的特点及持久方面化的机制,提出了一套实用的基于AOP的持久化框架.该框架保持了面向对象持久化技术的功能及性能,同时又具有方面化持久业务所带来的更高的可重用性、可维护性及可移植性.  相似文献   

14.
ContextAspect-Oriented Programming (AOP) is often described as a technique which improves the resulting software’s modularity. However, previous experiments seem to indicate that AOP is a technique which potentially increases the development or maintenance time. A possible reason why previous experiments were not able to show such a benefit is that those experiments did not consider situations where AOP has its strength: situations where aspects change.ObjectivesOur objective is to analyze whether initial higher development times caused by aspect-oriented programming can be compensated by frequent changes on the aspect code.MethodThis study is an empirical study with 15 subjects based on a within-subject design (repeated measurement) using two randomized groups. The measurement is development time until programming tasks completion. Additionally, an exploratory study is performed which analyzed (a) in separation out- and under-performing subjects with respect to development time, (b) the possible influence of the lines of code, (c) the possible influence of the number of advice and pointcuts, and finally (d) the possible impact of if-statements in the aspect-oriented solutions.ResultsThe experiment shows that frequent changes in the crosscutting code which do not change the aspect’s underlying structure compensate an initial higher development time for those concerns. But it also shows that changes, which do alter the concern’s structure again, result in higher development times when using AOP. Furthermore, the paper shows that the results are similar for out- and under-performing subjects in the experiment. Finally it shows that if changes are required in an aspect’s structure, subjects tend to perform such structural changes in a non-uniform way.ConclusionAOP is a potential rewarding investment into future code changes – but it has risks.  相似文献   

15.
面向方面编程(AOP)是一种新的编程技术,它能够将那些本不应该纠缠在一起的任务分离开,从而为程序提供更好的封装性和互操作性.将AOP应用到小规模的软件开发项目中能够提高开发效率,使系统更加容易理解、维护.但是将AOP应用到企业级的软件开发项目中,往往会出现很多问题,比如切入点如何定义,多个横切关注点之间应该如何交互等等.  相似文献   

16.
面向方面编程AOP(Aspect Oriented Programming)为开发者提供了一种机制来描述横切关注点.它能够自动地将横切关注点织入到面向对象的软件系统中,从而实现了横切关注点的模块化.然而AOP这种对横切关注点封装、织入的独特性为分析程序结构带来了困难,对传统的程序分析技术提出了新课题.通过分析AOP程序的特殊性,提出了基于AspectJ构造AOP程序控制流图的方法.该方案可以为AOP程序的理解、验证、测试以及重构提供控制流分析平台.  相似文献   

17.
Aspect-oriented programming (AOP) provides mechanisms for the separation of crosscutting concerns - functionalities scattered through the system and tangled with the base code. Existing systems are a natural testbed for the AOP approach since they often contain several crosscutting concerns which could not be modularized using traditional programming constructs. This paper presents an automated approach to the problem of migrating systems developed according to the object-oriented programming (OOP) paradigm into aspect-oriented programming (AOP). A simple set of six refactorings has been defined to transform OOP to AOP and has been implemented in the AOP-migrator tool, an Eclipse plug-in. A set of enabling transformations from OOP to OOP complement the initial set of refactorings. The paper presents the results of four case studies, which use the approach to migrate selected crosscutting concerns from medium-sized Java programs (in the range of 10K to 40K lines of code) into equivalent programs in AspectJ. The case study results show the feasibility of the migration and indicate the importance of the enabling transformations as a preprocessing step  相似文献   

18.
王琦  陈榕 《计算机应用》2006,26(6):1466-1467
通过识别、封装和集成不同种类的关注点来构件系统,从而提高系统的适应性、可维护性和重用性。面向方面编程(AOP)技术是目前较好的分离关注点的编程范式。基于CAR构件系统,提出了AOP的动态聚合模型及其实现。与其他系统的静态聚合方法相比,动态聚合所具有的随时聚合、随时拆卸的特点更加有效的提高了系统的适应性和重用性。  相似文献   

19.
In this paper, we present the Java Aspect Components (JAC) framework for building aspect‐oriented distributed applications in Java. This paper describes the aspect‐oriented programming model and the architectural details of the framework implementation. The framework enables extension of application semantics for handling well‐separated concerns. This is achieved with a software entity called an aspect component (AC). ACs provide distributed pointcuts, dynamic wrappers and metamodel annotations. Distributed pointcuts are a key feature of our framework. They enable the definition of crosscutting structures that do not need to be located on a single host. ACs are dynamic. They can be added, removed, and controlled at runtime. This enables our framework to be used in highly dynamic environments where adaptable software is needed. Copyright © 2004 John Wiley & Sons, Ltd.  相似文献   

20.
一种基于AOP的企业应用开发技术   总被引:5,自引:0,他引:5  
面向方面的编程(Aspect-OrientedProgramming,AOP)是一种新的编程技术,它弥补了面向对象的编程(Object-OrientedProgramming,OOP)在跨越模块行为上的不足。AOP引进了Aspect,它将影响多个类的行为封装到一个可重用模块中,它允许程序员对横切关注点(crosscuttingconcerns,即跨越典型职责界限的行为,例如日志记录)进行模块化,从而消除了OOP引起的代码混乱和分散问题,增强了系统的可维护性和代码的重用性。该文首先分析了AOP与OOP的比较,然后给出了AOP的原理和AOP的JBoss实现,最后介绍AOP在设计模式中的应用,并说明了使用它所带来的设计益处以及在应用AOP中应注意的问题。  相似文献   

设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号