BoundedContext

Marks a package as one belonging to a Bounded Context with the specified name.

Java does not have the notion of package nesting. Packages in Java are separated namespaces which seem to have a hierarchical structure for convenience.

Nesting Convention

This annotation assumes that nesting formed by a programmer when naming packages is a hierarchy. Terms mentioned below assume that package “inheritance” or “hierarchy” is a convention supported by this framework and is not a standard feature of Java.

Inheriting Package Annotation

Packages which names start with the name of the annotated package “inherit” the annotation. This means that these packages belong to the same Bounded Context unless they are annotated with another Bounded Context name.

A possible usage scenario would be to have an aggregate root class placed in a “parent” package, and aggregate parts being under “sub-packages”.

Packages that do not have a common “parent” but annotated with the same name belong to the same Bounded Context.

Functions

Link copied to clipboard
public abstract String value()
The name of the Bounded Context to which the package belongs.

Inherited functions

Link copied to clipboard
public abstract Class<? extends Annotation> annotationType()
Link copied to clipboard
public abstract boolean equals(Object p)
Link copied to clipboard
public abstract int hashCode()
Link copied to clipboard
public abstract String toString()