首页 | 本学科首页   官方微博 | 高级检索  
相似文献
 共查询到20条相似文献,搜索用时 203 毫秒
1.
郑晔 《程序员》2004,(7):94-96
第零循环:缘起熊节在2004年第四期的《程序员》的《Observer模式实战解析》一文中,谈到以AOP方式实现Observer。从他的探索结果来看,以AOP实现Observer确实是一种比较不错的思路。在该文前半部分,前文作者演示了实现Observer的常见手法,并分别指出了在业务组件和客户代码中实现Observer消息组装和发送的种种不是。如果一切到此停止,指出各种实现的不足纯粹是为了给后面AOP的出现鸣锣开道,我的这篇文章也就失去了存在的价值。熊节根据自己找出的问题做出一个推断,经典对象技术鞭  相似文献   

2.
Observer模式被人们广泛应用(特别是在GUI应用程序中),并构成了MVC架构的关键部分。它处理复杂的问题,而在解决这类问题方面表现得相对较好。但面向对象的Observer模式实现方案中,要求先侵入系统中现有的类,然后才能支持该模式,带来了以下问题:难以理解、可重用性差、后期维护很复杂、代码不容易组合等。基于AOP技术,提出了一种可重用的Observer模式的方案,并通过与面向对象实现方案的比较,得出了AOP技术实现方案具有模块松散耦合、可重用性高等优点的结论。  相似文献   

3.
Observer模式被人们广泛应用(特别是在GUI应用程序中),并构成了MVC架构的关键部分。它处理复杂的问题,而在解决这类问题方面表现得相对较好。但面向对象的Observer模式实现方案中,要求先侵入系统中现有的类,然后才能支持该模式,带来了以下问题:难以理解、可重用性差、后期维护很复杂、代码不容易组合等。基于AOP技术,提出了一种可重用的Observer模式的方案,并通过与面向对象实现方案的比较,得出了AOP技术实现方案具有模块松散耦合、可重用性高等优点的结论。  相似文献   

4.
GoF23中的Observer模式定义了一个一对多的依赖关系,当一个对象状态改变时,所有依赖该对象的对象都被通知并且自动执行更新操作。Observer模式的OOP实现方案中,模式的实现代码与模式的参与者代码混合在一起,容易产生代码缠结和代码分散等诸多问题。利用AOP技术能很好的将系统中模式实现的代码封装在一个独立的模块中,从而使得程序的模块化程度和可复用性得到改善。  相似文献   

5.
章程 《微型电脑应用》2007,23(1):1-4,18
面向方面编程(AOP)是一种新兴的编程方法,其核心思想是分离程序中的关注点,并提供某种机制,以表达横切多个组件的关注点。契约式设计(DbC)是构建高可靠面向对象系统的设计方法,它通过规定组件间的行为契约来保证程序的正确性。本文简单介绍了AOP和DbC,然后通过尝试在Observer设计模式中加入契约,研究了使用AOP支持DbC的方法,进而设计和实现了一个AOP代码生成器,并分析了该生成器的特点。  相似文献   

6.
基于AOP技术的Composite模式的改进   总被引:1,自引:0,他引:1       下载免费PDF全文
Composite模式是解决部分与整体关系时常用的设计模式,但基于面向对象设计(OOP)所实现的Composite模式中存在的问题很难利用OOP解决。该文应用面向方面编程(AOP)改变类的行为,利用AspectJ实现Composite模式,通过与以OOP技术实现的Composite模式比较,得出应用AOP方法能够较好地实现责任分离,具有较高的可扩展性,模块结构更清晰。  相似文献   

7.
一种策略模式的AOP实现及应用   总被引:1,自引:0,他引:1  
基于面向方面编程(AOP)实现GoF设计模式是目前程序设计方法学的一个研究热点。针对GoF设计模式中的策略模式的传统面向对象实现方法所存在的问题,设计了一种基于AOP的实现方法,并应用到J2EE"应用服务"核心模式的实例中。分析结果表明,该方法能有效解决策略模式的传统面向对象实现方法中的混乱、间接影响、封装破坏等问题。  相似文献   

8.
首先讨论了MVC设计模式的特点,对Observer模式进行适当扩展,抽象出用于显示逻辑的表现层,增强了代码的可重用性,降低了耦合度。然后利用此扩展的Observer模式完成防撞预警系统的架构设计。  相似文献   

9.
面向方面编程(AOP)技术及其在.Net平台下的实现   总被引:2,自引:0,他引:2  
面向方面编程(AOP)是一项新技术,它弥补了面向对象编程(OOP)在处理横切关注点时的不足。AOP在Java平台下已经形成了成熟的技术,在.Net平台下的功能就相对要弱些,技术也不是很成熟。文章介绍了AOP及其实现原理以及代理开发模式,最后在.Net平台下利用代理技术实现了AOP。  相似文献   

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

11.
Constrained Ordinal Optimization—A Feasibility Model Based Approach   总被引:1,自引:0,他引:1  
Ordinal Optimization (OO) is a useful simulation-based approach for stochastic optimization problems such as the problems in Discrete Event Dynamic Systems (DEDS). However, OO cannot be applied directly for the problem since many infeasible decisions cannot be excluded from ordinal comparison without extensive computation involving the expectation operation. In this paper, a new approach for solving constrained ordinal optimization (COO) problems is presented. The key idea of our method for constrained OO problems is to estimate the feasibility of decisions and to choose selected subset based on the estimated feasibility. Any crude method such as the one based on rough set theory developed in our previous work can be applied to determine the decision feasibility efficiently. The algorithm for subset selection and the procedure of Blind Picking with Feasibility Model (BPFM) for COO are derived in the paper. The infeasible decisions are excluded by an imperfect feasibility model in the procedure of subset selection. The performance of the new method is evaluated and compared with the regular OO method. Numerical testing with two examples including the planning problem of a practical remanufacturing system shows that to meet the same required alignment probability, BPFM is more efficient than pure Blind Picking in regular OO. The research presented in this paper is supported in part by the National Outstanding Young Investigator Grant (6970025), National Science Foundation (60243001, 60274011, 60574067) and 863 High Tech Development Plan (2001AA413910) of China. The research effort of Ho is supported in part by U.S. Army Research Office (contract DAAD19-01-1-0610), U.S. Air Force Office of Scientific Research (contract F49620-01-1-0288).  相似文献   

12.
Functional refinement is beneficial to object-oriented (OO) software development, especially for problems with more complex functions. However, the use of functional refinement in OO software development has not received much attention. This paper proposes an enhanced data flow diagram (DFD), called data flow net (DF net), for specifying use-cases through functional decomposition. It proposes a novel approach to complement existing OO software development methods with functional decomposition for realizing use-cases, especially those with more complex functions. In the requirements analysis stage, the proposed approach realizes use-cases through functional refinement and specifies them in DF nets. In the design and implementation stages, it transforms the DF nets systematically and precisely into OO design and implementation. The approach is amenable to automation and a prototype has been developed to support the transformation process. In the development of an OO system, it is seamless to realize some of the use-cases using the proposed approach and the remaining use-cases in the same target system using any existing OO software development methods.  相似文献   

13.
模块变更预测对于面向对象软件的开发和维护工作具有重要意义。针对软件的模块变更预测问题,首先在软件类之间依赖关系的基础上提出了一种轻量级的模块变更概率计算方法,然后利用Logistic回归模型对Eclipse 2.0系统进行了实验分析。实验结果表明:一方面,基于依赖关系的模块变更概率度量捕获了与传统面向对象度量不同的信息;另一方面,当与传统的面向对象度量一起使用时,它们能够在统计意义上显著地提高模块变更预测的准确性。  相似文献   

14.
《Information Systems》1999,24(2):113-129
Object-oriented (OO) systems development theory has rapidly evolved. Generally, there is a concern about the current inconsistent state of OO theory. There is a lack of a shared understanding of the basic concepts and of a common vocabulary for discussing them. Although recent efforts have contributed to organizing OO concepts, a complete model of OO based on the areas of analysis, design and programming is still lacking. This study develops and applies an approach to build such a definition of OO concepts using metamodeling. Metamodels of existing OO methodologies were created and then integrated into a single metamodel that defines OO concepts and their relationships. A number of useful applications of this OO metamodel are proposed, including in methodology development and selection. The main contribution of this approach is its focus on bridging the gap that exists between the OO analysis and design area and the area of OO programming.  相似文献   

15.
Comprehending object and process models: an empirical study   总被引:1,自引:0,他引:1  
We report the results of an empirical study comparing user comprehension of object oriented (OO) and process oriented (PO) models. The fundamental difference is that while OO models tend to focus on structure, PO models tend to emphasize behaviour or processes. Proponents of the OO modeling approach argue that it lends itself naturally to the way humans think. However, evidence from research in cognitive psychology and human factors suggests that human problem solving is innately procedural. Given these conflicting viewpoints, we investigate empirically if OO models are in fact easier to understand than PO models. But, as suggested by the theory of cognitive fit, model comprehension may be influenced by task-specific characteristics. We therefore compare OO and PO models based on whether the comprehension activity involves: 1) only structural aspects, 2) only behavioral aspects, or 3) a combination of structural and behavioral aspects. We measure comprehension through subjects' responses to questions designed along these three dimensions. Results show that for most of the simple questions, no significant difference was observed insofar as model comprehension is concerned. For most of the complex questions, however, the PO model was found to be easier to understand than the OO model. In addition to describing the process and the outcomes of the experiments, we present the experimental method employed as a viable approach for conducting research into various phenomena related to the efficacy of alternative systems analysis and design methods. We also identify areas where future research is necessary, along with a recommendation of appropriate research methods for empirical examination  相似文献   

16.
In this paper, we present a federated query processing approach to evaluate queries on an Object-Oriented (OO) federated database. This approach has been designed and implemented in the OO-Myriad project, which is an OO extension to the Myriad FDBS researchmyriad:94. Since data integration is performed as part of federated query processing, we have proposed outerjoin, outer-difference and generalized attribute derivation operations together with the traditional relational operations, to be used for integration purposes. To define an OO federated database as a virtual view on multiple OO export databases, we adopt a database mapping strategy that systematically derives each of the class extents, deep class extents and relationships of the federated database using an operator tree consisting of the integration operations. By augmenting federated database queries with this algebraic mapping information, query execution plans can be generated. Based on the original Myriad query processing framework, we have realized the proposed OO federated query processing approach in the OO-Myriad prototype.  相似文献   

17.
We present an empirical validation of object-oriented size estimation models. In previous work we proposed object oriented function points (OOFP), an adaptation of the function points approach to object-oriented systems. In a small pilot study, we used the OOFP method to estimate lines of code (LOC). In this paper we extend the empirical validation of OOFP substantially, using a larger data set and comparing OOFP with alternative predictors of LOC. The aim of the paper is to gain an understanding of which factors contribute to accurate size prediction for OO software, and to position OOFP within that knowledge. A cross validation approach was adopted to build and evaluate linear models where the independent variable was either a traditional OO entity (classes, methods, association, inheritance, or a combination of them) or an OOFP-related measure. Using the full OOFP process, the best size predictor achieved a normalized mean squared error of 38%. By removing function point weighting tables from the OOFP process, and carefully analyzing collected data points and developer practices, we identified several factors that influence size estimation. Our empirical evidence demonstrates that by controlling these factors size estimates could be substantially improved, decreasing the normalized mean squared error to 15%—in relative terms, a 56% reduction.  相似文献   

18.
In addition to offering a simple yet powerful method for decomposing a system, function-class decomposition (FCD) produces an architecture that is more supportive than traditional object-oriented decomposition for several software engineering tasks. A hybrid method that integrates structured analysis with an OO approach, FCD identifies classes in parallel with decomposing the system into a hierarchy of functional modules. Recently, developers extended FCD to integrate UML concepts. Useful for partitioning a system for distribution, the FCD hierarchy provides a framework for controlling development in a distributed software engineering environment. It also helps identify and integrate components in component-based development and supports the system life-cycle maintenance phase. Further, FCD addresses many of the initial analysis and design problems inherent in large and complex OO systems. The authors' experience with testing FCD on several applications validates its compatibility with OO methodologies and modeling techniques  相似文献   

19.
采用邻接矩阵表示项目活动网络图需要较多的存储空间,且基于结构化程序设计思想实现网络图和关键路径算法都非常繁琐。采用面向对象的类表示活动,基于动态数组表示活动网络图及活动之间的逻辑关系,并据此开发了基于面向对象技术实现关键路径算法的代码,进一步从理论上分析了采用面向对象技术的优势。研究表明,相对于传统的处理方式,基于面向对象技术的项目活动网络图表示及关键路径的算法较大降低了存储和计算的复杂性。  相似文献   

20.
Developers apply object-oriented (OO) design principles to produce modular, reusable software. Therefore, service-specific groups of related software classes called modules arise in OO systems. Extracting the modules is critical for better software comprehension, efficient architecture recovery, determination of service candidates to migrate legacy software to a service-oriented architecture, and transportation of such services to cloud-based distributed systems. In this study, we propose a novel approach to automatic module extraction to identify services in OO software systems. In our approach, first we create a weighted and directed graph of the software system in which vertices and edges represent the classes and their relations, respectively. Then, we apply a clustering algorithm over the graph to extract the modules. We calculate the weight of an edge by considering its probability of being within a module or between modules. To estimate these positional probabilities, we propose a machine-learning-based classification system that we train with data gathered from a real-world OO reference system. We have implemented an automatic module extraction tool and evaluated the proposed approach on several open-source and industrial projects. The experimental results show that the proposed approach generates highly accurate decompositions that are close to authoritative module structures and outperforms existing methods.  相似文献   

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

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