I am actually creating a web editor using DDD for the first time. The editor can allow users to drag and drop blocks on a page, and start editing them.
Each block is a subclass of a DependentContent
class, that handles the serialization and deserialization of itself, so it can be stored and retrieved later.
I am now facing the first real use case, that is "A user creates a DependentContent on a page". The UI must act like this:
1) Drag the DependentContent from the list, onto the page 2) Ajax request => fetch the form for the user to fill. The form is different for each subclass of DependentContent 3) Submit the form, validate data, return the DependentContent's subclass instance 4) Display the result in the editor (simple UI, I can handle this)
Except the 4th step, I am completely lost doing this. If I wasn't using DDD I would do it plain Symfony style, with a Chain service that would keep a list of all the DependentContent subclasses, and give back the right FormInterface. But with DDD, I feel the urge of not talking about Symfony in my Domain code, and it makes the process way to complex for me to handle it.
Any help is greatly appreciated.