Sep
30
2006
0

Amsterdam Java Meetup Fall 2006 / recap

Yesterday, we had another successful installment of the Amsterdam Java Meetup. Unfortunately, I didn’t bring my camera, so no pictures from the event. After the last meetup got cancelled because of my own stupidity, I didn’t particularly spend a lot of time on getting the word out. Fortunately Arjen blogged about it and so did Bram so there still was a bit of buzz afterall.

40 odd people turned up and we had a good time discussing both technical and non-technical stuff. Best part of the evening was Erik E. from K.H. discussing how his new Nokia supports Wip, Wap, Wifi and Wop so he had all the latest and greatest in mobile technology packaged in 15 x 1.5 x 7 (or something). He was wondering how he could use this stunning piece of technology to fill up the parking meter from right inside the bar. When he found out technology still hadn’t advanced that far yet, he finished his beer in one go (I guess he never heard of uncle Bob ;-) ) and left.

Earlier that night I ran into a mysterious Russian guy asking me what all these Java developers were doing in ‘his’ bar and whether or not it was some kind of committee. After I enlightened him about the fact that this was the Java Meetup and handed him my business card (he asked for it, I’m not the guy that just walks into a place and starts handing out business cards usually :) ), the guy gave me this startled look: he was just sitting there in his bar reading a magazine (I couldn’t tell what magazine, it was Russian) and all of a sudden he was surrounded by all kinds of Java developers (he himself was one too) on a meeting organized by one of the Spring guys. That was an overdose of coincidence for him; he finished his schnaps and also left.

Next meetup is schedule for January. I was kindly asked to not name that installment the New Y(e)a(v)(r)(s)(a) Meetup. I’ll think about it.

p.s. despite of what many people suggested, the Amsterdam Java Meetup is not only meant for Java developers from Amsterdam. We had a huge turnup, with people from all over the country including people from Nijmegen, Rotterdam and Utrecht.

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

Good to Great & the Barbarians (at the Gate)

Back in August last year, I had an entry about Freakonomics, a book by Steven D. Levitt.

Near the end I said the next book I was about to read was Good to Great, by Jim Collins and I promised you that I’d update you once I finished the book. Well, I have to apoligize for breaking that promise, because I did finish the book, but didn’t blog about it.

I’m not going to do an entire review here, because there are plenty of raving reviews out there. One thing I can say is that it really helped me shaping my business and although it’s not a really easy read (it’s kind of boring actually), the conclusions Jim and his team draw are really inspiring.

I have also just finished Barbarians at the Gate about the (in)famous take-over of RJR Nabisco by KKR in the late-eighties. It’s a fantastic book that covers the take-over really well and feels like a fiction thriller, but is in fact based on a real story. Especially with all the discussions around hedge funds lately, it’s an interesting read, especially if you (like me) are not really into these kinds of things but still want to keep up-to-date.

Written by Alef in: Business, Economics | Tags: , ,
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 |
Sep
03
2006
3

IKEA overdose, but at least they know how to use IT!

About a year ago I moved to a new appartment. I bought the appartment I’m in now and unfortunately, newly built appartments usually don’t come with couches, dinner tables and beds. Since all the (rented) appartments I had in the past where furnished mostly, I didn’t have that much stuff of my own yet. I bought some new stuff, but also used a bed of a friend of mine for over a year, while he was abroad. This weekend he returned, and needed his old bed so I had to buy a new one. I actually didn’t expect him to want his bed returned, so I didn’t use the past year to search for a new one.

Stock image

So where do you go, when you need a new bed right away?? Well, here, there’s only one place to go really, and that’s the IKEA. I don’t like the IKEA that much, because if you put too many IKEA stuff in your house, it’s going to look IKEA’ish for sure, and I’m not sure if that’s what I want :) . Anyway, I had to get a new bed fast, so IKEA it was. After arriving at the store in Utrecht, I quickly found a good bed in the showroom, had a guy explain a bit about the matrasses and chose one that seemed comfortable. Off we went to the counter to order the bed and the matrass. The guy at the counter quickly came to the conclusion, he had to dissappoint us, because the bed was out of stock.

I remember a new IKEA had just opened in Amersfoort, which is quite close to Utrecht, so I ask the guy if the bed was in stock there. Well, as a matter of fact it was! They had 3 left. I still had to do some other stuff first, so I also asked him: ‘Can you reserver one of those for me?’. He said he couldn’t, simply because they didn’t want a whole bunch of dangling reservation for stuff that people might not pick up. ‘But don’t worry’, he said, ‘the bed is not going to go out of stock, they only sell about 1.2 of those a week in Amersfoort‘.

No way, I thought! This guy, an IKEA salesman (with all due respect), not knowing anything of IT or inventory management at all, is able to tell me (without being amazed about it), how many beds of a certain type they’re selling on a average weekly basis in a certain store?? And he just takes it for granted???

I asked the guy if I could have a look at his screen and there it was, somewhere in between other details about the Vinstra (link in Dutch) bed; an entry saying the average sales per week for this bed was 1.2.

palluco

‘But that’s not a miracle, is it’, I hear you saying. Well, it’s not, but if you think about it carefully, how many times does it happen you go to a store and you find its IT infrastructure to be everything you hoped for, having no questions left when you leave the store? I think this is amazing and an example of IT done well. A quick search didn’t get me references to what ERP system IKEA uses or who implemented this, but it sure is a good implementation, because no matter what system it is, it sure gave me a good experience while visiting IKEA in Utrecht.

p.s. This by the way only partially made my day, because the other stuff you have to go through when visiting an IKEA on a Saturday afternoon is just horrifying! When I entered the IKEA in Amersfoort, I immediately realized I would have to do things real quick here, otherwise I would definitely end up with an IKEA overdose. So I quickly rushed through the store, ordered my bed, did a little waiting for the bed to be picked up from their internal warehous and drove home. The bedroom now has a closet and a bed from IKEA. That’s the limit as far as I’m concerned. There’s some Japanese antique stuff in there as well, which nicely balances with the IKEA pieces ;-) . If I would have had time, I would have bought the Pallucco bed in the picture above.

Written by Alef in: At home, Business, Technology |

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