Giter Club home page Giter Club logo

domainreversemapper's Introduction

logo

Domain Reverse Mapper (DRM)

Build Status Coverage Status

Automatically generate Graphviz 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 manually from command line or as a maven plugin hooked to your build process.

Using from command-line

Download the latest executable .jar from Releases. Run this archive in classpath that also contains your domain model classes. So let's say your domain model is in domain.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 package com.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 use java -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 the packages configuration parameter contains a list of packages that should be scanned for domain graph.

When process-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.

domainreversemapper's People

Contributors

d4gg4d avatar vertti avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

domainreversemapper's Issues

Case Optional<?>

Currently there is no handling of Optional<?> like domain object wrappers, thus no reference in the domain graph.

Option to exclude classes

Add an option to exclude specific classes from the scanned packages.

  • Add exclusion to drm-core logic
  • Add command-line support for excludes
  • Add maven configuration support for excludes

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.