Spring学习(二) AOP 面向切面编程之概念(一)

@Test
	public  void test() {
		//开始监听
		PerformanceMonitor.begin("com.example.demo.jdk.proxy.ForumServiceImpl.remove");
		//开始事务
		TranstationManager.begin();
		ForumService forumService=new ForumServiceImpl();
		forumService.remove(0);
		//结束事务
		TranstationManager.end();
		//结束监听
		PerformanceMonitor.end();
	}

  AOP 叫做面向切面编程

AOP要做的事情就是将业务逻辑---事务管理--性能监测  代码分离开. 

 

猜你喜欢

转载自www.cnblogs.com/chenfan29/p/10496170.html
今日推荐