Archive: DDD

It will be an honor to speech after the key note of Tim Mackinnon at the AgileDay organized by Marco in Bologna, I’ll present how we went from amber to green in four weeks in our last project in London, presenting a speech that Pat and I were setting up for the Xpday in London, but we were fired off cos it was “just” a description of a perfectly aligned agile/XP project, they said(!).

It will be also cool to speech again about Domain Driven Design at the Javaday in Rome, with 700 expected attendees that’s now the biggest Java Gig in Italy, it will be the 3rd refactoring of the slides presented since this summer, more focus on mocking, testing and IOC as well, since in Turin I had a lot of questions about it.

Slides in English coming soon here, after the events.

Javaday in Turin

Finally I have some time to write about it!

I’m organizing for the second year the Javaday in Turin with the Java User Group Turin Coordinators and a little help from some friends… And we are almost done! The conference will be on the 20th of October.

What’s the Javaday?

The Javaday is an initiative organized by the Italian Java User Groups, by the community of Java Italian Portal and by the Java Italian Association with the goal to promote the knowledge and the usage of the Java technology. Javaday is an on road gig that touches different Italian cities all along the peninsula, spreading the Java technology also in places usually skipped out by big events. This feature makes the Javaday a qualifying and unique moment: every single stage is a direct communication channel in which the technology, the local institutions, the developers and the companies can meet together in order to know each other, share knowledge, compare each other and understand the new opportunities offered by the Java Platform. The participation to the Javaday is free.

This year we expect more people than the 100 we had last year, we have some very interesting speeches,  the Java User Group Padova talking about their creature, Parancoe, Simone Federici from Java Italian Portal talking about Spring with Terracotta DSO and Alberto Lagna talking about the third generation web services and many more, have a look on the website!

I’ll recycle my speech about Domain Driven Design that I had this summer at the Essap :-)

Organizing a conference it’s an incredible experience where the stress is almost well balanced by the final satisfaction. Let’s see how it goes this year!

A special thanks to Victor Zambrano that designed the Javaday Brochure and the posters, to Mariachiara Martina helping us with the communications and the great Java Italian Community, we all did a great job, driven by passion.

I’ve just right now published the slides of my two last speeches on slideshare, that site is really nice, simple and wao, web 2.0!

For time boxing look here, for importance of being driven have a look here!

4 things about domain objects

First, please do not mock a domain object. Stub it. Thanks.

Second, do not write an interface for it. Neither if you want a Null Object implementation.

Third do not be obsessed with Null Objects, sometimes they are good, not always. If you end with a

if objectInstanceType == ObjectType.NULL in your code perhaps something is wrong in your design, a null object is to avoid that stuff and to give a “null behaviour”.

Forth. Do not use the ActiveRecord pattern, seriously, you’re gonna couple the infrastructure layer with the domain layer. It’s not a pattern IMHO, kind of antipattern, try considering a repository.

Fifth. For the point one maybe you will like a builder pattern in order to stub objects. Here an example:

class PersonBuilder
{
private string name = "testname";
private int age;
public PersonBuilder Name(string value)
{
name = value;
return this;
}
}
public PersonBuilder Age(int value)
{
age = value;
return this;
}
public Person ToPerson()
{
return new Person(name, age);
}

Syntax then is nice, I really like it.

Person expected = new PersonBuilder().Age(29).Name(”antonio”).ToPerson();

and it encourages to write not mutable object like this Person:

class Person
{
private readonly int age;
private readonly string name;
public Person(string name, int age){…}
public int age
{
get { return age; }
}
}

Looks like I’ve lost my code formatter… :-(