登录

  • 登录
  • 忘记密码?点击找回

注册

  • 获取手机验证码 60
  • 注册

找回密码

  • 获取手机验证码60
  • 找回
毕业论文网 > 毕业论文 > 计算机类 > 计算机科学与技术 > 正文

AOP基本原理模拟(C 版)

 2023-03-08 03:03  

论文总字数:16112字

摘 要

AOP是Aspect Oriented Programming的缩写,Aspect Oriented Programming按中文翻译过来就是面向切面编程。实现AOP有俩个办法,一种是通过采用做一些代码文本的替换工作的方式,这种方式也叫预处理,第二种就是动态代理,通过使用这俩种方式,程序员就能够完成不对源文件进行改动,也能够为之增加新的功能的任务。AOP可以有效的减少了代码的重复,给程序员在编程的时候带来了便利。

相比较于面向对象编程而言,面向切面编程可以说是它的一种扩展和延伸,与此同时面向切面编程还在面向对象编程的基础上进行了进一步的完善。AOP技术采用了一种技术,这种技术能够将原有的程序进行细化分成了俩个重要的组成部分,一个是核心关注点,还有一个就是横切关注点了,这种技术被称之为“横切”技术。本课题模拟简单的AOP原理,主要研究通过一些简单的文件读取和字符串操作来实现AOP中的静态织入功能。

关键字:面向切面编程;Aspect段;静态织入;横切

Basic principle of AOP simulation (c edition)

Abstract

AOP is the abbreviation of Aspect Oriented Programming, Aspect Oriented Programming in Chinese translation is aspect-oriented programming. There are two ways to achieve AOP, one is through the use of some text to do the replacement of the text of the way, this approach is also called pre-processing, the second is the dynamic agent, through the use of these two ways, the programmer will be able to complete the wrong Source files to change, but also to add new features to the task. AOP can effectively reduce the duplication of the code, to the programmer in the programming time to bring convenience.

This topic simulates the simple AOP principle. Compared with object-oriented programming, aspect-oriented programming can be said to be an extension and extension of it, while cutting-oriented programming is also based on object-oriented programming on the basis of further improvement. AOP technology uses a technology, this technology can be refined into the original program into two important components, one is the core concerns, there is a crosscut concern, and this technology is called As "cross-cutting" technology.

Through some simple file read and string operations to achieve AOP in the static weaving function.

Keywords:aspect oriented programming; Aspect period; reduce duplication of code

目 录

摘要 1

Basic principle of AOP simulation (c edition) 2

第一章 概论 5

1.1 研究背景 5

1.2 课题目的和意义 5

1.3目标和内容 6

1.3.1实验原理 6

1.3.2主要目标 7

1.3.3主要内容 7

第二章  相关开发环境和技术介绍 8

2.1开发工具 8

2.2开发语言 8

2.3 AOP技术介绍 9

第三章 系统设计和实现 10

3.1需求分析 10

3.2程序概述 10

3.2.1主要界面 10

3.2.2织入页面 10

3.2.3运行 10

3.3程序流程图 10

3.3系统具体设计与实现 11

3.3.1按钮事件 11

3.3.2保存按钮 12

3.3.3读取主文件和aspect段的文件名 13

3.3.4通过设置标志位来决定织入的位置 13

第四章 系统测试与分析 16

4.1程序测试的目的和意义 16

4.2实验步骤与结果 16

第五章 总结 20

致谢 21

参考文献 22

概论

1.1 研究背景

面向切面编程是在面向对象编程之后的诞生的另外一种程序设计方法。伴随着人类需求的进步,程序员所要面对的系统开发中的对象关系也变得越来越多层次化,在对面向对象的理论的理解越来越深刻的时候,它所体现出来的不足也就越来越明显了,因此,程序员们对于编程模式的需求越发的丰富,面向切面编程便诞生了。正是由于传统软件开发技术的模式固定,才导致了在软件开发过程中出现了混乱的代码和一种被称为“横切特征”的现象,进而使得程序员在开发软件的时候效率偏低,而且不利于系统的维护。1997年施乐公司在PARC研究中心里提出了:元对象协议开放实现和适应性编程等一系列相关技术及其实践的基础之上,系统的提出了以"方面分离"概念为核心的AOP技术,并实现了雏型编程语言AspectJ。[[1]]在同一时间段中,其他的一些研究机构也提出了许多和AOP相似的编程思想,还有一些机构甚至做出了一些支持面向切面编程原理的原型工具,荷兰Utwente大学的过滤器合成技术和他研发的ComposeJ还有watson研究中心的Peri tarr提出的多维关注分离技术和HyoerJ就是当时时代下的产物。

相对于已经被大众所广泛接受的面向对象和面向过程编程语言而言,新兴的AOP(面向切面编程)距离被群众广泛使用的期待还有些久远。在现在的科技背景下,程序员在初学编程的时候,都需要学会先考虑程序中需要实现的功能,然后将这些功能转化为各种不同的类,在这之后还需要定义这些类的行为,以及它们各自的一些属性和相互间的联系。面向切面编程(Aspect-Oriented Programming,AOP)的诞生就像历史上的工业革命一样解放了程序员的思维模式,让程序的实现有了更多的可行性。

剩余内容已隐藏,请支付后下载全文,论文总字数:16112字

您需要先支付 80元 才能查看全部内容!立即支付

企业微信

Copyright © 2010-2022 毕业论文网 站点地图