View RSS Feed

Recent Blogs Posts

  1. Using Imports to Change Behaviour

    by , 11-30-2011 at 03:36 AM
    One thing that would be great to have is a feature that I know well from my previous experience coding in C. That is the possibility to conditional compile in order to modify the behavior of the application. A feature that is missing from Java is Cís conditional compilation, which allows you to change a switch and get different behavior without changing any other code. I think is was left out of Java is that I remember using this feature often to address issues related to compiling a program on ...
    Categories
    Tutorial , Import
  2. Using Imports to Change Behaviour

    by , 11-29-2011 at 04:24 AM
    One thing that would be great to have is a feature that I know well from my previous experience coding in C. That is the possibility to conditional compile in order to modify the behaviour of the application. A feature that is missing from Java is Cís conditional compilation, which allows you to change a switch and get different behaviour without changing any other code. I think is was left out of Java is that I remember using this feature often to address issues related to compiling a program ...
    Categories
    Classes
  3. Introducing Behaviors to Your Spring Beans

    by , 11-27-2011 at 10:55 PM
    In Spring AOP, you can use what is called an introduction (a special type of advice) that enables your objects to implement an interface dynamically, by providing the implementation class for that interface. This behavior can be multiplied to give the impression of multiple inheritance to your beans. To define an introduction, use the @DeclareParents annotation, which gives matching types a new parent.

    Java Code:
    package com.acme.springexamples.derivautos;
    import org.aspectj.lang.annotation.Aspect;
    ...
    Categories
    Bean , Spring 3