Wednesday, March 31, 2010

Support for mongoDB started

I think NoSQL datastores are a very interesting complement to relational databases. I think mongoDB is a good choice for the rich persistent domain models that are typical for a Sculptor application. Today's article at InfoQ about mongoDB mention the relation between document stores and DDD.

We have started prototyping and it looks promising. The idea is that that Sculptor will provide:
  • Access objects (implementation of repository operations) that interact with mongoDB.
  • Good query support (e.g. findByCondition).
  • Automatic mapping between domain objects and mongoDB documents (DBObject) will be generated.
  • Different types of association will be supported. Aggregates are typically embedded documents and other associations are stored as id references. Maybe we will provide a mechanism to lazy load associated documents.

Saturday, March 20, 2010

Improved Graphviz Visualization

I have improved the visualization with several new features. You can use this new diagram generator right away as described in the end.

Several diagrams with different focus and level of detail are generated. Below are samples of the different types of diagrams. You can click on the images below to see them in full scale.

Module dependencies:

Overview:


One separate diagram for each module:


Diagram with focus on elements marked as core domain (hint="umlgraph=core"). Note that core domain objects also have another font color (and background color) in all diagrams.


And finally, a diagram with full detail of all objects.


All colors can be configured using generator properties file and it is also possible to set the color for individual elements using a hint in model file (hint="umlgraph.bgcolor=FFCC99"). It is also possible to hide elements using hint="umlgraph=hide".

You can generate the new diagrams in your Sculptor project right away. Version 1.8.1-SNAPSHOT includes this, but even if you need to use an older version (not snaphot) you can drop in the new generator templates in your project. Download from trunk
umlgraphhelper.ext to your src/main/resources/extensions/ and
UMLGraph.xpt to your src/main/resources/templates/

To generate images (png) from the generated Graphviz dot files you can use the new fornax-graphviz-m2-plugin. Add the following to your pom.xml:


<plugin>
<groupId>org.fornax.toolsupport</groupId>
<artifactId>fornax-graphviz-m2-plugin</artifactId>
<version>1.0.0</version>
<executions>
<execution>
<phase>generate-resources</phase>
<goals><goal>run</goal></goals>
</execution>
</executions>
</plugin>

You also need to install the excellent Graphviz tool.

Thursday, March 11, 2010

Success Story - Using my Own Tool

I’m the founder and lead developer of Sculptor. Why would I write a success story? They should be written by users. Right, I’m a user of my own tool. This is maybe the key to why the tool is working as good as it does.

Since May 2009 I have been working with a customer in the logistics business. I’m involved in several projects but in my “main” project we develop a Track & Trace system. We receive events with parcel state information from several production systems in different countries. Volumes around 500 million tracking events during 6 months, which is the period we need to support track&trace searching.

In this department JEE was greenfield development. They have been using Java before, but not with application servers and modern frameworks. We established guidelines and tools for the new platform.

The introduction of Sculptor started with a technical prototype of the domain model. About 20 entities were developed in 2 days. Test driven. Of course this was only an initial draft, but it was important to quickly be able to try our ideas in practice. We have done a lot of refactoring of the domain model since then and Sculptor doesn’t sit in the way for doing changes. It simplifies change.

When evaluating Sculptor for the prototype my team developers stressed the importance of being able to remove the tool and continue without starting from scratch. It was good to see that the developers were able to quickly grasp the concepts and be able to use the tool immediately without any lengthy education.

When I and the other developers in my team had used Sculptor for a while another team wanted to try it also. I helped with converting existing code. The conversion and initial learning was smooth.

We listed the following benefits of using Sculptor for all new projects at the department:
  • Improved productivity. Generate code from high level description. Less manual mistakes. Relieved the developers from repeating and tedious programming tasks.
  • High quality of generated code. As if written manually, but better. We actually found several flaws in the hand written code when converting it to Sculptor.
  • Consistent design and structure. The department was running several projects in parallel, with different developers, and varying experience of JEE. Consistency between solutions was considered very important from a maintenance perspective.
  • Easy to learn. The developers that tried Sculptor found it intuitive to use. “It’s nothing magic”.
  • Great possibilities for customization. We did some adjustments to fit the database naming conventions.
  • Good design. The design of the generated code match our guidelines, JEE, JPA, DDD.
  • Easy to remove the tool. No dynamic runtime magic.
We have continued to use Sculptor successfully. We use Sculptor for all new projects. Several new developers have joined the teams and quickly learnt how to use Sculptor. We are 11 developers in 4 projects right now.