Feb
08
2007
7

Securing Spring WebFlow flows in under 500 lines of code

A client of ours I visited a couple of weeks ago had successfully prototyped Spring WebFlow security. The solution was pretty elegant, although when looking at it from a configuration perspective, it wasn’t entirely perfect. I offered to take over the code and help out with refactoring it so it could be integrated into their code much in the same way as Acegi Security method interceptors work.
ict_accessdenied.jpg
This morning I finally got to doing so and I ended up with a solution that is not even 500 lines of code long (including extensive JavaDoc) and integrates perfectly with existing facilities offered by Acegi. I am going to integrate the solution with the client this afternoon (if the snow doesn’t prevent me from getting to their office; it’s snowing *right now* and if in Holland there’s a tiny bit of snow, all traffic comes to a grinding halt). The following is a configuration snippet that allows you to secure a flow based on states, event and the flow identifier itself. Other than that, it has the same configuration properties as the MethodSecurityInterceptor (it’s in the same class hierarchy).



admin-flow=SUPER_USER
order-flow=SUPER_USER,CUSTOMER
order-flow.state.enterShippingDetails=SUPER_USER,CUSTOMER
order-flow.event.cancel=SUPER_USER

This pretty much proves the extensibility of Acegi Security again. This is the third time already I’ve integrated a new system with Acegi Security to provide security at yet another level (two other times I integrated it with other clients’ internal security systems). All three times, it didn’t take me more than 500 lines of code if I remember correctly.

In some form or another, this feature will be available in Spring WebFlow as soon as we can get it in. Keep monitoring SWF-93 if you’re interested.

Written by Alef in: Java-related, Spring, Technology |
Dec
13
2006
0

Technology / nice folks / good food and too much beer: JavaPolis 2006

I got up early this morning to check my mail (wasn’t able to yesterday due to the all the busy-ness) in the hotel. Fortunately I have quite an okay hotel with working internet and towel that actually allow me to dry myself after getting a shower (okay Jon, I’ll quit whining about your choice of hotel right now and won’t ever mention it again ;-) ). I hope I’m not being too much of my usual Dutch cynical self here, but hey, you been living in Holland right, so should know that Dutch are like that :) .

Arghhh, shite! It’s as if somebody eveil is watching me type this! I just about finished that last sentence and then the internet dropped out (that’s no joke :) ). Anyway, I can keep on typing and post the entry later on anyway.

images.jpg

Yesterday was my first day of JavaPolis this year. In short, it was good! I had prepared a 3 hour talk for the university sessions that went quite well. I focused on three major areas in which we’ve improved Spring. Ease of configuration, simplifications in the web area and the decreasing the code-test cycle. It was great fun presenting together with Arjen (I hadn’t actually seen him for a while, we had both been on the road for quite some time), although I hope he though my jokes I put in the slides weren’t too cheesy.

Anyway, the good thing about JavaPolis is not just the sessions (the conference part of JavaPolis hasn’t even started yet). It’s also about meeting nice folks. Yesterday night we had dinner with a group of people at a Mexican restaurant near the conference center and I met Jan Newmarch from down under (presenting on Jini here) and several other nice folks I hadn’t met yet.

Jon (I mention him and his choice of… oh no, I promised I wouldn’t mention that anymore) and I also discussed the (still widespread) use of technologies such as EJB2. Jon thought it was amazing that these people aren’t yet using Spring. He perfectly summarizes my thoughts on that at his blog. For me one of the reasons for this is that for those companies it’s too costly (seemingly maybe) to migrate away from those technology because of the initial investment they’ve put in it. Because that initial investment has gone into code which isn’t (entirely) portable across different versions of application servers and more importantly, doesn’t allow for an easy migration path because of inter-twined concerns (more on that later) in their core code. In other words (as Jon puts it) they’ve mixed concerns related to the environment (the infrastructure, whatever you name it) with the actual business logic. Because of this, migration from environment version A to environment version B is quite costly.

at-bean.png

This was also a major theme when Arjen and I were discussing the JavaConfig stuff during our session yesterday. Sorry for spoiling the fun Rod (I guess he wanted to talk about this during the conference later this week as well). To me separation of concerns is one of the most important concepts in software engineering that keep your maintenance costs down. With the JavaConfig stuff, we’re hoping to improve on this even further. Using specially designed and coded configuration class, that’s completely separate from your actual business logic (just as your XML files have been since Spring 1.0), we are (well, actually you will be) addressing the two different concerns in question here (configuration and business logic) in two different artifacts. If something needs to change to the configuration you don’t have to mess up your business logic. If your business logic changes slightly, you don’t have to change your configuration. So go on and check this JavaConfig stuff out (I would be writing more about it soon, if it weren’t for the fact that I have a holiday coming up and am still terribly busy with all kinds of other stuff).

In our session, we covered lots of things, but we basically stuck to the basics (Spring DI using XML and Java, Spring AOP, Spring MVC a bit, Groovy integration and bit of integration testing) but apart from that there’s sooo much more cool stuff in the Spring portfolio (I’m almost sounding like I’ve got something to sell here; but I just have this renewed feeling of excitement about what we have to offer :) ). Spring WebFlow for example is something I expect to be really big in 2007. It’s only been released for short period but already I’m seeing some major corporation here in Holland pick up on themselves. Some of those are of the less progressive kind and would’ve other stuck to Struts if it weren’t for the benefits they already got from Spring. There are some major banks and insurance companies thinking about putting WebFlow to use in their internal and public facing apps. Anyway, I’m digressing…

Back to the talk. I’m attaching the slides [i] I used yesterday as well as the sample application [ii]. I was about to upload the slides I used during the talk yesterday, but somehow can’t create a PDF document of them using PDFCreator so I’ll have to do that some other time maybe. I did upload the sample app already. It is quite small and really should be seen in combination with the talk, but it kind of shows some nice concepts (such as my first tiny attempt to use the JavaConfig stuff in anger–I have to say, it really worked well).

Oh and by the way, did you know Interface21 is hiring in the Netherlands? If you think you can add value to our team and have a decent share of experience with Spring and (modern and classic) J2EE technology and still don’t think you know enough, than you might want to send me your resume. My email is the usual, first name at company name dot com.

[i] the slides I used during my talk yesterday
[ii] the sample application

Written by Alef in: Java-related, Spring, Technology |
Dec
11
2006
0

Scored a goal, injured my arm and finished my slides: JavaPolis here we come!!

I’ll be giving a lecture on Spring next Tuesday. I just finished my slides and they’re pretty okay, if I may say so myself. I’ve packed them full with Spring 2.0 material, so if you’re into Spring development and would like to get the latest on Spring 2.0, don’t miss this one! We also have a booth at which I’ll be hanging out during the week (I’ll be there until Thursday evening I think), so if you’re there, don’t hesitate to drop by!

Other than that I was supposed to play poker tonight with some friends, but unfortunate I was late with my slides, so had to work instead of trying to earn as much money off the backs of my friends as possible ;-) .

Anyway, I did also have some time for fun today. This afternoon we had our 10th soccer match of the season or so. We just started this team and I never played in a competition before. I’m the goalkeeper and I’m kind of okay (at least, that’s what the opponents are always saying). The number don’t however, because we haven’t won a single match yet and all teams together have scored about 100 goals against us already :) . We’re still having fun ;-) .

Anyway, today was another match and the first half went kind of okay. It was 2-1 after the first 45 minutes. In the first half however, in a scrimmage with an opponent, I injured my wrist (my typing speed has reduced to about 30% of what it was, so it’s still okay, for those who know me ;-) ). I got the ball, but the opponent thought it was necessary to continue and try to kick the ball of my hands (no, I’m just kidding, he couldn’t really help it).

So the second half, I was out in the field, instead of in the goal. That was the first time ever I was in the field and they wanted me to be a striker. Striking, that’s what I did, I scored a goal after 5 minutes or so :-) . It felt sooo good, I don’t think I’ll ever get back to being a goalie again…

My hand still hurts a lot though and that’s bad, not because of my reduced typing speed (I’m making less mistakes now), but also because I’m heading off to Cost Rica in a little over three weeks) for two weeks of surfing, so I hope it’ll heal fast, as I need to paddle a lot out there…

Okay, for those of you that’ll be dropping by in Antwerp, see you there. We’ll probably have drinks on both Tuesday and Wednesday in the city, if you want to join, drop me a line.

Written by Alef in: Java-related, Leisure, Spring |
Nov
02
2006
17

after() throwing(Exception e) : serviceMethod() { mail(e); }

Okay, good you made it past the title. I was at a client that has been a long-time Spring user. Some of the client’s stuff needs a revision and as part of this revision Spring 2.0 AOP was introduced in some places. Today, for the group of developers I shortly touch on some of the basic differences between AOP in Spring 1.x and AOP in Spring 2.0. I figured it would be good to post the examples online.

Let’s first set the stage for the example (and please read this carefully): an exception thrown from a service method should be emailed to an administrator.

Here’s an example of a service method:


package com.mycompany.myapp.service;

public interface DrinkingService {

void doIt();
}

with a corresponding implementation:


package com.mycompany.myapp.service;

public class DrinkingServiceImpl implements DrinkingService {

public void doIt() {
throw new IllegalStateException("I have a hangover so please don't bother me!");
}
}

As you can see, it’s in an illegal state at the moment (probably because the service drank a bit too much Limoncello or something). Normally service wouldn’t do this, but this time of the year (when leaves start falling and days are shortening), I can definitely imagine services grab the bottle.

Anyway, let’s continue. The requirement was to notify an administrator (by email) about any exception occurring inside a service. DrinkingServiceImpl is just one example of a service and because there probably are more services in our application, we’re going to use AOP to implement this specific requirements. Think about the 1:1 principle, separation of concerns (SoC), Don’t Repeat Yourself (DRY) and all that crap…

There are several ways of solving this. Let’s examine them one by one.

Emailing the exception using Spring 1.x

Suppose you’re stuck at Spring 1.2. Then the way to go is using a ProxyFactoryBean. Using this Spring class, you can configure interceptors in order to advise certain methods.



This piece of Spring configuration configures a ProxyFactoryBean and one interceptor, which in this case is a bean called exceptionAdvice. Configuring something like this, obtaining the service bean and calling a method on the service bean, will actually cause the interceptor to ‘run’.

The interceptor (the EmailOnExceptionAdvice) is actually an instance of ThrowsAdvice, which means it only gets called when an exception occurs inside a method call on the drinkingServiceTarget. There’s only one method, which in this case takes an Exception.


public class EmailOnExceptionAdvice implements ThrowsAdvice {

public void afterThrowing(Exception e) {
System.out.println("Email the exception!");
// TODO email the exception to an administrator
}
}

So, one more time:

  1. The ProxyFactoryBean creates a proxy wrapping the target object (in this case a DrinkingServiceImpl)
  2. The ProxyFactoryBean also configures an interceptor that acts on any exception occurring inside the service
  3. The interceptor (advice) receives notice of exceptions occurring and emails them to an administrator

As you can see (run the example if you want more insight), the requirement (exceptions thrown from a service method should be emailed to an administrator) has successfully been implemented!

Note that there’s absolutely no reason to keep yourself from upgrading to Spring 2.0. The new Spring version of in 95% of the cases fully backward-compatible with the 1.x-line and spring-2.0.jar should in most cases be a drop-in replacement for the spring-1.2.7.jar for example.

Emailing the exception using Spring 2.0 and the old advice

You might be wondering why we’ve created Spring 2.0 and enhanced the AOP capabilities so much if things are that easy using Spring 1.x. Well, there actually are a lot of reasons, some of which will probably get clear after I’ve introduced the new approach. Let’s first revisit our initial requirement:

an exception thrown from a service method should be emailed to an administrator.

Although this requirement has been implemented correctly, the way we did it might sound kind of low-level. We used proxy factories, interceptors, advice, target objects and much more, all to email an exception to an administrator. Using Spring 2.0, we’ll see that all these infrastructural components more or less disappear, allowing us to make the code look more like the design while still successfully implementing the requirement.

To not take too big a step, in the new version, we’ll reuse our old advice and we’ll just change the configuration a bit. We’ll start off by defining a pointcut:



What this pointcuts says is the following: a serviceMethod is the execution of any method in service package of my application. That’s what I call ‘make the code look like the design’. The next thing we’ll do is attach the previously created advice to our pointcut and we’re done (this is what we’re doing using an aop:advisor element. The final configuration looks like this (in other words, no more ProxyFactoryBeans).

<code>
<aop:config>
    <aop:pointcut id="serviceMethod" expression="execution(* com.mycompany.myapp.service..*.*(..))" />
    <aop:advisor pointcut-ref="serviceMethod" advice-ref="exceptionAdvice" />
</aop:config>
 
<bean id="exceptionAdvice" class="com.mycompany.myapp.util.EmailOnExceptionAdvice" />
 
<bean id="service" class="com.mycompany.myapp.service.DrinkingServiceImpl" />
</code>

And now for a completely Spring-less approach

In the previous two solutions, we used special Spring classes to implement our advice. There is a third approach not requiring you to implement any Spring-specific interfaces. This is what we called the ‘POJO advice’ approach. Using the POJO advice approach, you can use any existing class that doesn’t have to have any references to Spring whatsoever to serve as an advice. Okay, let’s change the exception advice to a POJO advice first:

<code>
public class ExceptionEmailer {
  
    public void emailException(Exception exception) {
        System.out.println("In Emailer");
        // TODO implement emailing functionality
    }
}
</code>

This should be straightforward to understand. Upon the catching of an exception the emailException method should be called. Again, we’re going to try to make the code look as much like the design as possible. Here’s how we can do this using Spring AOP in version 2.0:

<code>
<aop:config>
    <aop:pointcut id="serviceMethod" expression="execution(* com.mycompany.myapp.service.*.*(..))" />
    <aop:aspect ref="exceptionEmailer">
        <aop:after-throwing throwing="exception" 
            pointcut-ref="serviceMethod" method="emailException"/>
    </aop:aspect>
</aop:config>
</code>

Let’s have a look at how the aspect reads: after-throwing an exception from any serviceMethod, call the emailException method on the exceptionEmailer. Pretty straightforward if I may say so myself. I can remember Gregor Hohpe telling me once that he tried to code in such as way that he could show his code to non-technical managers. Well, IMO this certainly is a way of doing this!

Other ways of doing this

There are still plenty of other ways of making sure an email is sent after an exception has been raised. One of the ways of using AspectJ, which will result in code resembling the title of this post. Maybe I’ll write about the other approaches some other day. First, I’ll have to write a follow-up to my example about how to use AOP to intercept web requests.

p.s. Here are the sample sources. Just as with the previous post, remember that you should include spring-2.0.jar and aspectjweaver.jar, otherwise things won’t work. I still haven’t found the time to get Maven2 done for these sample projects.

Written by Alef in: Java-related, Spring, Technology |
Oct
31
2006
14

Using Spring 2.0 AOP to implement web-request interception

I was teaching another class yesterday and the focus was mostly on the web-tier. This is where we usually spend a lot of time on Spring Web MVC and Spring Web Flow and if the class is interested we also do a bit of Acegi Security (although in this half hour we’re only scratching the surface of it).

One of the subjects in the web module is using HandlerInterceptors to transparently add behavior to web requests. HandlerInterceptors are nice little components that allow you to for example do simple authentication, populate the Log4J Nested Diagnostics Context is populate the model returned by a controller with information each and every view needs (such as user information or information about the current state of the system).

When we touch on HandlerInterceptors, most of the time the audience pretty much sees the resemblance with Servlet Filters immediately. The resemblance is certainly there. There are pretty good reasons why we initially choose for a special purpose interception mechanism (Servlet Filters and EJB 2.x & 1.x transaction and security management are also good examples of special purpose interception mechanisms).

One of the guys in class asked me if it was possible to implement Spring’s HandlerInterceptor mechanism using Spring’s new AOP functionality. Interesting question! Yes in fact it’s possible and that’s what I’ll be reviewing in this post.

The traditional approach (using HandlerInterceptors)

Let’s first review a short example of how we use HandlerInterceptors to transparently do something completely orthogonal to any request in the system.


/**
* Simple handler interceptor that outputs some logging right
* before the request is executed.
*
* @author Alef Arendsen
*/
public class OldSchoolRequestMonitor implements HandlerInterceptor {

public void afterCompletion(HttpServletRequest req,
HttpServletResponse res, Object handler, Exception ex)
throws Exception {
}

public void postHandle(HttpServletRequest request,
HttpServletResponse response, Object handler, ModelAndView mav)
throws Exception {
}

/**
* Here we're just implementing the preHandle method
* to output a bit of logging data *before* the request
* is handled.
*/
public boolean preHandle(HttpServletRequest request,
HttpServletResponse arg1, Object response) throws Exception {
System.out.println("Request came in (using a HandlerInterceptor now)");
return true;
}
}

This interceptor is actually pretty straightforward. Plugging it in to let it intercept requests is arguably even simpler. After we’ve created our web application infrastructure (web.xml and ***-servlet.xml file), we’re ready to put it to work:



In short, the process after we’ve added the above code to our ***-servlet.xml file is as follows:

  1. A request (/helloWorld.html for example) comes in, the DispatcherServlet picks it up
  2. Using a handler mapping, the DispatcherServlet determines the execution chain of this request (what handlers or controller are there to handle this request, are there any interceptors, et cetera)
  3. It finds there is an interceptor (the one configured alongside the HandlerMapping) and a controller (the HelloWorldController) that both match
  4. The DispatcherServlet starts to execute both in turn and that’s how the HandlerInterceptor is allowed to intercept requests

Additional features the HandlerInterceptor class has are the following:

  • - it allows modification of the request processing chain by returning true or false from the preHandle() method. If you return false, the execution will halt
  • - it allows you to modify the ModelAndView instance returned by controllers in the postHandle() method, which is pretty neat because you can do all kinds of fancy stuff there
  • - it allows you to inspect exceptions thrown from the handleRequest() method implemented by Controllers

Using simple (Spring 2.0) plain object advice

So now for the Spring 2.0 approach with plain objects and AOP. Instead of implementing the HandlerInterceptor interface, we’re going to reuse a simple object that doesn’t have any specific Spring interfaces:


public class RequestMonitor {

public void logRequest() {
System.out.println("Request came in (using a simple Spring AOP 2.0 advice now)");
}

}

So the requirement here basically is that we want to log every web request. Let’s express that using the usual (AOP) suspects. First, our pointcut:


expression="execution(* org.springframework.web.servlet.mvc.Controller+.handleRequest(..))"/>

Review this pointcut carefully and think what it actually means. How we usually explain things to people is to read the aspect as follows: a web request (notice the name of the pointcut) is the execution of the handleRequest method on any Controller.

Now we need to configure a piece of advice. Since the advice itself is a simple object, the only thing we need to do is configuring it in Spring:



Linking the advice object and the pointcut is a bit more completed, but actually not that difficult either. We want to log incoming requests before the are handled (as stated earlier in the post). So we will be using before advice. We want to call the logRequest() method as seen in the RequestMonitor class defined above. And we want to do that if the webRequest pointcut matches (in other words, for every web request):





The entire AOP configuration needs to be wrapped inside an element, but that’s just details for now. The result of the two different ways of implemented the interceptor is exactly the same, so in other words, yes, implement web-level interceptor using AOP is perfectly possible.

Somewhat more advanced advice

Of course I hear everybody saying right now: “so what about access to the request, the response, the model, et cetera)!”. Well, that’s something I won’t be able to cover in this entry, as I’m almost out of time. I’ll post a more advanced sample later this week or next week.

Conclusion

So yes, it’s possible to get basic HandlerInterceptor behavior in place with Spring AOP as well. The question of course still remains if all of the things we can do with a HandlerInterceptor are also possible using Spring AOP. We’ll see that in my next entry. We’ll also touch on the subject of whether or not this is a good thing to do.

[i] requestmonitor-1.0.zip – the sample application showing both ways of monitoring web requests (note that for the sample to work, you need to put the Spring 2 jar in the lib directory as well as the AspectJ Weaver jar. I’ve left those out, otherwise the file size would grow too big.

Written by Alef in: Java-related, Spring |
Oct
05
2006
0

Adrian Colyer to speak at NL-JUG / Spring 2.0 released

A small combined post about a couple of interesting events.

The first is already behind us. Last Tuesday we released Spring 2.0 and thanks to all the hard work of Juergen, Rob, Rick and many others, we have seen a lot of enthusiasm around this release already. Rod mentioned on his blog a couple of hours ago the release was downloaded more than 10.000 times already! This is pretty amazing!

spring20.png

Next Wednesday, the bi-annual NL-JUG conference will be held again. At this event, Adrian Colyer will deliver a keynote about the vocabulary of enterprise applications. He’ll probably touch on Spring 2.0 too, so if you’re interested please drop by! He’s going to talk about AspectJ too by the way. There are several other I21 people present at the conference too, so it should be fun!

On to the next big event: the release of Spring Web Flow. Keith noted at TheServerSide that 1.0 version of Spring Web Flow will most likely be released somewhere in the next two weeks as well. So October is proving to be a pretty interesting month.

Written by Alef in: Java-related, Spring, Technology |
Sep
13
2006
1

Miscellaneous questions about Java / Spring & AspectJ

I’m in Paris at the moment, delivering a training session for a group of people here about the Spring Framework. During such a training students ask a lot of questions. Usually I just answer them but sometimes I have to put them aside to answer them later on.

This time, I thought, why not blog about those questions. So without further ado, here are a couple of questions I got during the Spring training last couple of days:

Eiffel Tower from Seine

Can you have multiple BeanFactoryPostProcessors in one context and if so, what about ordering?

As part of our training we always cover ways of extending Spring using for example BeanFactoryPostProcessors. We didn’t discuss the ordering mechanism in general yet, and one of the guys asked about ordering BeanFactoryPostProcessors.

The obvious order the post processors execute would of course be the order in which they’re defined in the XML file, one of the others said. Unfortunately, you can’t rely on the order of the beans defined in a Spring XML file. The order in which they’re defined is not guaranteed to be the order in which they’re executed.

The real solution is in fact quite simple. Spring features an interface called Ordered (it lives in the package org.springframework.core). All of Spring’s BeanFactoryPostProcessors (such as the PropertyPlaceholderConfigurer, that externalizes property values into externally manages resources) implement this interface, implicitly giving it a setOrder property. By setting the order property for each of the post processors, Spring will sort them before they executed ensuring the correct order.

Consider the following example:



The setting of the order property will ensure that the PropertyPlaceholderConfigurer will be given a chance to modify the bean factory before the custom MyOtherPostProcessor, which has been assigned with order value 2.

In Spring 2.0, can you specify multiple return types in a pointcut expression?

In Spring 2.0, we’ve introduced a tighter integration between Spring AOP and AspectJ. One of the most visible enhancements that came out of this is the ability to use the AspectJ pointcut expression language inside Spring AOP. This doesn’t mean Spring AOP has changed much internally; the way you’re configuring it however is changing a bit (although the Spring 1.x way of configuring aspects is still available).

A small sidestep. Historically, within Interface21, Rod Johnson is known for writing awfully long (but really clear class names). Adrian however is also capable of writing really long names; he however does it for methods:

The PointcutParser class features a method called getPointcutParserSupportingSpecifiedPrimitivesAndUsingContextClassloaderForResolution().

So, as Erik told me, In case you want to get pointcut parser supporting specified primitives and using context classloader for resolution, please use that method :-)

Okay, joking aside, the AspectJ pointcut parser makes Spring AOP a lot more usable. During the training in Paris this week, we spend a decent amount of time on all of this, since the guys here are probably going to make heavy use of AOP. The people really appreciated the fact that even before Spring 2.0 is out, we have a really solid set of 2.0 training material for them.

With the pointcut expression language, it’s possible to select methods returning all kinds of types. So the expression execution(String com.interface21..MessageService+.*(..)) selects methods on the MessageSerivce class returning a String. One of the questions that came up was, if it was possible using the AspectJ pointcut expression language to select methods that return void or a String (for example). And fortunately, this is possible:


execution(String || void com.interface21..MessageService+.*(..))

Arc de Triomphe
selects all methods on the MessageService class (and derived classes) that accept any number of arguments and return either String or void.

And another question bites the dust :-) .

Can you have more than one aop:config tag in one context file?

Short and simple answer: yes you can! I’m not sure though why you would want such a thing. The aop:config tag nicely groups all AOP related functionality together in your context file.

The import tag, does it use Spring Resources?

With Spring, there are several ways of assembling ApplicationContexts. One of those is using the import tag, defined in the beans schema. This import tag has one attribute, called resource. And as the name suggest, yes, the resource attribute indeed uses Spring’s Resource abstraction underneath.

So you can import XML files into other XML files using the following notation:




Okay, that’s it for now. Tomorrow is the last day of the training, so there might be even more questions after tomorrow. We’ve got Spring MVC and Spring WebFlow left on the menu. Usually we do the web-related functionality on day 3 of the 4-day Core Spring training, but for one time, I’ve switched the fourth day with the third, to accommodate for a manager who also wanted to join in for the AOP material.

Written by Alef in: Java-related, Spring, Technology |
May
21
2006
0

SpringOne? Yes, we have a bag as well, but

Although our conference bag will probably not be the coolest ever, we will definitely have a great time at SpringOne in about 3 weeks. There’s lots of cool stuff to cover in sessions that will be led by some people that have all gained great respect in their area of expertise and frankly speaking, that’s more important to me than all the goodies (although a t-shirt or long-sleeve with a Spring logo on it is always nice, I’ve already had great success in bars and pubs with it, ahum ;-) ). Let me shortly touch base on some of the sessions.

Adrian Colyer – AOP in the Enterprise: If you have never seen Adrian present, please make sure to drop by at his session. Not only is Adrian a great speaker, he also has some interesting material to cover. I’m sure he’ll touch on the new features Spring 2.0 has in the area of Aspect-Oriented Programming and how Aspect-Oriented Programming will bring us closer to doing domain driven design and development.

Rod Johnson – Testing with Spring: Rod will present on testing with Spring. Of course he’ll touch on the excellent integration testing support Spring features. Everytime I host a training session, I explain about the support for tests that automatically roll back. The approach is so natural for me, that I never think about the time anymore I had to generate unique IDs for all objects I insert in a database while testing or setting up a new database schema for every test. This sure is interesting stuff.

Juergen Hoeller – JMS in a Spring Environment: Juergen will present on JMS and I’m certainly going to join this session, since I haven’t had a good look at the latest additions on the JMS front yet. Spring 2.0 features asynchronous message listeners, based on POJOs.

Gregor Hohpe – Patterns in Service-oriented Architectures. Aside from the fact that Gregor has good humor (’If this was buzzword bingo I probably would be an instant winner with this session title’) and that he knows that SOA in Dutch translates to STD, he also is very knowledgeable. I’ll definitely join his talk because I’m certain he has some interesting stuff to cover in the area of Service-oriented architectures and asynchronous stuff.

Written by Alef in: Business, Spring, Technology |
May
05
2006
3

Amsterdam Java Meetup (30th of June) and SpringOne

It’s that time of the year again. I was walking down the streets of Amsterdam last night and everybody was sitting outside. It’s the first hot day of the year and that’s when everybody gets out of their houses and starts drinking beer in the streets.

Java Meetup
It reminded that I still had to pick a date for the next Java Meetup. Last two editions were pretty successful, although the bar I picked the last time was kind of small and we got kicked out because of some private party that started at 10 or something. Anyway:

The next Amsterdam Java Meetup
is scheduled for June 30th
Location: to be announced
Time: 6pm

I still have to find a good location that will hold 50+ people without having to reserve anything. Please don’t hesitate to take anyone with you that’s faintly familiar with the term Java. After having a beer or two, it doesn’t matter anymore whether or not you know the difference between a public and private method anyway. No technical presentations, just a drink with some fellow Java developers. The first couple of rounds are free (yes, free as in beer), so don’t be late. Check back here later on for the location.

You can leave a comment here if you want to join, but just dropping by is okay too.

SpringOne update
In somewhat more than a month, Interface21 and BeJUG are hosting SpringOne, a conference targeted at J2EE developers with numerous big names in the industry giving interesting talks. Today we had some good news, both Google and GigaSpaces confirmed their sponsorship. Other sponsors include Chess IT, Symantec and BEA. Let’s hope they have some nice goodies to give away ;-) .

Written by Alef in: Java-related, Other, Spring, Technology |
Apr
18
2006
2

Preparing for SpringOne, June 15th – 16th, Antwerp

After hosting the Spring Experience in Miami December last year, this year Interface21 is organizing yet another conference focused on everything Spring. With speakers such as Gregor Kiczales, Gregor Hohpe, Patrick Linskey, Cameron Purdy and of course the usuall Interface21 suspects, SpringOne is promising to be an exciting event packed with in-depth talks on Spring, AspectJ, Spring WebFlow and several other things related to Java and J2EE.

The conference is going to be held in the same location as JavaPolis which is the Metropolis movie theatre in Antwerp. So besides some good technical content, you’ll also be able to enjoy Belgian beer and I can tell you, Belgian beer is pretty good!

The conference is a joint effort of Interface21 and the Belgium Java User Group (BeJUG). More information can be found on the SpringOne website, at www.springone.com

While discussing the conference internally, more and more we came to the conclusion that it shouldn’t be focused entirely on Spring. That is why we didn’t not only approach the Spring experts in the field, but also on software development with Java in the enterprise in general. So we ended up with an impressive list of people to come and speak at SpringOne, ranging from the father of AOP Gregor Kiczales to SOA expert Gregor Hohpe.

A short introduction to some of the sessions we’ll be having:

Adrian Colyer – AOP in the Enterprise: Spring AOP has been greatly improved in Spring 2.0 and is now both simpler and more powerful than the AOP support offered by Spring 1.x. In this session Adrian will cover the new AOP support in Spring 2.0, integration with AspectJ, and where these technologies fit in enterprise application development. The talk includes a number of demonstrations and examples.

Eberhard Wolff – Spring Patterns: Patterns are widely accepted as a means to describe common ways of architecture and design. In the book “Server Component Patterns” (Wiley, 2002) we described component-oriented systems like EJBs as a set of Patterns. This talk presents how Spring implements these patterns and illustrates the new approach Spring takes towards components. Also new Patterns in Spring like Exception Translator or Template are presented. This shows the principles Spring uses for the integration of different APIs and makes the design of Spring easier to understand.

Ramnivas Ladded – Domain Driven Design with AOP and DI
Domain Driven Design (DDD) suggests dealing with complex software system using a domain model and preserving the model in implementation. Since domain model entities have rich behavior, so should their software implementation artifacts. A direct mapping between domain model and software artifacts create simple-to- understand, inexpensive-to-implement, and easy-to-evolve systems.

While the idea behind DDD isn’t new and the value is easily understood, many implementations do not adhere to its principles. This disconnection may be due to many obstacles in implementing it. Combining Dependency Injection (DI) with a full-fledged aspect-oriented programming (AOP) system such as AspectJ help overcome many obstacles.

The traditional DI mechanism allows injecting dependencies into coarse-grained objects such as services exposed to the application level. However, it cannot do the same for fine-grained domain objects, which are not exposed in the same manner. The DI and AOP combination overcomes this limitation allowing creation a web of domain objects mirroring the model. Now domain classes can implement rich behavior by collaborating with dependent objects, instead of acting as mere data carriers. Further, domain concepts such as security, change tracking, and business rules are crosscutting in nature. AOP allows expressing these concepts directly using aspects.

In this session, we will examine the need for domain driven design, obstacles in achieving it, the basics of enabling behavior-richness for domain objects, and patterns of usages. This session will also present several examples that show the power behind the techniques. The knowledge gained through this session will enable you to readily apply domain driven design in your systems.

Written by Alef in: Business, Spring, Technology |

Powered by WordPress | Theme: Aeros 2.0 by TheBuckmaker.com