Typemock: Past, Present and Future
Eli Lopian of Typemock answers a few questions on Typemock origins and where Typemock is headed.
Tracking change and innovation in the enterprise software development community
Posted by Floyd Marinescu on Aug 09, 2006 10:01 PM
Spring has long provided a proxy-based service to apply Aspects to Spring-managed beans. However, when it comes to requirements that impact multiple points in your domain model, Spring AOP is of much less assistance, but AspectJ is a natural fit. AspectJ aspects don't need any special proxy creation, and can happily advise objects created at runtime either in your application code or by frameworks you may be using. AspectJ is also a very good solution when you want to modularise behaviour that cuts across all the different layers of your application, or that is in any way performance sensitive.Adrian Colyer, AspectJ lead and Chief Scientist at Interface21 has contributed an excellent article which shows how to use Spring 2's new AspectJ integration features followed by a roadmap for the adoption of Aspect Oriented Programming on an enterprise project, with lots of specific examples of how and where to apply Aspects.
Adoption of AOP can proceed in a number of phases: start out by taking advantage of aspects that Spring supplies out-of-the-box, and then you can add your own @AspectJ aspects using Spring AOP in the web, service, and data-access layers. AspectJ itself can be used to improve development productivity without introducing any runtime dependency on AspectJ. Going further, infrastructural requirements that cut across multiple layers of your application can be simply implemented using AspectJ aspects. Finally, you can use aspects to simplify the implementation of your domain model itself.Read Simplifying Enterprise Apps with Spring 2 and AspectJ. See also infoq.com/spring, infoq.com/aop
The Agile Business Analyst: Skills and Techniques needed for Agile
Evolutionary Design through Agile Development Podcast
Hibernate without Database Bottlenecks
JProbe Freeware – Eclipse Plugin for efficient memory analysis and diagnosis
Spring App Platform, Java Concurrency/Multicore, Eclipse Mylyn and more @ QCon SF Nov 19-21
I enjoyed reading it. Thanks Adrian.
What's "infoq.com/spring"? A topic? Why isn't it listed in the topics above?
What's "infoq.com/spring"? A topic? Why isn't it listed in the topics above?
If you look beneath the body of the article, you'll see "Tags Spring, AspectJ". You can click on those to see any all content on InfoQ about Spring or AspectJ. If you look at the top of the article you can see "topic - AOP", which functions the same. I added a link manually to the news item linking to this article so that people would notice the functionality.
Very nice article on AOP. Probably the most clean explanation of AOP terminology and principles that I've ever read. Keep on a great job, i21 & InfoQ!
When clicking on the print image right above, Firefox (1.5.0.6) is leaving some text out on the right, you cannot see the whole text. IE works fine. Could you pls check if there is something you could do about it? Thanks! Thanks for the article, it is really nice!
Hi Peter, what page/paragraph do you notice the problem? I have the same version and it seems to print fine.
Like this page. I mean http://www.infoq.com/articles/Simplifying-Enterprise-Apps. I was playing with the screen resolution and settings in Print Preview, but none of the attempts worked. Anyway, I managed to print it in IE and that is fine for now. Thanks.
Hi Adrian, Quick question: in the section about throwing, it's not clear that your afterThrowing() pointcut *replaces* the initial exception. I'm assuming that's what it does, right? It wouldn't make much sense to throw the original exception and then a DAOException, but you might want to clarify how this replacement actually works. -- Cedric
Hi Cedric,
Your interpretion is correct. If after throwing advice itself throws an exception, then the exception thrown by the advice will be seen by the client. If the after throwing advice completes normally, then the original exception will propagate to the client.
The consequence of this is that you can use after throwing for exception *translation*, or for logging or taking other additional actions, but you can't use it to *handle* an exception condition. For that you have to use around advice, with a pattern that looks like this:
Object around() : some_pc() {
try {
return proceed();
}
catch(ExceptionToBeHandled ex) {
// handle condition here
return exceptionalConditionReturnValue;
}
}
(or the equivalent in @Aspect or Spring XML styles).
Regards, Adrian.
Hi Adrian, Are you planning on releasing the sources. It would be great to show how one you easily implement the profiling strategy mapping to our Tracer API (http://www.jinspired.com/products/jxinsight/api/com/jinspired/jxinsight/trace/Tracer.html) and have it easily integrated within our management console while adding additional JMV resource metrics (cpu, thread waiting, thread blocking, gc, object allocs). We previously published a performance insight article based on our Spring 1.x trace extension. http://www.jinspired.com/products/jxinsight/springtracing.html Regards, William Louth JXInsight Product Architect JInspired "Java EE tuning, testing, tracing, and monitoring with JXInsight" http://www.jinspired.com
Hi,
Thanks for the good article. Though I have a quick question.
Just want to ask how would I be able to forward a user to an error page after using pointcut on that method. Say I have method in com.my.controllers.AnswerQuestion
processQuestion(blah, blah){
//do something
return “success”;
}
then I have this aop config
Weng Guerra, Try something like: Thats my class: public class Bar { public String foo(int x) { return "success"; } } And with this Aspect, i replace the outcome of foo(x): public aspect ReplaceAspect { pointcut yourMethodPointcut(Bar bar, int x): target(bar) && args(x) && call(public String Bar.foo(int)); String around(Bar bar, int x) : yourMethodPointcut(bar, x) { proceed(bar, x); return "errorpage"; } } -Sebastian Jancke
(Sorry, I forgot the html-pre...)
Weng Guerra,
Try something like:
public class Bar {
public String foo(int x) {
return "success";
}
}
And with this Aspect, i replace the outcome of foo(x):
public aspect ReplaceAspect {
pointcut yourMethodPointcut(Bar bar, int x):
target(bar) && args(x) &&
call(public String Bar.foo(int));
String around(Bar bar, int x) : yourMethodPointcut(bar, x) {
proceed(bar, x);
return "errorpage";
}
}
-Sebastian Jancke
Eli Lopian of Typemock answers a few questions on Typemock origins and where Typemock is headed.
Scott Ambler talks about actual data resulting from surveys made during 2006-2008, showing how Agile is perceived and implemented within organizations.
From QCon 2008, Daniel Moth presents on using Visual Studio 2008 and .NET 3.5 to create compelling rich Windows applications.
Joshua Kerievsky, founder of Industrial Logic, talks about Industrial Extreme Programming which extends XP by including practices dealing with management, customers and developers.
Amazon Web Services (AWS) Evangelist Jeff Barr discusses SimpleDB, S3, EC2, SQS, cloud computing, how different Amazon services interact, origins of AWS, AWS globalization and the March AWS outage.
Cloud services have helped bring virtualization to the forefront. Its full power however, also includes other benefits such as high availability, disaster recovery, and rapid provisioning.
John Lam talks about his path to dynamic languages, some of the problems of making IronRuby run fast, and how the DLR helps with implementing languages.
VMware Infrastructure 3: Advanced Technical Design Guide and Advanced Operations Guide provides a wealth of practical insights into setting up virtualization in todays corporate environments.
13 comments
Reply