Package org.jmolecules.archunit
Class JMoleculesRules
java.lang.Object
org.jmolecules.archunit.JMoleculesRules
Deprecated.
A set of ArchUnit rules that allow verification of domain models. In short the rules here verify:
- Aggregates only refer to entities that are declared to be part of it.
- References to other aggregates are established via
Associations or identifier references.
- Author:
- Oliver Drotbohm
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic com.tngtech.archunit.lang.ArchRuleDeprecated.AnArchRulethat ensures that oneAggregateRootdoes not reference another via the remote AggregateRoot type but rather via their identifier type or an explicitAssociationtype.static com.tngtech.archunit.lang.ArchRuleall()Deprecated.AnArchRulethat's composed of all other rules declared in this class.static com.tngtech.archunit.lang.ArchRuleDeprecated.AnArchRulethat verifies that fields that implementEntitywithin a type implementingAggregateRootdeclare the aggregate type as the owning aggregate.
-
Constructor Details
-
JMoleculesRules
public JMoleculesRules()Deprecated.
-
-
Method Details
-
all
public static com.tngtech.archunit.lang.ArchRule all()Deprecated.AnArchRulethat's composed of all other rules declared in this class. -
entitiesShouldBeDeclaredForUseInSameAggregate
public static com.tngtech.archunit.lang.ArchRule entitiesShouldBeDeclaredForUseInSameAggregate()Deprecated.AnArchRulethat verifies that fields that implementEntitywithin a type implementingAggregateRootdeclare the aggregate type as the owning aggregate.class Customer implements AggregateRoot<Customer, CustomerId> { … } class Address implements Entity<Customer, AddressId> { … } class LineItem implements Entity<Order, LineItemId> { … } class Order implements AggregateRoot<Order, OrderId> { ListlineItems; // valid Address shippingAddress; // invalid as Address is declared to belong to Customer } - Returns:
- will never be null.
-
aggregateReferencesShouldBeViaIdOrAssociation
public static com.tngtech.archunit.lang.ArchRule aggregateReferencesShouldBeViaIdOrAssociation()Deprecated.AnArchRulethat ensures that oneAggregateRootdoes not reference another via the remote AggregateRoot type but rather via their identifier type or an explicitAssociationtype.class Customer implements AggregateRoot<Customer, CustomerId> { … } class Order implements AggregateRoot<Order, OrderId> { Customer customer; // invalid CustomerId customerId; // valid Associationcustomer; // valid } - Returns:
- will never be null.
-
JMoleculesDddRulesinstead.