Skip to content

In the Onion Architecture/Port Adapter Architecture, it is not necessary to mandate the use of domain services. #1573

Description

@diktamxx

test:

rule
    .domainModels("..domain..")
    // .domainServices("..domain..")
    .applicationServices("..application..")
    .adapter("persistence", "..infrastructure.persistence..")
    .adapter("graphql", "..infrastructure.graphql..")

error:

Caused by: java.lang.AssertionError: Architecture Violation [Priority: MEDIUM] - Rule 'Onion architecture consisting of
domain models ('..domain..')
application services ('..application..')
adapter 'persistence' ('..infrastructure.persistence..')
adapter 'graphql' ('..infrastructure.graphql..')' was violated (1 times):
Layer 'domain service' is empty
	at com.tngtech.archunit.lang.ArchRule$Assertions.assertNoViolation(ArchRule.java:94)
	at com.tngtech.archunit.lang.ArchRule$Assertions.check(ArchRule.java:86)
	at com.tngtech.archunit.library.Architectures$LayeredArchitecture.check(Architectures.java:347)
	at com.tngtech.archunit.library.Architectures$OnionArchitecture.check(Architectures.java:1039)
	... 1 more

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions