|
June 2005
[
avasseur
]
11:31, Thursday, 23 June 2005
Following the Backport175 release that Jonas and I have done some days ago, and since AspectJ 1.5 upcoming M3 and especially the @Aspect style is starting to take shape after some month of hard work on my side, I think it is a good timing to also explain that this @Aspect sytle, despite its name tied to these Java 5 annotations, is not at all tied to Java 5, and will bring the plain Java aspect concept to all of you using Java 1.3 and 1.4 (from the real world).
The @Aspect style is also referred as @AJ, or annotation style, or this way to write aspect with annotation that we came up with thru AspectWerkz.
It mainly means that AspectJ allows you to write an aspects using wether the well known code style or the AspectWerkz like annotation style.
// code style public aspect SomeAspect { void before() : execution(* Foo.bar()) { // do some stuff // use thisJoinPoint etc } } // annotation style, here with Java 5 @Aspect public class SomeAspect { @Before("execution(* Foo.bar())") void before(JoinPoint thisJoinPoint) { // do some stuff // use thisJoinPoint etc } } // annotation style, backported to Java 1.3 or 1.4 /** * @Aspect */ public class SomeAspect { /** * @Before("execution(* Foo.bar())") */ void before(JoinPoint thisJoinPoint) { // do some stuff // use thisJoinPoint etc } } @interface Aspect
) backported to Java 1.3 in the form of regular interfaces (ie interface Aspect
) and then make sure you have those classes first when doing the weaving.
Aside, since AJC (the AspectJ compiler) is not yet integrated in the doclet parsing pipeline, you need to follow a binary weaving strategy ie:
aj.root
in the build.properties
to the folder that contains aspectjrt.jar
and aspectjtools.jar
from a recent nightly build (will work for M3, does not for M2, so use a recent one!).
Then run ant clean test
.
Check the build.xml
file to understand how the different build steps are performed.
In the IDE it will also popup pretty well. See for example the little green
@
signs in the margin in this IntelliJ screenshot.
So now we have AspectJ @Aspect straight in IntelliJ.
Off course, you'd better use Eclipse AJDT to benefit from the rich user experience that it provides when dealing with software modularity thru AOP and AspectJ.
Using Backport175 also allows to use custom annotations in the pointcuts under Java 1.3 to define stronger contract between the aspect and the application, as Adrian describes here as the Holy Trinity (when you further add dependency injection)
(the demo don't include that but I let you try it).
In a follow-up post I will also explain how the new AspectJ enhanced load time weaving ala AspectWerkz can work with Java 1.3 and 1.4 as well - since it has been a recurrent question.
[
avasseur
]
18:06, Wednesday, 22 June 2005
I thought it would be interesting to post what kind of session and BOF I am planning to attend during JavaOne 2005 next week. There are indeed interesting trends going on, and needless to say I don't really want to hear that the EJB (3) XML deployment descriptors are back or that kind of things. Instead, AOP, Annotations and distributed architectures will get my interest.
See you there !
[
avasseur
]
18:34, Tuesday, 7 June 2005
JavaOne 2005 will be a good opportunity for you to have an update on the Make sure you attend this technical session on Tuesday June 28 (TS-7659, "Runtime Aspects With JVM Support") and have a You can also visit us at the Eclipse booth where we will show latest Meet you there !
[
avasseur
]
12:14, Wednesday, 1 June 2005
As a person largely involved in the Java Open Source landscape, I have been observing radical changes during the last 5 years in this area, and the 5 years birthday of Struts makes me comment it some. Five years ago, I was starting my own Struts clone for PHP to try to bring an MVC model to the rather new PHP OO stack I was using on a customer site. This project ended up pretty much nowhere (e-php on SF) since, well..., I could luckily do something way more interesting. At that time, I also remember sales folks arguing that a Java developer had to have "fluent in Struts" in their resume to actually be a good Java Joe developer (before that you had to have "fluent in Javascript" in their mind, so we had made a big progress for the IT consultants thanks to Struts ;-) ) Most of the (good) Java Joe developers where using Apache projects from the Jakarta line mainly as their sole Open Source use in corporate projects, and Tomcat was pretty much the sole Open Source container that you could find in production. At that time JBoss started to change the game by grabbing several Open Source fames and projects on board (Tomcat, and then Hibernate to name the most famous). Next in the pie, Eclipse went bigger and bigger, and Open Source projects that were used and presented in conferences were more and more backed by someone that could afford it. AOP and IoC started to gain in popularity, and Spring was doing its first moves. It became common to see "fluent in Hibernate" in job description, and I remember the first time I actually noticed it was in february 2003. I have been pushing the AOP ball since that time as part of my BEA job, and Open Source was more and more playing with sharks. AspectWerkz was backed by BEA, AspectJ revealed to be largely backed by IBM as an Eclipse technology project, and sucessfull projects that you could hear about in conferences where almost all backed by a shark - be it a big open source community like Apache, Eclipse, ObjectWeb that can afford its own events, or by a commercial vendor like BEA, IBM or JBoss. Back in 2004 the Spring fame became a shark by its own thanks to a well shapped service model around Rod' Interface21, that obviously adressed (and still adresses) Java Joe developer needs. Last year I was wondering when I would see a "fluent in Spring" requirement in an IT job description, and it happened this morning, on the same line as "Tomcat, JBoss, Hibernate" for a "challenging J2EE architect opportunity" (interested?). I have the feeling that Open Source will not be anymore this hectic group of people working for free for the fun of it as that sound to be back in 2000. Open Source is becoming more and more a distribution channel or a big thing to take into account when thinking about return on investment. If you look closely at some open source projects, you 'll also realize that it is rather common that 80% if not more of the workload is handled by a group of people sitting on the same open space. The recent deal (backed by concrete M$) done around Geronimo (project that was already backed by Apache) is yet another evidence. Open Source is playing with sharks, so you'd better love that. And if you do want to kickstart an Open Source project, you'd better think which shark will play with you if you want your jewel idea to sustain. As a last evidence, almost every single IT service company in France finally spinned of an official department dedicated to Open Source, bridging the gap with "SSLL" models (french acronym for open source service provider, doing consulting only on OSS stacks) . I have noticed this trend those last few months (Devoteam, Atos to name a few). Open Source is not anymore the thing you use to maximize revenues, or to make sure you recruit uptodate brains. It's the thing you have to play with straight within your strategy, no matter if you are a software vendor or an IT service company. So what will be the next Open Source moves in the Java are(n)a ? (note: dates in that post are those I remember and might be approximations. Aside, the job opportunities I am talking about are all for the French market, so you may expect some delta) |