I'd say use domain events. Your user model could fire a UserRegistered event and have a CreateUserProfileImage fired from a listener. Or, maybe create some kind of command chain.
Commands Relying on Other Commands/Transactional Command Logic
So I'm wondering how one would handle commands that rely on other commands. For example say you have a user registering with uploading a profile image. For the sake of this argument let's assume the profile image needs some customization done to it like optimization, creating a few versions, and then uploading it to an S3 Bucket - to me this would represent a command on it's own - but this needs to occur before the User is actually created with the database so we have the S3 path to store. It seems like the 2 options are to call the CreateUserProfileImage command within the CreateUserCommand which feels off since commands are suppose to have 1 responsibility, or call both commands in the controller. I'm not opposed to the later but I feel like the result would be a large try/catch block to catch each commands errors. Not terrible but wondering if there is a better way to handle situations like this, where there is a lot going on in 1 command and it seems like it should be broken out but the different pieces rely on each to work. Basically a large group of transactional procedural code. Can clarify if that does not make sense.
Please or to participate in this conversation.