james-s-tayler / sandbank

.NET Core 3.1 + Vue.js banking app
MIT License
3 stars 0 forks source link

Refactor To Domain Logic to UseCases #64

Open james-s-tayler opened 4 years ago

james-s-tayler commented 4 years ago

The current N-Tier style architecture which references EFCore entities directly in the controllers was a quick and dirty first pass to make the system work.

I want to undertake a refactor that accomplishes two things...

1) refactor controllers / services away from N-Tier style architecture which composes horizontal slices of the domain and towards DDD style 'UseCase' where each operation represents an entire vertical slice of the domain.

2) Apply CQRS at a logical level where each 'UseCase' is either a Command (which modifies state) or a Query (which reads state). All commands from an entity should live in one place and all queries for an entity should in another place. Commands vs Queries should receive separate treatment with respect to logging / caching etc.