douzhangli9563 2016-07-27 14:23
浏览 49

php | ddd - 如何对此进行建模?

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.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 有偿求跨组件数据流路径图
    • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
    • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
    • ¥15 CSAPPattacklab
    • ¥15 一直显示正在等待HID—ISP
    • ¥15 Python turtle 画图
    • ¥15 关于大棚监测的pcb板设计
    • ¥15 stm32开发clion时遇到的编译问题
    • ¥15 lna设计 源简并电感型共源放大器
    • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)