Somewhere between API resources, queue workers, repositories, clients and serializers there is a class of … classes/modules that does the needful. Gun-to-my-head, I would call them “services” but I’m looking for a less overloaded term. Maybe capabilities? Controllers? Pick a term from the business domain? What do you call them?

  • @RonSijm
    link
    1
    edit-2
    26 days ago

    I’m not completely sure which classes you’re talking about - but it sounds like the Business Process Layer

    I would call them “services” but I’m looking for a less overloaded term. Maybe capabilities? Controllers?

    “Controllers” (in dotnet at least) is usually reserved for the class that initially intakes the http request after middleware (auth, modelbinding etc)

    It’s probably easier with a concrete example, so lets say the action is “Create User”

    It depends on the rest of your architecture, but I usually start with a UserController - that takes all user related requests.

    To make sure the Controller doesn’t get super big with logic, it sends it though mediatr to a CreateUserCommandHandler

    But it’s a big vague which parts you’re asking about…

    “there is a class of … classes/modules that does the needful.”.

    Everything else you’ve described

    “API resources, queue workers, repositories, clients” and serializers

    Is “cross-cutting”, “Data Access Layer”, and “Service Agent Layer” maybe a bit “Anti-corruption Layer” - but there’s a lot of other things in between that “do the needful”