-
Notifications
You must be signed in to change notification settings - Fork 3
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
Document best practices, conventions and common usage problems. #135
Comments
@danilvpetrov @koden-km I could really use some help with this one. Even if it's just remembering things we have discussed/decided, or making sure to update this issue if we settle on any of the best practices in the future. I'm sure there's a lot to extract from those recent cwx PRs for those new domains. |
are we including test conventions too, even framework-specific (i.e. |
Another one i can think of (which is IMHO quite critical) is to change aggregate root state ONLY in |
I would be happy to include We could definitely do that in a cwx guide, but IMO that is really part of just using Ginkgo/BDD style properly. |
This one isn't a "best practice", it's absolutely mandatory, and is documented as such in the API documentation. That said, maybe we could have a FAQ / common problems document too. |
Ok, one of best practice item could be to allocate basic idempotency checks and producing an event into seperate methods in aggregate roots. That would make |
I've updated the issue title and initial comment to include a "FAQ" section as well. |
It might also be worth familiarising yourselves with the issues I've created under https://github.com/dogmatiq/dogmavet/issues. There's probably a lot of crossover. We could definitely have There's potentially some issues there that are out of date with the recent spec changes too. |
May be it's worth even mentioning, that
|
This might belong in a "style guide" section, perhaps? |
May be it's worth mentioning space-separation of the field declarations in This might belong to the style guide as well. |
I think this one is getting too prescriptive and specific, especially considering that |
Regardless of test framework, we should separate our test files by the domain action being tested and name them using the action, e.g.: |
Isn't this just normal Go? |
Hmm, IMHO normal Go would call the test file the same as the file being tested, e.g: |
TBH, I feel like that's a convention we carried over from PHP more than anything. I suppose we still do that often, but I have plenty of packages with tests organised differently to that. Either way, I |
We're starting to get quite a collection of Dogma conventions that we've discussed in person, on slack or on PRs. We should document those for others to see.
Best Practices
Here's some things to get us started that I think are definitely becoming our "best practices":
app/handler keys should be UUIDsthis is now a hard requirementStyle Guide / Conventions
And some additional things that we've adopted as conventions, but I'm not sure yet whether they're really a "best practice" or just a convention we've adopted somewhat arbitrarily. Either way we might want to make them part of a style guide.
ed)
Usage Problems / Gotchas / FAQ
Edit Adding a third section for things that aren't really optional, but still catch you out. Possible for a FAQ / gotchyas type document:
ApplyEvent()
Document best practices, conventions and common usage problems. #135 (comment)I'm sure there are more, LMK if you can think of any.
The text was updated successfully, but these errors were encountered: