Code structure
Armed with the framework provided by getting to know our users, we are ready to think about implementation and code structure.
Given we are making a standalone service, we are going to need a main() function. After that, the next thing I always add is an internal folder directly under main(). This adds a clean boundary between the code for this service and any code in the same repository.
When you are publishing a package or SDK for others to use, this is an easy way to ensure your internal implementation packages do not leak into the public API. If your team happens to use a mono-repo or multiple services in one repository, then it's a great way to ensure that you do not have package name collisions with other teams.
The ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access