https://github.com/chrisgleissner/behaim
Java Object Graph Explorer
https://github.com/chrisgleissner/behaim
builder-pattern graph java visitor-pattern
Last synced: about 1 year ago
JSON representation
Java Object Graph Explorer
- Host: GitHub
- URL: https://github.com/chrisgleissner/behaim
- Owner: chrisgleissner
- Created: 2016-01-13T22:29:47.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2020-10-13T06:44:45.000Z (over 5 years ago)
- Last Synced: 2025-02-10T08:44:24.847Z (about 1 year ago)
- Topics: builder-pattern, graph, java, visitor-pattern
- Language: Java
- Homepage:
- Size: 415 KB
- Stars: 4
- Watchers: 4
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE-2.0.txt
Awesome Lists containing this project
README
# Behaim
[](https://search.maven.org/artifact/com.github.chrisgleissner/behaim)
[](https://www.javadoc.io/doc/com.github.chrisgleissner/behaim)
[](https://travis-ci.org/ksaua/remock)
[](https://coveralls.io/github/chrisgleissner/behaim?branch=master)
[](https://codeclimate.com/github/chrisgleissner/behaim/maintainability)
Behaim uses Java reflection to explore an domain model up to a configurable recursion depth. The resulting meta data
can then be used by pluggable visitors.
As a proof of concept, Behaim currently comes with a builder visitor that allows for the creation of randomly populated
object graphs which may be useful for performance tests.
# Features
- Multi-threaded graph exploration
- Re-use of meta data about an already explored object graph
- Extensible with custom visitors. Already comes with a visitor to create a randomly populated object graph.
# Builder Usage
Default configuration
```
Foo foo = Builder.make(Foo.class);
Collection foos = Builder.make(Foo.class, 100);
```
Custom configuration
```
Config config = new Config(...);
Foo foo = Builder.make(Foo.class, config);
Collection foos = Builder.make(Foo.class, config, 100);
```
Repeated builds
When you need to repeatedly create objects with the same configuration, use the instance make method.
```
Builder builder = new Builder(Foo.class);
Collection foos1 = builder.make(100);
Collection foos2 = builder.make(50);
```
# FAQ
What does Behaim mean?
Martin Behaim (1459 – 1507) was a German cosmographer, astronomer, geographer and explorer. His [Erdapfel](https://en.wikipedia.org/wiki/Erdapfel)
from 1492 is considered to be the oldest surviving terrestrial globe.