If Mutt is your favorite email client and you ever wondered how to integrate email address from LDAP, this post shows you how to do this.
Integrating LDAP into Mutt
December 16th, 2007 — Tech
Singletons with AspectJ
August 16th, 2007 — Tech
I stumbled upon this post (german) that shows how to implement the singleton pattern with AspectJ. Although you may want to use dependency injection with Spring or Guice, there might be (hopefully rare) occasions on which you opt for this solution. In this post we’ll check out how to do this with AspectJ 5.
The Eclipse project with the sample code for this post can be downloaded as tar.gz or zip; make sure to install the AspectJ Development Tools. You can browse the code online here.
Profiling with AspectJ
August 9th, 2007 — Tech
Lately, I read a paper about profiling with AspectJ: it investigates how to profile heap usage, object lifetime, wasted time and time spent. I was wondering how difficult it would be to write my own simple profiler; and as we’ll see it’s easy and fun.
If you’d like to check out the sample code that accompanies this post, you can download the Eclipse project as tar.gz or zip; make sure to install the AspectJ Development Tools. You can browse the code online here.
Logging with AspectJ
August 3rd, 2007 — Tech
Again, I would like to endorse the usage of aspect oriented programming because it may ease development significantly. That’s almost always the case with crosscutting concerns like logging and in this post we’ll develop a solution with AspectJ. So, adding logging to your application is as easy as this:
- implement this
AbstractLoggingAspectand define the methods you’d like to monitor - declare advice
before,afteroraroundthe logging pointcut andprintlnyour logging tostdout.
Once you’re finished with this you’ve got logging in your application without touching the original code. We’ll have a look at the details in the next sections.
If you’d like to check out the code that accompanies this post you can download the Eclipse project as tar.gz or zip; make sure to install the AspectJ Development Tools. You can browse the code online here.