Protocols

Protocols define interfaces.

Python Protocols are key to how Julee interfaces with infrastructure.

Repositories and Services are both defined as Python Protocols. We use modern python typing to ensure infrastructure components (actual repository and service implementations) implement those interfaces, and this is relied upon by use cases and leveraged by dependency injection. This is why applications don’t need to think about it, they just run the use cases.

The service and repository interfaces are typed such that they only deal in Entities and simple primitives.