Using annotations in Prooph

One of the things I love about Java is its native, compiler-level support for annotations, a form of syntactic metadata which can be applied to source code but also retain at run-time to influence application behavior. I use them almost daily in my projects.

I do a fair amount of consulting and development on event sourced applications and these usually use Axon, a popular CQRS & event sourcing framework. Recently, Axon version 3 was released, supporting a number of annotations that can turn any POJO (Plain Old Java Object) into an event-sourced aggregate.

The annotations in Axon inspired me to experiment with adding support for similar annotations to prooph, a PHP framework which I occasionally reference in my PHP conference talks and consulting. This experiment is now available online as a PHP package, on GitHub: https://github.com/prooph/annotations. It works with the last versions of the core prooph components.

The package, like Axon, introduces a number of annotations which allow you to turn any regular PHP class into an event-sourced aggregate. Unfortunately, annotations are not natively supported in PHP. They are written inside documentation blocks and require an additional parser to get working (in the case of my package, Doctrine Annotations). The following example snippet shows how these annotations are applied:

@CommandHandler helps to get rid of some of the boilerplate code usually associated with command handlers in prooph (see this example). @EventHandler turns any annotated function into an event listener.

Let me know what you think!

State Of DevOps Report

The 2017 version of Puppet’s State of DevOps Report was just released.

To me, the most interesting takeaways from the report are:

  • High performing teams have 46x more frequent deploys, 96x faster mean time to recover/repair and a 5x lower change failure rate.
  • They also automate significantly more work (automation is a key ingredient of any successful DevOps strategy).
  • A lower change failure rate and significant automation mean these teams spend 44% more time on new work (and 26% less time on unplanned work and rework).
  • Developers in high performing teams generally work in small batches and practice Trunk Based Development. Low performing teams on the other hand use long-lived feature branches and merge infrequently to trunk or master (read on for my thoughts about feature branches).

Training sessions and talks

One of the things I like most about my work is the ability to help teams improve, by sharing my experiences and knowledge in training sessions. These sessions can be conducted in the form of interactive workshops or talks.

I’m offering training sessions on DevOps, Continuous Delivery, Event Sourcing, Microservices and many other topics. Contact me if you’re interested in details or pricing!

Season’s greetings from Utrecht!

Utrecht – Domtoren in de sneeuw (Chris Heijmans – order a print here)

This amazing photo was taken by Chris Heijmans in 2012. Last year, I ordered a canvas print, which is now proudly displayed in my home. Admittedly, current conditions (partly cloudy, windy, 8 degrees celcius) are nowhere near what’s pictured, but one can hope 😉

2016 has been interesting! I’ve met loads of cool people and been part of some amazing projects. Thank you for reading this blog, attending my talks, following me on Twitter, or listening to me advocate (rant?) in person.

From my cozy, little hometown Utrecht I wish you and yours happy holidays, see you in 2017!