ddd-forum icon indicating copy to clipboard operation
ddd-forum copied to clipboard

Automate toolkit

Open jezzsantos opened this issue 2 years ago • 2 comments

Added a first version of an automate toolkit to create new sub-domains, and usecases.

Please see the included README.md (in this PR) for how it was designed and built.

jezzsantos avatar Jun 13 '22 09:06 jezzsantos

The README.md tells the story of how the toolkit was built.

However, if you just want to see it working, then do this:

  1. Install automate: dotnet tool install --global automate --version 0.2.3-preview

Now run the existing toolkit.

  1. Make sure you are in the ddd-forum folder
  2. To create the new (pre-configured) sub-domain, inappropriately named: 'aDomain' with an aggregate called 'AnAggregate', with two use-cases, one for 'CreateAnAggregate' and another for 'GetAnAggregate', runt his command: automate execute command "Go"

If you want to change the names of the subdomain, aggregate and usecases, then you will need to edit the existing draft definition.

You can view the current draft configuration automate view draft

You can edit the values of things in this draft, for example:

automate configure on "{SubDomain}" --and-set "Name=AnotherSubDomain"
automate configure on "{SubDomain.Resource.N79CgPEB}" --and-set "Name=AnotherAggregate" --and-set "Kind=aggregate"
automate configure on "{SubDomain.Resource.N79CgPEB.UseCase.rUFr3GmX}" --and-set "Name=AnotherActionName" --and-set "Route=/anotherroute" --and-set "Kind=command"

OR you can build your own new draft, for another SubDomain, Aggregates/Entitites and UseCases of your own:

automate run toolkit "SubDomain" --name "sample2"
automate configure on "{SubDomain}" --and-set "Name=Plantation"
automate configure add-one-to "{SubDomain.Resource}" --and-set "Name=Bananas" --and-set "Kind=aggregate"
automate configure add-one-to "{SubDomain.Resource.<RESOURCEID>.UseCase}" --and-set "Name=Create" --and-set "Kind=command" --and-set "Route=/"

jezzsantos avatar Jun 13 '22 10:06 jezzsantos

There are a few design details left to discuss, before this might be done, that might need to be improved. Let's do that over in https://discord.gg/vpc3gDPR

jezzsantos avatar Jun 13 '22 20:06 jezzsantos