The Artima Developer Community
Sponsored Link

Java Community News
Applying Aspects in Practice

1 reply on 1 page. Most recent reply: Mar 24, 2006 11:02 AM by Michael Stover

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Bill Venners

Posts: 2284
Nickname: bv
Registered: Jan, 2002

Applying Aspects in Practice Posted: Mar 24, 2006 9:13 AM
Reply to this message Reply
Summary
In this developerWorks article, Ron Bodkin presents practical guidelines for incorporating aspects more deeply into your development practice. He describes various stages of AOP adoption, offers examples of learning applications and guidelines for success at each stage, and provides a survey of the AOP techniques and applications.
Advertisement

http://www-128.ibm.com/developerworks/java/library/j-aopwork16/

If you have used aspects to accomplish goals in real projects, I invite you to post about your experiences. I haven't yet gotten into aspects, but I would like to because I believe they are yet another tool I can use to improve productivity. I welcome any insights others can provide as to how aspects can be leveraged in practice.


Michael Stover

Posts: 28
Nickname: mstover
Registered: Jul, 2005

Re: Applying Aspects in Practice Posted: Mar 24, 2006 11:02 AM
Reply to this message Reply
I started learning aspectJ in order to make a nearly fully transparent dependency-injection tool (http://coinjema.sourceforge.net). By using aspects, my java objects are given configuration dependencies automatically when I call "new Object()". It also wires objects together and allows for shared dependencies (ie singletons that aren't actually singletons).

My experience with aspectJ indicates to me that aspects can be tricky and hard to get just right. Exactly how you implement your pointcuts can also have a large performance impact and there are many many ways to arrange your pointcuts to achieve the same effect. Also, although the documentation for aspectj is generally good, the nitpicky details of the differing semantics of the various pointcuts can cause confusion.

In creating a distribution of a jar file that offers very generic aspects intended to weave other's code, I've become aware of some potentially sticky issues with the potential proliferation of aspects in the world. Using one third-party library that uses aspects to weave your code is one thing. Using 10 such libraries, plus a few that already have weaved classes plus the possibility that you need to further weave them - well, I see the potential for nightmare city.

Also, the aspectj compiler has a few minor issues with java 5 generics. That said, I use it on a live webapp system and it has worked like a champ so far.

Flat View: This topic has 1 reply on 1 page
Topic: Applying Aspects in Practice Previous Topic   Next Topic Topic: Manage State with Continuation Servers

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use