-
Notifications
You must be signed in to change notification settings - Fork 907
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
isClosed() considered to be true invariant or not? #55
Comments
No. Read my red book. |
The thing is that I've read it, but could't grasp the point |
First, consider the practicality of composing potentially hundreds, thousands, or even millions of discussions under one parent forum. Bad idea. The same goes for posts within a discussion. You are thinking too technically, as if forum owners constantly toggle forums closed, open, closed, open, ... When a forum is closed, it's closed and rarely reopened. Eventual consistency handles the rest. But what if a new discussion is started just before it's parent forum is closed? True answer: Who cares? It's not as if an insane dictator presses The Red Button (tm). |
Vaughn, thank you for the reply. And just for a silly case if that was indeed important to start a discussion only on open forum. I mean there are no multiple states on forum and discussion which need to be consistent for "a discussion is only allowed to be started on open forum" business rule. |
If I understand your question, yes I think it would be an invariant because a modified To other readers, this answer is based on a hypothetical question and does not influence on modeling a new aggregate boundary. In other words, the preexisting business rules and consistency constraints have not changed. |
That's much clear now. |
… On Mon, 3 Jun 2024 at 00:16, IAlkhasov ***@***.***> wrote:
That's much clear now.
Thanks, Vaughn!
—
Reply to this email directly, view it on GitHub
<#55 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABWB552HCW2LKFUKOD7ET6TZFORURAVCNFSM6AAAAABISTGATKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBUGA2TGNBTGE>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
IDDD_Samples/iddd_collaboration/src/main/java/com/saasovation/collaboration/domain/model/forum/Forum.java
Line 159 in 9b27b11
Hi Vaughn.
A discussion can not be started on closed forum.
Isn't it the "true invariant" and then mustn't Discussion be a part of Forum aggregate?
And if it's really not, can you please clarify?
Thanks a lot.
The text was updated successfully, but these errors were encountered: