Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relaxed checking of synthetic fields in valueObjectsMustNotReferToIdentifiables #154

Open
cgoIT opened this issue Feb 7, 2025 · 0 comments

Comments

@cgoIT
Copy link

cgoIT commented Feb 7, 2025

TBH I'm not quite sure if this change is not against DDD rules, but I have the following problem. Given the following class...

@RequiredArgsConstructor
@Getter
public class MyAggregateRoot implements AggregateRoot<MyAggregateRoot, UUID> {

   @Identity
   private final UUID id;
   private MyInnerClass myInnerClass;

   @RequiredArgsConstructor
   @Getter
   public class MyInnerClass implements ValueObject {
      private final String param; 
   }
}

Having this class and checking it with org.jmolecules.archunit.JMoleculesDddRules#valueObjectsMustNotReferToIdentifiables leads to the violation that MyInnerClass.this$0 refers to an Identifiable. This - of course - is correct in the first place. But I'm asking myself if it would be ok in this case to ignore the synthetic field to the outer class (MyInnerClass.this$0) from this check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant