InfoQ

InfoQ

News

My Bookmarks

Login or Register to enable bookmarks for unlimited time.

The content has been bookmarked!

There was an error bookmarking this content! Please retry.

Presentation: Event Patterns

Posted by Floyd Marinescu on May 17, 2007

Sections
Architecture & Design,
Development,
Enterprise Architecture
Topics
SOA ,
Messaging ,
Java ,
Ruby ,
.NET
Tags
Patterns ,
Best Practices
Ian Cartwright presents some of his work (developed with Martin Fowler) on Event Patterns (recorded at JAOO), including: Event Sourcing, Event Collaboration, Parallel Model, and Retroactive Event. These patterns can be used in scenarios where a sequence of domain model changes may need to be recorded, reversed, corrected, or simply observed.

Watch Event Patterns (30 min)

Event Sourcing
 - Capture all changes to an application state as a sequence of events. You can rebuild domain object state from scratch by replaying events and may allow reversing events.

Event Collaboration

 - Multiple components work together by communicating with each other by sending events when their internal state changes.

Parallel Model

 - Replay past events and make changes to compare different possible outcomes. For example compare different risk management strategies for the same set of Orders.

Retroactive Event
 - Correct previous Events by creating a parallel model and merging, or rewinding and replying corrected events.

Have you done any work that fits these patterns on your own projects?
  • This article is part of a featured topic series on SOA
Unlimited undo by Mikko Apo Posted
patterns! by Joost de Vries Posted
State transitions as event transaction model by William Homan-Muise Posted
  1. Back to top

    Unlimited undo

    by Mikko Apo

    A few years ago I had a similar solution in a university project. The program was supposed have undo with one step undo history, but I was determined to make the undo unlimited. The easiest way to implemented that was with events, or transactions. Events could hold sub events, so the changes to the model could be rewound on micro (detailed) or on macro level.

    Sometimes I've been thinking how the same solution would work as a backend solution for large scale enterprise data. Storing the change information would be nice step up from having just the current state of the model available in the database.

    Every change in the model could be stored as event. The event could contain more information about the transaction than just the change data: user id, transaction ids, session state and application's context. With that info the event log would have more uses than "just" containing the changes, it would serve as an automatically generated application/system log. Event's authentication data could would provide accountability for all actions. Also, as a convinient side effect the system would support data's revision history out of the box. No more need to manually reimplement different aspects of data's revision history.

    Hooking something like this to the integration layer would be nice. Persistance APIs like JPA could also generate the event log automatically. That way the system would be nicely transparent (from the application's point of view) and there wouldn't be any need for changes to support the event log.

  2. Back to top

    patterns!

    by Joost de Vries

    Interesting; I was recently saying to a colleague that I felt that the patterns movement seems to have dried up years ago. Maybe that is because the hype moved on, or maybe because making knowledge explicit is hard work that mostly benefits others, I don't know.
    I still feel that patterns are a wonderful way to create knowledge: ie make explicit what people have been doing wrestling with real world problems.
    (if I'm not right in saying that the patterns movement dried up I'd love to see some some pointers)
    So, this is very interesting.

  3. Back to top

    State transitions as event transaction model

    by William Homan-Muise

    We have developed a product that collects events from network devices and uses a state machine model to capture complex and long running transactions. It is currently being used in the VoIP and Municipal WiFi markets for monetization, revenue assurance, alerting/notification and analytics. It is based upon the JBI container.

Educational Content

New-age Transactional Systems - Not Your Grandpa's OLTP

John Hugg discusses high volume transaction processing applications with high and low frequency profiles, and how VoltDB can be used for that purpose.

Cool Code

Kevlin Henney examines code samples to see what can be learned from them starting from the premise that one won’t write great code unless he knows how to read it.

Collaboration: At the Extremities of Extreme

Jason Ayers share the observations he made watching a team of developers collaborating in real time on the same code base, pushing XP, pair programming and continuous integration to their extremes.

Yesod Web Framework

Michael Snoyman presents Yesod, a web framework written in Haskell and containing a web server, templating, ORM, libraries (templating, gravatar, etc.).

Transactions without Transactions

Richard Kreuter and Kyle Banker on how to avoid classical RDBMS transactional systems by using compensation mechanisms, transactional messaging or transactional procedures.

Attila Szegedi on JVM and GC Performance Tuning at Twitter

Attila Szegedi talks about performance tuning Java and Scala programs at Twitter: how to approach GC problems, the importance of asynchronous I/O, when to use MySQL/Cassandra/Redis, and much more.

10 tips on how to prevent business value risk

One category of risk that project teams need to ensure they address is business value failure – delivering a product that fails to provide value for the business investor.

Interview: Software Systems Architecture: Working With Stakeholders Using Viewpoints and Perspectives

InfoQ spoke to the authors of Software Systems Architecture on a couple of new topics, the System Context viewpoint and Agile, which have been added to the second edition.