Today I was writing an AspectJ aspect for a Scala trait and was wondering why my constructor pointcut definition didn’t work. Having a closer look at the Scala byte code together with my colleague Johan solved the puzzle. Here is what I did (using AspectJ 1.6.8 and Scala 2.8.Beta1): To start with here’s a simplified [...]
Intercepting Scala trait constructors
April 28th, 2010 by Michael Kober — Java
Architectural Enforcement with Aid of AspectJ
March 28th, 2010 by Mattias Severson — Architecture, Java
After working some time within the software industry, you get a feeling for good software architecture. Or, to be more honest, you get a creeping feeling when the architecture is really bad. That is when the code is tangled like a Gordian knot. After some futile refactoring attempts, you consult the software architect at your [...]
Spring and load-time weaving of Neo4j-based domain objects
May 26th, 2009 by Mattias Ask — Architecture, Java
What do you do when your Spring configuration isn’t in charge of creating your objects that needs to be injected with stuff? This became a real problem for me when I tried doing some non-anemic domain object implementations persisted as Neo4j Nodes. I was playing around with creating a Twitter clone, in my opinion the [...]
Tags: aop, ddd, frameworks, neo4j, programming, spring
Transparent bind of JavaFX and POJOs
May 12th, 2009 by Magnus Robertsson — Java, Tips & Tricks
When I started coding JavaFX I quickly found that the great bind mechanism doesn’t work together very well with my legacy Java code. In fact, it doesn’t work at all. In my case I wanted to reuse my domain objects and just add a fancy user interface on top of it. This happen to be [...]
Tags: aop, javafx, programming, scripting, tools
Proxy Based AOP for Cocoa Touch
March 6th, 2009 by Fredrik Olsson — Embedded, Tips & Tricks
UITabBarController is generally used as is, no subclassing required. It creates a UITabBar and manages a list of UIViewControllers, keeping track of the tab in focus, UI creation and everything nice. UITabBarController has a delegate, the UITabBarControllerDelegate protocol. Unfortunately this is not a superset of the UITabBarDelegate protocol, and UITabBarController already implements the UITabBarDelegate protocol [...]
Tags: aop, frameworks, iphone, objective-c, programming, proxy, reflection
Aspect Oriented Programming In Java ME
February 1st, 2008 by Magnus Robertsson — Embedded, Java
Do you want to structure your Java ME applications better? Aspect Oriented Programming is a cool technology that can modularize your applications and separate the verbose infrastructure code from the application logic. The only catch is that it doesn’t exist for Java ME. Or does it? Introduction Aspect Oriented Programming (AOP) is gaining popularity within [...]
Tags: aop, innovation, java me, jayview, open source, programming
Static Mock using AspectJ
February 16th, 2007 by Jan Kronquist — Testing
After seeing MockME developed by some of my colleagues I started thinking about how this could be made in a generic way.
Tags: aop, aspectj, easymock, mock
Indented Tracing Using AspectJ
December 15th, 2006 by Ulrik Sandberg — Java, Tips & Tricks
Given inspiration from the book “AspectJ In Action”, I wrote a little aspect that provides indented tracing of method executions. This means that the aspect keeps track of the current indentation level in a call flow
Tags: aop, aspectj, programming, tracing
Ytterligare en Aspekt på din kod
January 20th, 2004 by Björn Granvik — Java
Har du någonsin kopierat vissa snuttar kod – om, om och om igen? Trots att du redan har en snygg objektorienterad arkitektur? Trots att den är full med de bästa design-mönster som går att uppbringa? Trots att du valt de bästa verktygen och ramverken? Lika förbaskat så sitter vissa rader, som loggning, både i ryggraden [...]
