Spring AOP(Aspect Oriented Programming) Tutorials

In the enterprise level application programming we used to add different cross-cutting functionalities [cross-cutting functionalities means adding different types of services to the application at runtime automatically ]

For instance…
这里写图片描述

See in the above example, we are using 3 cross-cutting functionalities [ authentication,logging,transaction ] in 2 methods. If we are going to do any modifications in logging service we need to modify 2 times right ? may be 100 times if we wrote in 100 methods which is very difficult. If i want to remove one service we need to open class file and delete the required things and need recompile, re-deploy needed.

So to avoid this, in spring AOP we can add these cross-cutting functionalities at run time :-) i mean we can separate the services [ cross-cutting functionalities ] and our client logic.

这里写图片描述
So that our class length will be decreased.
Finally……………………….

  • While implementing business logic for real time applications, apart from business logic some other services also will be added to make that as enterprise level one.
  • According to spring, the services that are overlapping on the business logic are called as cross-cutting functionalities, we already saw the drawbacks of implementing business logic + services.
  • In order to overcome the above problems, we need to separate the business logic and the services, we call this process of separation as AOP, Using AOP the business logic and cross-cutting functionalities are implemented separately and executed at run time as combine.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值