Skip to content
cyriux edited this page Apr 23, 2012 · 7 revisions

Contribute to this roadmap!

  • Add desirable features
  • Comment/Vote existing features

Features

  1. Explicitly declare your intent in the code, e.g. with annotations
  2. Verify that the code matches the declared intent, e.g. that a ValueObject is actually immutable
  3. Verify Dependencies based on predefined or custom rules, e.g. that a ValueObject must never depend on an Entity
  4. Extract documentation from the declared intents, for a documentation relevant and always in sync with the code

Declare Intents in your code

Class-level

  • Declare a stereotype for your classes using built-in annotations such as @com.patternity.annotation.ddd.ValueObject, or your own annotations @MyVO, itself meta-annotated with the built-in annotations e.g. @com.patternity.annotation.ddd.ValueObject
  • Declare a package-level design intent in the package-info.java using built-in or custom annotations

Verify the code matches the declared intent

  • @ValueObject must have all their fields final
  • @ValueObject must have equals and hashcode methods explicitly overriden

Verify Dependencies

Class-level

  • @ValueObject must not depend (members, return value, throws clause, superclass and interfaces) on @Entity
  • @ValueObject must not depend on @Service

Package-level

  • Every class in package annotated with @DomainLayer in its package-info.java must not depend on any class in packages annotated with @ApplicationLayer or with @PresentationLayer (recursive or not first...)
  • Every class in package annotated with @ForbiddenDependencies("javax.") in its package-info.java must not depend on any class from javax. or any subpackage

Extract Documentation

Given a package-info in com.mycompany.mybilling with @DomainModel and @Domain("Billing") 
And containing the following classes: ModelElement, ClassElement, FieldElement, MethodElement And with a class ModelElementUtil marked with @Utility 
When I run the tool
Then I find a file in target/patternity/mybilling/billing.html with a glossary of ClassElement, FieldElement, MethodElement only
And each first sentence of their class-level Javadoc is quoted in the glossary

Continous Integration

Deploy to (a) maven central repository for easy install

Jenkins on a free cloud, Github hook