{"id":2122,"date":"2017-10-11T11:32:16","date_gmt":"2017-10-11T03:32:16","guid":{"rendered":"http:\/\/www.xttblog.com\/?p=2122"},"modified":"2017-10-11T11:32:16","modified_gmt":"2017-10-11T03:32:16","slug":"%e5%9b%be%e8%a7%a3spring-aop%e5%8e%9f%e7%90%86%e3%80%81%e6%9c%ba%e5%88%b6","status":"publish","type":"post","link":"https:\/\/www.xttblog.com\/?p=2122","title":{"rendered":"\u56fe\u89e3Spring AOP\u539f\u7406\u3001\u673a\u5236"},"content":{"rendered":"<p>\n\t\u9762\u8bd5\u4e2d <a href=\"https:\/\/www.xttblog.com\/?tag=AOP\" name=\"AOP\" target=\"_blank\" title=\"AOP\">AOP<\/a> \u662f\u4e00\u4e2a\u79bb\u4e0d\u5f00\u7684\u8bdd\u9898\u3002\u7cbe\u901a <a href=\"https:\/\/www.xttblog.com\/?tag=AOP\" name=\"AOP\" target=\"_blank\" title=\"AOP\">AOP<\/a> \uff0c\u5728\u5b9e\u9645\u7684\u7f16\u7a0b\u4e2d\u66f4\u80fd\u8ba9\u6211\u4eec\u5f97\u5fc3\u5e94\u624b\uff01\u672c\u6587\u5c06\u7ed3\u5408\u81ea\u5df1\u7684\u7ecf\u9a8c\uff0c\u4f7f\u7528\u56fe\u6587\u5e76\u8302\u7684\u8bed\u8a00\u7ed9\u5927\u5bb6\u8bb2\u660e\u4ec0\u4e48\u662f Spring <a href=\"https:\/\/www.xttblog.com\/?tag=AOP\" name=\"AOP\" target=\"_blank\" title=\"AOP\">AOP<\/a>\uff1f\n<\/p>\n<h2>\n\t\u4ec0\u4e48\u662f AOP\uff1f<br \/>\n<\/h2>\n<p>\n\t<a href=\"https:\/\/www.xttblog.com\/?tag=AOP\" name=\"AOP\" target=\"_blank\" title=\"AOP\">AOP<\/a>\uff08Aspect-OrientedProgramming\uff0c\u9762\u5411\u65b9\u9762\u7f16\u7a0b\uff09\uff0c\u53ef\u4ee5\u8bf4\u662fOOP\uff08Object-Oriented Programing\uff0c\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\uff09\u7684\u8865\u5145\u548c\u5b8c\u5584\u3002OOP\u5141\u8bb8\u4f60\u5b9a\u4e49\u4ece\u4e0a\u5230\u4e0b\u7684\u5173\u7cfb\uff0c\u4f46\u5e76\u4e0d\u9002\u5408\u5b9a\u4e49\u4ece\u5de6\u5230\u53f3\u7684\u5173\u7cfb\u3002\u4f8b\u5982\u65e5\u5fd7\u529f\u80fd\u3002\u65e5\u5fd7\u4ee3\u7801\u5f80\u5f80\u6c34\u5e73\u5730\u6563\u5e03\u5728\u6240\u6709\u5bf9\u8c61\u5c42\u6b21\u4e2d\uff0c\u800c\u4e0e\u5b83\u6240\u6563\u5e03\u5230\u7684\u5bf9\u8c61\u7684\u6838\u5fc3\u529f\u80fd\u6beb\u65e0\u5173\u7cfb\u3002\u8fd9\u79cd\u6563\u5e03\u5728\u5404\u5904\u7684\u65e0\u5173\u7684\u4ee3\u7801\u88ab\u79f0\u4e3a\u6a2a\u5207\uff08cross-cutting\uff09\u4ee3\u7801\uff0c\u5728OOP\u8bbe\u8ba1\u4e2d\uff0c\u5b83\u5bfc\u81f4\u4e86\u5927\u91cf\u4ee3\u7801\u7684\u91cd\u590d\uff0c\u800c\u4e0d\u5229\u4e8e\u5404\u4e2a\u6a21\u5757\u7684\u91cd\u7528\u3002\n<\/p>\n<p>\n\t<img decoding=\"async\" alt=\"\u4ec0\u4e48\u662f AOP\uff1f\" src=\"http:\/\/ocuzluml6.bkt.clouddn.com\/20171011110844.png\" style=\"width: 828px;height: 384px\" \/>\n<\/p>\n<p>\n\t\u800c<a href=\"https:\/\/www.xttblog.com\/?tag=AOP\" name=\"AOP\" target=\"_blank\" title=\"AOP\">AOP<\/a>\u6280\u672f\u5219\u6070\u6070\u76f8\u53cd\uff0c\u5b83\u5229\u7528\u4e00\u79cd\u79f0\u4e3a&ldquo;\u6a2a\u5207&rdquo;\u7684\u6280\u672f\uff0c\u5256\u89e3\u5f00\u5c01\u88c5\u7684\u5bf9\u8c61\u5185\u90e8\uff0c\u5e76\u5c06\u90a3\u4e9b\u5f71\u54cd\u4e86\u591a\u4e2a\u7c7b\u7684\u516c\u5171\u884c\u4e3a\u5c01\u88c5\u5230\u4e00\u4e2a\u53ef\u91cd\u7528\u6a21\u5757\uff0c\u5e76\u5c06\u5176\u540d\u4e3a&ldquo;Aspect&rdquo;\uff0c\u5373\u65b9\u9762\u3002\u6240\u8c13&ldquo;\u65b9\u9762&rdquo;\uff0c\u7b80\u5355\u5730\u8bf4\uff0c\u5c31\u662f\u5c06\u90a3\u4e9b\u4e0e\u4e1a\u52a1\u65e0\u5173\uff0c\u5374\u4e3a\u4e1a\u52a1\u6a21\u5757\u6240\u5171\u540c\u8c03\u7528\u7684\u903b\u8f91\u6216\u8d23\u4efb\u5c01\u88c5\u8d77\u6765\uff0c\u4fbf\u4e8e\u51cf\u5c11\u7cfb\u7edf\u7684\u91cd\u590d\u4ee3\u7801\uff0c\u964d\u4f4e\u6a21\u5757\u95f4\u7684\u8026\u5408\u5ea6\uff0c\u5e76\u6709\u5229\u4e8e\u672a\u6765\u7684\u53ef\u64cd\u4f5c\u6027\u548c\u53ef\u7ef4\u62a4\u6027\u3002\n<\/p>\n<h2>\n\tAOP \u7684\u4f7f\u7528\u573a\u666f<br \/>\n<\/h2>\n<p>\n\t<a href=\"https:\/\/www.xttblog.com\/?tag=AOP\" name=\"AOP\" target=\"_blank\" title=\"AOP\">AOP<\/a> \u6846\u67b6\u79cd\u7c7b\u5982\u4e0b\uff1a\n<\/p>\n<ul>\n<li>\n\t\tAspectJ\n\t<\/li>\n<li>\n\t\tJBoss AOP\n\t<\/li>\n<li>\n\t\tSpring AOP\n\t<\/li>\n<\/ul>\n<p>\n\t\u4f7f\u7528 AOP \u53ef\u4ee5\u505a\u7684\u4e8b\u60c5\u6709\u5f88\u591a\u3002\n<\/p>\n<ul>\n<li>\n\t\t\u6027\u80fd\u76d1\u63a7\uff0c\u5728\u65b9\u6cd5\u8c03\u7528\u524d\u540e\u8bb0\u5f55\u8c03\u7528\u65f6\u95f4\uff0c\u65b9\u6cd5\u6267\u884c\u592a\u957f\u6216\u8d85\u65f6\u62a5\u8b66\u3002\n\t<\/li>\n<li>\n\t\t\u7f13\u5b58\u4ee3\u7406\uff0c\u7f13\u5b58\u67d0\u65b9\u6cd5\u7684\u8fd4\u56de\u503c\uff0c\u4e0b\u6b21\u6267\u884c\u8be5\u65b9\u6cd5\u65f6\uff0c\u76f4\u63a5\u4ece\u7f13\u5b58\u91cc\u83b7\u53d6\u3002\n\t<\/li>\n<li>\n\t\t\u8f6f\u4ef6\u7834\u89e3\uff0c\u4f7f\u7528<a href=\"https:\/\/www.xttblog.com\/?tag=AOP\" name=\"AOP\" target=\"_blank\" title=\"AOP\">AOP<\/a>\u4fee\u6539\u8f6f\u4ef6\u7684\u9a8c\u8bc1\u7c7b\u7684\u5224\u65ad\u903b\u8f91\u3002\n\t<\/li>\n<li>\n\t\t\u8bb0\u5f55\u65e5\u5fd7\uff0c\u5728\u65b9\u6cd5\u6267\u884c\u524d\u540e\u8bb0\u5f55\u7cfb\u7edf\u65e5\u5fd7\u3002\n\t<\/li>\n<li>\n\t\t\u5de5\u4f5c\u6d41\u7cfb\u7edf\uff0c\u5de5\u4f5c\u6d41\u7cfb\u7edf\u9700\u8981\u5c06\u4e1a\u52a1\u4ee3\u7801\u548c\u6d41\u7a0b\u5f15\u64ce\u4ee3\u7801\u6df7\u5408\u5728\u4e00\u8d77\u6267\u884c\uff0c\u90a3\u4e48\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528<a href=\"https:\/\/www.xttblog.com\/?tag=AOP\" name=\"AOP\" target=\"_blank\" title=\"AOP\">AOP<\/a>\u5c06\u5176\u5206\u79bb\uff0c\u5e76\u52a8\u6001\u6302\u63a5\u4e1a\u52a1\u3002\n\t<\/li>\n<li>\n\t\t\u6743\u9650\u9a8c\u8bc1\uff0c\u65b9\u6cd5\u6267\u884c\u524d\u9a8c\u8bc1\u662f\u5426\u6709\u6743\u9650\u6267\u884c\u5f53\u524d\u65b9\u6cd5\uff0c\u6ca1\u6709\u5219\u629b\u51fa\u6ca1\u6709\u6743\u9650\u6267\u884c\u5f02\u5e38\uff0c\u7531\u4e1a\u52a1\u4ee3\u7801\u6355\u6349\u3002\n\t<\/li>\n<\/ul>\n<p>\n\t\u770b\u4e0b\u9762\u4f20\u7edf\u7f16\u7801\u65b9\u5f0f\u4e0e\u4f7f\u7528aop\u7684\u533a\u522b \u3002\n<\/p>\n<p>\n\t<img decoding=\"async\" alt=\"\u4f20\u7edf\u7f16\u7801\u65b9\u5f0f\u4e0e\u4f7f\u7528aop\u7684\u533a\u522b\" src=\"http:\/\/ocuzluml6.bkt.clouddn.com\/20171011111336.png\" style=\"width: 805px;height: 601px\" \/>\n<\/p>\n<h2>\n\tAOP\u6838\u5fc3\u6982\u5ff5<br \/>\n<\/h2>\n<p>\n\t\u63cf\u8ff0<a href=\"https:\/\/www.xttblog.com\/?tag=AOP\" name=\"AOP\" target=\"_blank\" title=\"AOP\">AOP<\/a>\u5e38\u7528\u7684\u4e00\u4e9b\u672f\u8bed\u6709\u901a\u77e5(Adivce)\u3001\u5207\u70b9\uff08Pointcut\uff09\u3001\u8fde\u63a5\u70b9\uff08Join point\uff09\u3001\u5207\u9762\uff08Aspect\uff09\u3001\u5f15\u5165\uff08Introduction\uff09\u3001\u7ec7\u5165\uff08Weaving\uff09\u3001\u901a\u77e5\uff08Advice\uff09\u7b49\u3002\n<\/p>\n<p>\n\t<img decoding=\"async\" alt=\"AOP\u6838\u5fc3\u6982\u5ff5\" src=\"http:\/\/img.bbs.csdn.net\/upload\/201710\/11\/1507695149_265147.png\" style=\"width: 928px;height: 830px\" \/>\n<\/p>\n<p>\n\t\u4ee5\u4e0a\uff0c\u6574\u7406\u4e86<a href=\"https:\/\/www.xttblog.com\/?tag=AOP\" name=\"AOP\" target=\"_blank\" title=\"AOP\">AOP<\/a>\u76f8\u5173\u7684\u77e5\u8bc6\uff0c\u4e0d\u662f\u5f88\u5168\uff0c\u4f46\u56fe\u6587\u5e76\u8302\u3002\u5927\u5bb6\u5171\u52c9\uff01<\/p>\n<!-- <audio autoplay=\"autoplay\" height=\"100\" width=\"100\" hidden=\"true\"><source src=\"https:\/\/c.coka.la\/orAvPR.mp3\" type=\"audio\/mp3\"\/><\/audio><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/ws3.sinaimg.cn\/large\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/> --><p><!-- <img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/xmt1139057136\/xttblog\/master\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/>--><img decoding=\"async\" src=\"https:\/\/saas.51autoparts.cn\/api\/admin\/sys-file\/oss\/file?fileName=84db51f8561e448f9a4fda2eff0811f9.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/><\/p><p>\u6700\u540e\uff0c\u6b22\u8fce\u5173\u6ce8\u6211\u7684\u4e2a\u4eba\u5fae\u4fe1\u516c\u4f17\u53f7\uff1a\u4e1a\u4f59\u8349\uff08yyucao\uff09\uff01<b>\u53ef\u52a0\u4f5c\u8005\u5fae\u4fe1\u53f7\uff1a<font color=\"red\">xttblog2<\/font>\u3002\u5907\u6ce8\uff1a\u201c1\u201d\uff0c\u6dfb\u52a0\u535a\u4e3b\u5fae\u4fe1\u62c9\u4f60\u8fdb\u5fae\u4fe1\u7fa4\u3002\u5907\u6ce8\u9519\u8bef\u4e0d\u4f1a\u540c\u610f\u597d\u53cb\u7533\u8bf7\u3002<\/b>\u518d\u6b21\u611f\u8c22\u60a8\u7684\u5173\u6ce8\uff01\u540e\u7eed\u6709\u7cbe\u5f69\u5185\u5bb9\u4f1a\u7b2c\u4e00\u65f6\u95f4\u53d1\u7ed9\u60a8\uff01\u539f\u521b\u6587\u7ae0\u6295\u7a3f\u8bf7\u53d1\u9001\u81f3532009913@qq.com\u90ae\u7bb1\u3002\u5546\u52a1\u5408\u4f5c\u4e5f\u53ef\u6dfb\u52a0\u4f5c\u8005\u5fae\u4fe1\u8fdb\u884c\u8054\u7cfb\uff01<\/p><p>\u672c\u6587\u539f\u6587\u51fa\u5904\uff1a<a href=\"https:\/\/www.xttblog.com\">\u4e1a\u4f59\u8349<\/a>\uff1a &raquo; <a href=\"https:\/\/www.xttblog.com\/?p=2122\">\u56fe\u89e3Spring AOP\u539f\u7406\u3001\u673a\u5236<\/a><\/p><!-- <div class=\"bd-reward-stl\"><button id=\"bdRewardBtn\"><span><\/span><\/button><\/div> -->","protected":false},"excerpt":{"rendered":"<p>\u9762\u8bd5\u4e2d AOP \u662f\u4e00\u4e2a\u79bb\u4e0d\u5f00\u7684\u8bdd\u9898\u3002\u7cbe\u901a AOP \uff0c\u5728\u5b9e\u9645\u7684\u7f16\u7a0b\u4e2d\u66f4\u80fd\u8ba9\u6211\u4eec\u5f97\u5fc3\u5e94\u624b\uff01\u672c\u6587\u5c06\u7ed3\u5408\u81ea\u5df1\u7684\u7ecf\u9a8c\uff0c\u4f7f [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[1511,551,1512],"class_list":["post-2122","post","type-post","status-publish","format-standard","hentry","category-java","tag-aop","tag-spring","tag-1512"],"_links":{"self":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/2122","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2122"}],"version-history":[{"count":1,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/2122\/revisions"}],"predecessor-version":[{"id":2123,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/2122\/revisions\/2123"}],"wp:attachment":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2122"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2122"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2122"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}