Blog Archives

Marrying DHTMLX with Apache Isis

Mylaensys have just publicised on their blog the fact that they are working on an integration between DHTMLX and Apache Isis.

They previously have integrated DHTMLX and Spring Framework (DHTMLX Spring Link), so they have a proven track record… and I’ve been impressed how quickly they’ve produced some early prototypes.

So if the idea of rapidly building domain-driven apps with a customizable UI appeals, then keep an eye on their progress. The Isis mailing lists would be a good place to subscribe :-)

A domain service for mail merging Word (OpenXML .docx) files … with repeating data

One requirement that most business apps have is to be able to dynamically generate Word documents. For scalar non-repeating data this is not too difficult in .docx; indeed the file format has built-in support for data binding using Custom XML Parts. However, there is no support for repeating data, at least, not prior to Word 2013. Which is where a little domain service that I’ve been working on comes into play Read the rest of this entry

Responsibilities of the Application Layer in Domain-Driven Applications

It’s standard practice to build enterprise apps in layers: each layer has its own set of responsibilities, providing a separation of concerns.  In Evans’ DDD book, layered architecture is one of his named patterns, its intent being to isolate the domain layer from the adjacent layers of application and infrastructure.  The presentation layer is, of course, the other standard layer, sitting on top of the application layer:

  • presentation layer
  • application layer
  • domain layer
  • infrastructure layer

Of these layers, though, it’s the application layer that seems to cause the most difficulty, Read the rest of this entry

Apache Isis refactorings

For the last week or two I’ve been doing some refactoring deep in the bowels of Apache Isis, working on simplifying some of the infrastructure there.

One of the major changes in the next release Read the rest of this entry

Apache Isis 0.2.0-incubating released

Just a quick announcement that last week we put out our second release of Apache Isis from the incubator, namely 0.2.0-incubating.

The main theme in this release is to try to simplify things a little, so that would-be users can more easily grok what Isis is about:
Read the rest of this entry

More on enums and powertypes

My last blog post, about pushing behaviour onto enum subclasses, got quite a few votes on dzone. Interestingly, about a third voted the post down, not up – though no-one left any comment to explain why they thought it was a bad idea.

So, here’s another example of using this technique, but from a somewhat different source. I was recently writing some code that needed some fairly standard collections manipulation, but rather than write it myself I thought I’d check out the google-collections API (now at v1.0). I remembered reading that this library has support for caching along with soft or weak references, and browsing into the source code I came across MapMaker#Strength: Read the rest of this entry

Simplifying inheritance hierarchies using powertypes and Java 5 enums

Having seen how to teach Naked Objects to support Java 5 enums directly, let’s use this new capability to avoid inheritance hierarchies in entities using powertypes.
Read the rest of this entry

DDD article @ Methods and Tools

If you’ve just stumbled across this blog and are wondering what “domain driven design” is all about, you might like to check out an article I wrote for the Methods and Tools journal. It’s downloadable in their (free) PDF magazine, and is also available online in HTML form.

Thanks to Vaughn Vernon for his time reviewing it… but any mistakes and errors are mine alone!

Domain Driven Design using Naked Objects – book now in print!

In case you missed the announcement from the pragprog newsletter, the book is now in print.

Just in time for the holidays!

DuckTyping in Java (and the Ubiquitous Language)

Ducks in a row...

I’ve recently discovered javaposse.com (recommended), and was listening to an podcast from last year on the DRY principle.

One of the questions asked was: when coding in Java, where do we have to repeat ourselves? There was the usual point made about generics being overly verbose (Java 7′s diamond operator will help), but another answer came back about the repetition required in having to explicitly say that a class implemented an interface in addition to just providing an implementation of all the methods in that interface… in other words, why can’t Java support duck typing:

So, suppose:

public interface IDuck {
    public void quack(int volume);
    public void float();
}

and

public class DuckLike {
    public void quack(int volume) {  .... }
    public void float() { }
}

What our speaker wanted was to be able to pass a DuckLike object around to something that would use IDucks, without having to say class DuckLike implements IDuck:

public class DuckUser {
    public void useDuck(Object o) {
        ... use the supplied object as a duck if it quacks and floats ...
    }
}

In order to support ducktyping, note that the DuckUser#useDuck takes an Object, not an IDuck.

So, one solution that came back was a utility to automatically provide a proxy for the duckLike thing that implements IDuck if it does indeed have a suitable implementation. This proxy then delegates to the underlying duckLike. I must admit this caught my fancy so I thought I’d have a go at writing it.
Read the rest of this entry

Exploring Domains and Collaborating with Domain Experts

exploring

Exploration and experimentation are essential in DDD. Rather than stopping the moment we get one useful model, we should look for alternatives that might reveal a deeper insight.

But we need to ensure that the exploration involves our domain experts; we are after all co-explorers. A heavy-duty requirements document will certainly drive the domain experts away, but even whiteboarding ideas using any kind of technical notation can be a turn-off, and lacks concrete feedback.

A couple of months ago skillsmatter.com ran a small 1-day conference devoted to domain driven design. Alongside Eric Evans, Gojko Adzic and other DDD alumni, I also gave a talk, and chose to discuss how Naked Objects can be use to build working prototypes that engage the users, “animating the domain model” and bringing it to life.

The Skillsmatter folk recorded podcasts of the entire proceedings, so if you’re interested then take a look at my talk and some of the others.

Hexagonal Architecture for Naked Objects

I’m currently busily working through the detailed and helpful (I have to say that, but it’s true!) comments that my technical reviewers have given me on the book.  One thing that several reviewers mentioned was the lack of some sort of overall architecture to help understand what Naked Objects actually is.

In an earlier draft I had put together some words and a diagram on Naked Objects as an implementation of Alistair Cockburn’s Hexagonal Architecture, but had subsequently removed them.  Based on this feedback I’ve spruced them up and added them back in.  The diagram also acts as a roadmap to the book itself (the overlays are the chapter numbers):

Read the rest of this entry

Interface Segregation Principle

collander

On the DDD newsgroup one thread started there recently asked:

Implicit concepts are an important subject in software creation. They allow for breakthroughs in hard to model systems (for example).
Did you ever use _special_ techniques to identify them? Be it via interviews, visualizations, system metaphors, code analysis or code refactoring.

It’s a good question; it’s only by identifying concepts correctly that we can hope to get a rich and useful domain model. My answer went as follows:

Read the rest of this entry

Follow

Get every new post delivered to your Inbox.

Join 197 other followers