Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Automatically generate Graphviz diagram from your domain classes

License

NotificationsYou must be signed in to change notification settings

NitorCreations/DomainReverseMapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logo

Domain Reverse Mapper (DRM)

Build StatusCoverage Status

Automatically generateGraphviz diagram from your domain classes.

Using reflection, Domain Reverse Mapper scans your packages that contain your domain entities. It then builds a graph of entity compositions and inheritances and creates a Graphviz .dot file from that.

domain model

The picture above is generated from a simple example domain with Domain Reverse Mapper. In the above picture

  • black arrows describe composition (private field in one class refers to another domain class
  • empty arrows show inheritance
  • each package is grouped as a subgraph

Benefits

  • use code as forward thinking documentation to model your domain
  • always have up-to-date diagram of your domain model
  • use the diagram to help in discussions with your team and stakeholders

Usage

This tool can be either used manuallyfrom command line or as a maven plugin hooked to your build process.

Using from command-line

Download the latest executable .jar fromReleases. Run this archive in classpath that also contains your domain model classes. So let's say your domain model is indomain.jar, you can execute Domain Reverse Modeler with

java -cp domain.jar:drm-core-1.3.jar com.nitorcreations.DomainMapperCli -p com.mycompany.domain

This will scan all classes under the packagecom.mycompany.domain and output the .dot file to your console output. If you want to write it to file use switch-f filename.dot. If you need to scan multiple packages use format-p "com.package1, com.package2".

Use the generated .dot file with your local Graphviz or any of the online Graphviz tools to show your domain diagram.

NOTE! Do not usejava -jar as this will override the classpath provided by-cp switch so your domain classes won't get included and the produced graph will be empty.

Using with Maven

Add to your pom.xml the following:

<build><plugins><plugin><groupId>com.nitorcreations</groupId><artifactId>drm-maven-plugin</artifactId><version>1.3</version><configuration><packages><param>com.mycompany.domain</param><param>com.mycompany.other_domain</param></packages></configuration><executions><execution><phase>process-classes</phase><goals><goal>map</goal></goals></execution></executions></plugin></plugins></build>

where thepackages configuration parameter contains a list of packages that should be scanned for domain graph.

Whenprocess-classes life-cycle phase gets executed, your domain model graph will be saved to/target/domainmodel.dot. Use this file with your local Graphviz or any of the online Graphviz tools to show your domain diagram.

About

Automatically generate Graphviz diagram from your domain classes

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors2

  •  
  •  

Languages


[8]ページ先頭

©2009-2025 Movatter.jp