in a diff class lib project?
A lib project won't load these assemblies but instead will get used by them. But yeah, I have split solutions into projects corresponding to various layers, then dividing each per feature, so yes.
i was talking about loading them onto the main project as well, i am bit into analysis paralysis lol
O yes, the main project ends up being the glue one for me where all the DI setup occurs. So, if a solution is named Xyz, I'll have projects in it named: Xyz (main project) Xyz.Domain Xyz.Api Xyz.Infra.Data Xyz.Infra.Web Domain is business rules. Api is application layer to orchestrate domain objects and initialise them and store them via data interfaces (also defined in domain project). Infra.Data containing all data layer implementation details. Infra.Web containing HTTP or other protocol from where requests come, get validated in the controller, and then passed to the Api handler for subsequent verification and processing. Xyz project is the ASP.NET Core application meanwhile rest are class libraries. All have the same root namespace too: Xyz.
If some third party services are to be called, they'd be in another project named Xyz.Infra accordingly.
All business specific logging happening in Api project. For this, feature specific logs are sprinkled per feature. All HTTP/gRPC level metrics recorded in Infra.Web project. For this, middleware approach is workable.
so you offload controllers to infra web?
interesting take , thanks for the info will look into it
Yeah. A Route class to handle the particular endpoint and read the "Request" record to pass on to the Controller for the feature which then prepares the Command/Query after validating the Request at a superficial level and passes it onto the API Handler which initialises the domain entities for the feature by fetching them from the data layer via the data interfaces present in the domain project (along with those entities) and those entities return some event value based on the feature which is then pattern matched to create a specific API Result which is a relevant DTO that then gets returned to the Controller which then writes it to the network stream accordingly.
Обсуждают сегодня