All posts tagged UML

The first Maven snapshot of TRIMM 1.0.1 with TrimmMongo is available from our Maven Repository.

The TrimmMongo project has in this first version a Listener (dk.tigerteam.trimm.mdsd.mongo.SpringDataMongoGeneratorListener) that based on stereotypes can use Spring Data Mongo mapping annotation to save your model in MongDB instance.

There’s also an TrimmMongo example project available called TrimmMongoExample

Short introduction to TrimmMongo modeling

In this first version of the SpringDataMongoGeneratorListener there is support for following annotations for mappings of objects to documents. The listener Stereotypes and Tag values to drive the mapping metadata:

  • @Id – applied at the field level to mark the field used for identiy purpose. STEREOTYPE: DOCUMENT_ID
  • @Document – applied at the class level to indicate this class is a candidate for mapping to the database. You can specify the name of the collection where the database will be stored. STEREOTYPE: DOCUMENT
  • @DBRef – applied at the field to indicate it is to be stored using a com.mongodb.DBRef. STEREOTYPE: DBREF
  • @Indexed – applied at the field level to describe how to index the field. STEREOTYPE: INDEX & UNIQUEINDEX
  • @Transient – by default all private fields are mapped to the document, this annotation excludes the field where it is applied from being stored in the database STEREOTYPE: TRANSIENT

Read more

* Updated the 25th of October to include information on CreateCommand vs. Command stereotype handling for the TrimmCQRS plugin.

The first Maven snapshot of TRIMM 1.0.1 is available from our Maven Repository.

The changes in the core API revolve around enhancements the MetaModel and CodeModel, no breaking API changes.

The biggest change is the addition of the TrimmCQRS which supports Model Driven code generating of AxonFramework (a Java based CQRS framework) based CQRS code.

TrimmCQRS comes with a matching TrimmCQRSMavenPlugin that can be used to drive the codegeneration.

There’s also an TrimmCQRS example project available called TrimmCQRSAxonAddressBookExample which models and generates code that implement the same features and structure of the Axon AddressBook example.
Read more

We have just added an example of how to use TRIMM JPA to generate code for Hibernate 4.x (in this case 4.2.4) to our TRIMM-Examples repository. The project is called TrimmHibernate4xMDDExample.

If you are new to TRIMM JPA, check out this tutorial on how to use it

The largest difference from the Hibernate 3.6.x example, called MDDExample, are the following:

  • To Persist DateTime and LocalDate (from JODA time) – we now use org.jadira.usertype.usertype.core and the latest joda-time version.
    This means that we have removed the dependency to joda-time-hibernate.
  • We have therefore added the following Maven jar dependency:

           <dependency>
                <groupId>joda-time</groupId>
                <artifactId>joda-time</artifactId>
                <version>2.2</version>
            </dependency>
            <dependency>
                <groupId>org.jadira.usertype</groupId>
                <artifactId>usertype.core</artifactId>
                <version>3.1.0.CR8</version>
            </dependency>
          

    Read more

Introduction

In the first tutorial, we looked at how to develop the TrimmWS Profile containing the Web Service modeling elements for use by the TigerTeam Trimm Model Generator and how to save it as a Profile that can be imported into EA. In the second tutorial we looked into how to make the Profile and its content more usable by combining it with a Toolbox and a Diagram into an MDG.

This tutorial describes how to add our own Datatypes to the TigerTeam TrimmWS MDG and how to automatically make them available to our modeling elements.
Read more

Generating code from UML can be very useful, although the usefulness of the result depends on what type of UML diagrams you use.

We’ve been part of several large projects where we used UML class diagrams to model the domain model, according to the DDD principles. Domain models (being OO persistable class models or Web service model) focus on structural patterns, i.e. how the different constructs (like entities, values objects, aggregate, etc.) relate to each other. For structural models we prefer UML class diagrams as we feel the convey information in a much better way than pure textual DSLs.

Visualization of relationships provides a better overview and is a good platform for communication.

Read more