Thursday, December 13, 2007

Annotations and Spring

At the Spring Experience, in several different sessions, there is quite a bit of coverage of different uses of annotations. I may have to update my list.

One of the really interesting uses (maybe I'm just ignorant here) is to identify classes and methods to apply point cuts with AOP. This seems like the perfect use of meta-data. This one isn't necessarily a Spring thing, just cool.

The use of annotations in the MVC project have some good and bad. One good thing is the use of an annotation to identify a controller, rather than having the controller extend the AbstractController. This means the class doesn't need to depend upon Spring classes. This should help preserve backward dependability (to your app) as the framework evolves.

Another cool thing is the ability to decide which method gets called by the value of a request parameter, via annotation. This changes to a more declarative model of programming that should make code easier to develop and much easier to test (less logic, less to test).
@RequestMapping(params = "action=delete")
public void removeSite(@RequestParam("site") String site,
&nbp;&nbp;&nbp;ActionResponse response) {
.


Then there is a scary part, using annotations to map URL patterns to controllers. This means the URL patterns will get scattered around the code base (hopefully in only one or two packages). The XML configuration isn't perfect but, personally, I'd like to see URL mappings in one place.
@RequestMapping("/myAction.do")
public void handleAction....


An interesting thing of the how annotations are used in Spring is in many places they help remove dependence on Spring classes and interfaces. "Use Spring but, don't depend on it".

@PostContruct and @PreDestroy (function are obvious from the name) are pretty cool.
@Resource both powerful AND dangerous (this one is for annotation driven dependency injection). Using this could make unit test more challenging.
@Autowired is a good way to reduce XML if auot wired beans don't scare you.


A little validation for my attitude with annotations. During Rod Johnson's presentation on The State of the Art Dependency Injection, he said that he like annotations but, not annotations that take strings (even the stuff in Spring). At least if I'm crazy, I'm not alone
:-)

Update: reference to this post on DZone
.
.
.

Labels: , , , , ,

permalink
Links to this post
8 comments

Wednesday, December 12, 2007

Spring Experience 2007 Meet and Greet

Update for the first day at the Spring Experience. Made it through registration. It's amazing the number of people waiting in line for it to open. Something you can say about the Spring crowd, they are pretty enthusiastic, as well as pragmatic.

I've met quite a few people here and even though they have great enthusiasm for working with Spring, they are pretty reserved and analytical about adopting technologies. They offer the cool-aid here but, nobody drinks ;-)

It's really cool being able to meet so many smart people in one place. I managed to have a fairly long conversation with Hal Hildebrand from Oracle. He's a very smart guy, and we exchanged a lot of ideas about Spring, development, practices, and techniques for attacking both large and legacy applications. This guy knows a lot of stuff about OSGi (that's a real understatement).

After registration, I attended a (exclusive the email said) Birds of a Feather (BoF) session with Rod Johnson, the guy behind it all. It really looked like an opportunity for him to get a feel for what folks are working on and what challenges they are facing. Of course, I piped in about unifying configuration. He answered lots of questions, and is a pretty down do earth guy. It's pretty cool getting to talk to others about their issues and solutions too.

After dinner, there were the Keynote speeches, that are the standard fair for any conference. In an interesting twist, most of the Keynote didn't really mention Spring but, instead talked about a lot of the issues we (developers) face and how the market and solutions are moving. When showing charts about how technologies are progressing (growing, dying, etc), most of the metrics were based on job postings. I swear there's some espionage going on, several associates and I have been saying for a long time that the job market provides the only truly valid metric.

During dinner, one of the guys at the table was showing off his iPhone. We got to talking about the built in browser, and he navigated over to my site. A nice little ego boost came when I discovered that he as well as some other people were visitors. WooHoo, somebody other than me uses it.

He showed the camera in the phone also. Below is a pic of Brian and I from the iPhone.



After the speeches, there was a meet and greet kind of party. All of the speakers were there just hanging out. One, name removed to protect the guilty, almost let slip some announcement for tomorrow. Should have caught him later after another beer or too. Ah well, guess I'll wait; no exclusive report tonight.

Update: How could I forget to post a picture of the Rod Johnson bobble head.

Labels:

permalink
Links to this post
1 comments

Monday, December 10, 2007

Spring Experience 2007

It's that time of year again. I'm getting ready to attend the Spring Experience conference.

Last year's was completely awesome. I learned sooo much and was completely worn out. There's nothing as good as crashing completely exhausted from learning so much.

Trying to decide which sessions to attend is always the hardest part. There are so many cases where I want to attend several simultaneously.

Here's my itinerary so far:

Thursday, 13 December


Five Aspects You Don't Know About
What's New in Spring 2.5?
Task-Focused Programming with Eclipse Mylyn
The State of the Art in Dependency Injection
Rapid Fire: The Coherence Data Grid

Friday, 14 December


AspectJ for Spring Developers
Focusing Enterprise Java Development: Mylyn and Spring IDE
Scale Out Your Spring Applications in 3 Simple Steps
Spring Web Flow Hidden Gems

Saturday, 15 December


Architecture Enforcement with AspectJ and Other Tools
Rich Web Forms
Spring OSGi Update
From "Hello World" to Real World : Building Web Apps with Spring OSGi

Lots of good stuff. I'm really looking forward to the OSGi presentations. I've got a feeling that OSGi may be the wave of the future for enterprise development. I expect the Mylyn to be good to. I want to get Mylyn running at work but, first I've got to build a connector to the very old version of Bugzilla we use.

I recently upgraded a project from Spring 2.0 to 2.5 so, I'm looking forward to learning about what other things I can do with it.

I'll keep updating the blog as the events progress.

Labels: , , ,

permalink
Links to this post
0 comments