3 ms·
I’ll second the point about explicit types at module boundaries and add: - Ideally they should either not be derived types (using eg type parameters), or if th
by eyelidlessness 6y ago
I’ll second the point about explicit types at module boundaries and add:
- Ideally they should either not be derived types (using eg type parameters), or if they are they should be derived using types from the same layer of your project/service. This makes it much more likely you’ll notice if you introduce breaking changes.
- Types should also between network boundary layers and business logic, regardless of your module structure. This ensures your business logic’s interface is clear regardless of how it’s consumed, making it more easily testable and more portable (eg to other transport formats/protocols).