public class JMoleculesRules extends Object
Associations or identifier references.http://scabl.blogspot.com/2015/04/aeddd-9.html| Constructor and Description |
|---|
JMoleculesRules() |
| Modifier and Type | Method and Description |
|---|---|
static com.tngtech.archunit.lang.ArchRule |
aggregateReferencesShouldBeViaIdOrAssociation()
An
ArchRule that ensures that one AggregateRoot does not reference another via the remote
AggregateRoot type but rather via their identifier type or an explicit Association type. |
static com.tngtech.archunit.lang.ArchRule |
all()
An
ArchRule that's composed of all other rules declared in this class. |
static com.tngtech.archunit.lang.ArchRule |
entitiesShouldBeDeclaredForUseInSameAggregate()
An
ArchRule that verifies that fields that implement Entity within a type implementing
AggregateRoot declare the aggregate type as the owning aggregate. |
public static com.tngtech.archunit.lang.ArchRule all()
ArchRule that's composed of all other rules declared in this class.public static com.tngtech.archunit.lang.ArchRule entitiesShouldBeDeclaredForUseInSameAggregate()
ArchRule that verifies that fields that implement Entity within a type implementing
AggregateRoot declare 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
}
public static com.tngtech.archunit.lang.ArchRule aggregateReferencesShouldBeViaIdOrAssociation()
ArchRule that ensures that one AggregateRoot does not reference another via the remote
AggregateRoot type but rather via their identifier type or an explicit Association type.
class Customer implements AggregateRoot { … }
class Order implements AggregateRoot {
Customer customer; // invalid
CustomerId customerId; // valid
Association customer; // valid
}
Copyright © 2021. All rights reserved.