« Graham Hamilton on AOP | Main | When false==true : JVM bugs and (byte)code generation strategies »

April 24, 2006

Teaching AOP

For the past 2 months I've been working extremely hard putting together a course on AOP with AspectJ and Spring 2.0. One thing I've learnt is just how much effort goes into such a venture: each teaching module, with it's associated hands-on labs, samples, and presentation material takes between 1.5 - 2 days to prepare, and there are four modules on each day of the course. However hard I tried, I couldn't develop the material any faster than that.

Last week was the first public running of the course, in Oslo, Norway. I ran a two-day training (a nice way to verify a subset of the material - the full course is four days long). I had a really good bunch of students - most with little AOP experience but one or two who had done quite a lot with AspectJ. They all seemed to enjoy it, and everyone said they learnt lots (even those who had worked a lot with AspectJ before). I was really pleased with the learning from the students: it's my style to fire out lots of questions and get people to think and interact - they were producing correct answers to questions that I know have stumped many users on the aspectj lists, and this after only 1 day of training! The course had a lot of hands-on labs too: (a), it gives me a little respite from talking all day, but the real reason is (b) I believe that doing it for yourself really reinforces the learning. Labs are a potential nightmare for running a course, but this time everything passed off smoothly: the students had running web apps with AspectJ load-time weaving and Spring AOP all working together after no time at all. Kaare did his best to persuade me that maven 2 could make that set-up even easier. Maven 2 is definitely something I need to look into more...

As if giving 5 talks on the first day of the course wasn't enough, I also gave a talk to the Norwegian JUG in the evening. Lots of people gave up their evening to come and hear it, which was really nice to see. I thought I'd be tired after a whole days' teaching (and I was), but the atmosphere in the room lifted me and I had a really good time. There's a great crowd over in Oslo and if you get a chance to go to one of their JUG meetings you should take it.

This week I'll be giving a keynote at the SoftDev 2.0 conference in Stockholm, and then I'm speaking at the JAX conference shortly after that, so maybe I'll get to meet some of you at one of those two events.

If you like the sound of the AOP course, the next offering is in London on the 31st May. Contact me for details if you are interested.

Posted by adrian at April 24, 2006 06:30 PM [permalink]

Comments

Adrian, many years ago I used to teach C++. My rule of thumb was 8 hours preparation for every hour presenting. So, don't be disheartened, its normal.

Also,in the early days of C++ (1988) the people learning it were normally very bright, as early adopters often are. 2 years later, I was teaching C++ to COBOL programmers :-(

Posted by: Jonathan O'Connor [TypeKey Profile Page] at April 24, 2006 08:13 PM

Hello Adrian,

I had the great pleasure of attending your first test run of the course in Oslo, and now I'm a full time AOP devotee. :-)

I have a few questions on the Spring AOP implementation and on Spring AOP performance which I'm not quite sure where to direct. I'll try my luck here, and then maybe you could point me to a better forum if it's inappropriate.

My first question is in regard to the Spring proxying model for implementing AOP. This model leads to advice only being executed for external calls to methods (through the proxy), but not internal calls between methods in the domain object itself.

For example the getAllItems() method might be adviced with caching, and then you have the countItems() that calls getAllItems() in the background. The cache advice for getAllItems() will run when this method is called directly, but not when its called indirectly by countItems().

So, the queston is: Is there any way to get around this using the Spring AOP approach? Is there for example any chance of having a CGLIB-type AOP implementation based on subclassing instead of proxying in the future, so that all method calls will be adviced correctly?

My second question is in regards to performance when creating adviced objects. As I'm using Spring AOP for my Domain Objects, which are not singletons, that actual proxying takes a very long time. (It seems to be repeated every time a new instance is created.) Can we expect the generated classes to ba cached anytime soon? All I need is a new class instance every time I create a new domain object, I do not need to have the actual proxy built anew.

Posted by: Bjørn Wang [TypeKey Profile Page] at June 23, 2006 02:36 PM

Hello Adrian,

I had the great pleasure of attending your first test run of the course in Oslo, and now I'm a full time AOP devotee. :-)

I have a few questions on the Spring AOP implementation and on Spring AOP performance which I'm not quite sure where to direct. I'll try my luck here, and then maybe you could point me to a better forum if it's inappropriate.

My first question is in regard to the Spring proxying model for implementing AOP. This model leads to advice only being executed for external calls to methods (through the proxy), but not internal calls between methods in the domain object itself.

For example the getAllItems() method might be adviced with caching, and then you have the countItems() that calls getAllItems() in the background. The cache advice for getAllItems() will run when this method is called directly, but not when its called indirectly by countItems().

So, the queston is: Is there any way to get around this using the Spring AOP approach? Is there for example any chance of having a CGLIB-type AOP implementation based on subclassing instead of proxying in the future, so that all method calls will be adviced correctly?

My second question is in regards to performance when creating adviced objects. As I'm using Spring AOP for my Domain Objects, which are not singletons, that actual proxying takes a very long time. (It seems to be repeated every time a new instance is created.) Can we expect the generated classes to ba cached anytime soon? All I need is a new class instance every time I create a new domain object, I do not need to have the actual proxy built anew.

Posted by: Bjørn Wang [TypeKey Profile Page] at June 23, 2006 02:36 PM

Hi,

Can you please provide your blog link for the other course on AOP.

Thanks anyways... nice blog

Posted by: iqtf [TypeKey Profile Page] at September 10, 2009 12:31 AM

Post a comment

Thanks for signing in, . Now you can comment. (sign out)

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)


Remember me?