Package org.jmolecules.archunit
Class JMoleculesRules
- java.lang.Object
-
- org.jmolecules.archunit.JMoleculesRules
-
@Deprecated public class JMoleculesRules extends Object
Deprecated.since 0.5, for removal in 0.6. UseJMoleculesDddRulesinstead.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 Constructor Description JMoleculesRules()Deprecated.
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static com.tngtech.archunit.lang.ArchRuleaggregateReferencesShouldBeViaIdOrAssociation()Deprecated.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.ArchRuleentitiesShouldBeDeclaredForUseInSameAggregate()Deprecated.AnArchRulethat verifies that fields that implementEntitywithin a type implementingAggregateRootdeclare the aggregate type as the owning aggregate.
-
-
-
Method Detail
-
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{ … } class Address implements Entity { … } class LineItem implements Entity { … } class Order implements AggregateRoot { List lineItems; // 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{ … } class Order implements AggregateRoot { Customer customer; // invalid CustomerId customerId; // valid Association customer; // valid } - Returns:
- will never be null.
-
-