News: Create Enterprise Applications Using the Spring Framework

  1. Through this book java developers will learn how Aspect-Oriented Programming can support Object-Oriented Programming to solve problems in the implementation phase. Users will learn to master the concepts of AOP by developing several real-life AOP-based applications with the Spring Framework, and implementing the basic components of Spring AOP: Advice, Joinpoint, Pointcut, and Advisor. By implementing an interface that manages invocations, developers will learn to set up a dynamic proxy with JDK. Along with this, they will be able to structure the behavior of the pattern proxy design pattern by applying the crosscutting concerns of security, logging, and transactionality to specific Joinpoints. They will also be able to remove the implementation compromises in applications by learning about the AOP that is enabled by the Spring Framework and Inversion of Control (IoC). Java software architects, engineers, or developers wanting to write applications using Spring will find this book useful. For more information, please visit http://www.packtpub.com/aspect-oriented-programming-with-spring-2-5/book
  2. First, I haven't read that book yet. But I think Spring AOP alone cannot build a whole application. So this is only a supplementary book. These are the uses of Spring AOP that I can think of (please add some more):
    • Logging and profiling: write a log message at the beginning/end of a method; measure how much time a method takes
    • database transaction: which is replaced with @Transactional
    • caching: a cache is searched for needed information before we enter a time-consuming logic
    "Includes Domain-Driven Design and Test-Driven Development of an example online shop using AOP in a three-tier Spring application": (again, I haven't read this book) if Spring AOP is used to mock some method in a TDD, then it's a wrong way to do TDD in Spring, IMHO. I'd rather use a mock object in the applicationContext.xml for a TDD. Finally, I'm still eager to read what is written in that book :)
  3. AOP in general[ Go to top ]

    I know AspectJ modifies your class file. What about AOP provided by Spring ? Also, will it not make hard to debug if your class file is modified ? (in case of exception or something when application is deployed ?) What about performance (reflection at run time is not a good thing, isn't it) ? void foo(){ doSomeFooThings(); } interceptBeforeFoo(){ log(entering foo); foo(); log(exit foo); } will the above code perform better than below ? void foo(){ log(entering foo); doSomeFooThings(); log(exit foo); }
  4. You can debug both aspectj and spring aop. Spring AOP is proxy based so there is no change in the byte code whereas AspectJ changes the underlying byte code. In the case of using AOP for tracing/profiling your code you should think about making the AOP JMX enabled so you can switch it off/on at runtime. This can be done easily with Spring. There are numerous tools (pointcut doctor, AJDT) that can help in developing Aspects (AUnit for testing aspects in isolation).
  5. The second edition of AspectJ in Action is something to look out for too. It covers both Spring AOP, AspectJ (traditional and annotation driven).