Showing posts with label aspects. Show all posts
Showing posts with label aspects. Show all posts

Friday, June 09, 2006

More Spring Things

"Design enterprise applications with the EJB 3.0 Java Persistence API" lists injecting collaborators of a service using annotations such as "@EJB(beanName = "AccountDao")" to "AccountDao accountDao;".

This compares with Spring 2.0 examples that use the Spring configuration file to inject the collaborators: "JavaEE 5, Spring 2 and AspectJ 5: dependecy injection magics". Some more information, "7.7.1. Using AspectJ to dependency inject domain objects with Spring".

The other useful article is, "Don't repeat the DAO!" which allows the creation of type safe and generic DAOs. This uses dependency injection to put the class type to return and then uses Spring's AOP to add extra behaviour (like finder methods).

Thursday, March 23, 2006

Test Drive Parameter and Member Variables

Reflective parameter names in Java 6 points to Parameter names for Java 6 (Mustang) question "My colleague Paul Hammant is asking about how we would like reflective access to parameter names to work (if it is indeed implemented) in Mustang...I wonder whether this feature, inconjunction with an AOP framework, might allow a way to introduce keyword arguments with defaults, in a similar fashion to Python and Ruby?"

The example of enhancing the IDE code completion without source is a good example too.

My view is, it's not an option it's extra metadata on classes that should always be available.