{"id":456,"date":"2017-08-10T04:02:08","date_gmt":"2017-08-10T04:02:08","guid":{"rendered":"http:\/\/alexanderramsey.com\/blog\/?p=456"},"modified":"2017-08-10T04:11:44","modified_gmt":"2017-08-10T04:11:44","slug":"java-aop","status":"publish","type":"post","link":"http:\/\/alexanderramsey.com\/blog\/?p=456","title":{"rendered":"Java AOP"},"content":{"rendered":"<p>AspectJ Notes: Aspect Oriented Programming allows you to achieve an extra level of separation of concerns ontop of OOP methodology.<\/p>\n<p>Key terms:<br \/>\n&#8211; Pointcut defines wherein the code a joinpoint (injection is what they should&#8217;ve called it) will occur.<br \/>\n&#8211; Advice defines what happens at the specific joinpoint.<br \/>\n&#8211; Weaving is the process of injecting the advice into the joinpoints.<\/p>\n<p>Example code:<\/p>\n<p><code>public aspect LicenseFee {<\/p>\n<p>\t\/\/ playing with this to see if I can get this to work<br \/>\n\t\/\/ eclipse constantly checks to see if you actually are implementing the method before weaving occurs<br \/>\n\t\/\/ almost like it actively weaves before runtime, no wonder my computer is so slow running this thing<br \/>\n\t\/\/ so that means that when I go to run tests, some errors may occur but it should be okay\/runnable despite the fact<\/p>\n<p>\tpointcut test(): target(Main) &&<br \/>\n\t\t\t(call(void testSaveAccount()));<\/p>\n<p>\tafter(): test(){<br \/>\n\t\tSystem.out.println(\"TestSaveAccount called\");<br \/>\n\t}<\/p>\n<p>\tpointcut test2(): target(Main) &&<br \/>\n\t\t\t(call(void testOpenAccount()));<\/p>\n<p>\tbefore(): test2(){<br \/>\n\t\tSystem.out.println(\"Derp\");<br \/>\n\t}<\/p>\n<p>}<\/code><\/p>\n<p><a href=\"https:\/\/eclipse.org\/aspectj\/doc\/next\/progguide\/semantics-advice.html\" target=\"_blank\">Eclipse Semantics for Advice<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>AspectJ Notes: Aspect Oriented Programming allows you to achieve an extra level of separation of concerns ontop of OOP methodology. Key terms: &#8211; Pointcut defines wherein the code a joinpoint (injection is what they should&#8217;ve called it) will occur. &#8211; Advice defines what happens at the specific joinpoint. &#8211; Weaving is the process of injecting [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32,37],"tags":[],"class_list":["post-456","post","type-post","status-publish","format-standard","hentry","category-rabbit-holes","category-random-projects"],"_links":{"self":[{"href":"http:\/\/alexanderramsey.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/456","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/alexanderramsey.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/alexanderramsey.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/alexanderramsey.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/alexanderramsey.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=456"}],"version-history":[{"count":4,"href":"http:\/\/alexanderramsey.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/456\/revisions"}],"predecessor-version":[{"id":461,"href":"http:\/\/alexanderramsey.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/456\/revisions\/461"}],"wp:attachment":[{"href":"http:\/\/alexanderramsey.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=456"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/alexanderramsey.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=456"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/alexanderramsey.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=456"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}