Application and Research of AOP Technology and Application Research of AOP technology

Source: Internet
Author: User

Application and Research of AOP Technology and Application Research of AOP technology

Aspect-Oriented Programming (AOP) is a new software development technology for Object-Oriented Programming (Object. oriented Programming (oop) is proposed when dealing with non-core requirements across multiple modules.

The Application and Research Series of AOP technology first analyzes the advantages and disadvantages of Object-Oriented Programming (OOP), and then introduces the AOP technology. Introduce the basic idea and concept of AOP. The idea of AOP is further analyzed through introduction and implementation of the AOP language (especially the implementation analysis of the Spring AOP framework. Finally, the general steps of AOP technology development are summarized through the actual application of AOP technology. Through the comparison between OOP Technology and AOP technology, it demonstrates that AOP separates modules unrelated to the system's core business implementation, reduces the Coupling Degree between modules, and improves the development efficiency. This demonstrates the advantages of AOP in dealing with non-core requirements: good code readability, low redundancy, good scalability, and high reuse rate.


Currently, the AOP technology application and research series have six blog posts, and four have been completed. See the following table. Here, the sample code of the AOP technology application and research application has been completed, and I have already shared it on github.Aop https://github.com/demiaowu/aopIf you have any errors or questions, contact your cfreestar@163.com. For more information, see the end of this document. If you have not added any information, contact us and I will modify or delete it in time.


Application and Research of AOP technology -- OOP

Application and Research of AOP technology-Overview of AOP

Application and Research of AOP technology-AOP Language

Application and Research of AOP technology -- Dynamic proxy

Application and Research of AOP technology -- SpringAop implementation principle

Application and Research of AOP technology -- Application of AOP

[1] lanhongyuan, LAN Hong-yuan. Aspect-oriented programming methods [Journal Papers]-computer knowledge and technology (Academic Exchange) 2007,2 (9)

[2] He Qing and. Research on AOP programming ideology-software guide Journal, (3)

[3] Wei. Research and Application of the inverse method of Aspect-Oriented Programming [dissertation] 2008

[4] xingjun. Research and Application of AOP development process [dissertation] 2007

[5] Jin Wangzheng, Li Ying, Xu Jianghao, Li gansheng, Jin Wangzheng, Li Ying, Xu Jianghao, LiGansheng. research on Aspect-Oriented Programming Technology [Journal Papers]-computer applications and software (8)

[6] gang, Shuo, HUZhi-gang, NI Shuo. Aspect-Oriented Programming and its implementation technologies [Journal Papers]-computer engineering and design (8)

[7] Guo Dongliang, ZHANG lichen, GUODong-liang, and ZHANG Li-Chen. Research on Aspect-Oriented Software Development [Journal Papers]-Computer Application Research (8)

[8] Deng A-Qun, Li Xiaojun, Yu huanjun, Hu shangpo. Research on a New software design method AOP [journal paper]-system engineering and electronic technology (7)

[9] LIN Yun, LIN Yun. Research Based on Aspect-oriented programming methods [Journal Papers]-computer knowledge and technology (8)

[10] Song Xiaopeng, Sheng Zhongyi, Pan hongxia, and Bai Xiaofeng. Research on Aspect-oriented programming methods [journal paper]-Microcomputer Information 2006 (12)

[11] Wei zhenyuan. Research and Discussion Based on AOP technology. Application Science. 2008 (15)

[12] Zhang qianxi, Wang huaimin. Research and Implementation of Software running track capture technology based on AOP [journal paper]-computer application 2008 (5)

[13] Zhang qianxi, Guo Changguo, Yuan hongliang, and Wang huaimin. research and Implementation of a General thread Monitoring Platform Based on AOP technology [Journal Papers]-computer engineering and science 2007 (5)

[14] TANG zuyu, PENG Zhiyong, TANG Zukai, PENG Zhiyong. A summary of research on Aspect-Oriented Programming Languages. Computer science and exploration. 2010,4 (1)

[15] LV hangfei. Analysis of AOP programming technology. computer knowledge and technology (Academic Exchange). 2007,4 (21)

[16] Huang Lei on AOP and OOP, computer knowledge and technology (Academic Exchange), (20)

[17] Wang shenyuan, Dong Chuanliang, Liu yingdan. Research and Implementation of Aspect-Oriented Programming. Computer Application Research (11)

[18] Ramnivas Laddad I want my AOP !. (Part1 ~ Part3)

[19] yuan Xufeng. AOP Programming Based on Spring wide false. Computer and modernization. 2006 (1)

[20] TANG zuyu, PENG Zhiyong, TANG Zukai, and PENG Zhiyong. A summary of research on Aspect-Oriented Programming Languages. Computer science and exploration, (1)

[21] Wang xuesong, Chen Zhan, Tang xuefei. Research on AOP and its Weaving Technology. Fujian computer 2006 (3)


Use of aop

How to Use AOP?

(1) Dynamic proxy to implement AOP:

To consider an e-commerce system, you must add or delete orders. Undoubtedly, in actual application scenarios, these actions should be combined with permission management, and only authorized users can implement these actions. The pseudocode of the traditional design method is as follows:
Public class OrderManager
{
Private ArrayList m_Orders;
Public OrderManager ()
{
M_Orders = new ArrayList ();
}
Public void AddOrder (Order order)
{
If (permissions. Verify (Permission. ADMIN ))
{

M_Orders.Add (order );
}
}

Public void RemoveOrder (Order order)
{
If (permissions. Verify (Permission. ADMIN ))
{
M_Orders.Remove (order );
}
}
}

Similarly, the E-commerce system also needs to manage commodities. It adopts the same authorization mechanism:
Public class ProductManager
{
Private ArrayList m_Products;
Public ProductManager ()
{
M_Products = new ArrayList ();
}
Public void AddProduct (Product product)
{
If (permissions. Verify (Permission. ADMIN ))
{
M_Products.Add (product );
}
}
Public void RemoveProduct (Product product)
{
If (permissions. Verify (Permission. ADMIN ))
{
M_Products.Remove (product );
}
}
}

In this way, the core business of the entire E-commerce system includes order management and commodity management, which all require the same permission management, as shown in Figure 2.4:

Figure 2.4 permission verification for e-commerce systems

Without a doubt, we can use AOP technology to separate the core concerns and cross-cutting concerns of the system and intercept Internal messages of Business Management Behaviors from a horizontal perspective, to achieve the purpose of organizing the permission management logic. When AddOrder () and other methods are executed, the system will verify the user's permissions and call the cross-concern logic. Therefore, this method is the join point of AOP. For e-commerce systems, each method that requires permission verification is a separate join point. Because permission verification is performed before each method is executed, you only need to define a point cut for this series of join points. When the system executes a join point, it searches for the corresponding point cut according to the definition, and then executes the logic to be implemented by this cross-cutting concern, that is, advice. Point cut and advice combine into a permission management aspect.

Figure 2.5 AOP ...... remaining full text>

What is the principle of spring ioc aop? What should I do during the interview? Good interview skills

I will give you an authoritative answer, and you will not have to answer this question.
IOC (Reverse Control): controls the assignment of member variables from the code to the configuration file.
AOP: Aspect (Aspect) Oriented (for) Programming (Programming), for Aspect Programming.
That's enough. Let's look at Spring's transaction processing, basically.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.