Category: dependency injection

  • Configuring ActiveMQ transactions in Spring

    It’s easy to configure Message Driven POJOs over ActiveMQ with Spring, but slightly more involved once you want to get transactions working correctly; here’s how to do it. Start with a basic DefaultMessageListenerContainer config. An embedded broker is started, and a MessageListener (CountingMessageListener) is set up to pick up messages from a queue (sample.messages). MessageListenerContainers…

  • Rich UI -> Component Based

    A client of mine is developing a web application. The framework decision was made up front – Spring Webflow/MVC. I like Webflow. Its state machine based continuations concept is very cool. It lets you easy deal with things like back buttons, switching into a side piece of application flow (think needing to log in before…

  • Thoughts on Mixing EJB3 and Spring

    A few weeks ago I blogged about Spring and EJB integration, but something just did not sit well with me. Why would you want to do this at all? I like Spring. Its myriad components make my life simpler. I can write the business code I need to faster without worrying as much about the…

  • Spring Web Services 1.0 Released

    The Spring guys have released version 1.0 of their web services framework. The framework contains: simplified methods to create contract-first web services (Java classes from XML schemas) a clean client-side API standardized access to O/X (object to XML) mapping tools like Castor, XMLBeans and JiXB that allow you to marshal and unmarshal XML easily As…

  • How to test the middle tier of a Spring application

    Since the advent of dependency injection (DI) as a staple of enterprise development using tools such as Spring or Guice, your code has become a lot easier to test. You no longer need to code up voodoo such as plugging in dummy resource locators or the like based on some random environment variable to tell…

  • Getting up to speed on EJB3 and Spring

    Another contract, another technology set. Having successfully avoided working in EJB2 after getting certified in it by Sun (only to work out just how badly it smelt 😉 ), my initial foray into its successor has been much nicer. The job in question specified Spring and EJB3 as technology requirements, so having Sprung in anger,…

  • What bugs me about Guice

    Last week I switched a basic Spring app to Guice, the new dependency-injection framework from Google. It’s nice, it’s quick, and it does what it says on the box, but one thing bothers me. I know it’s not really logical, but it’s like a rock in my shoe – I need to import com.google.inject annotations…

  • Dependency injection killed the factory pattern

    I was having a play with Guice (http://code.google.com/p/google-guice/), the new dependency injection framework from the folks at Google, and something quite profound happened. I realised that having used Spring for a while now, it had been ages since I had to code up a factory class for pretty much anything. No more weird JNDI lookup…