UML representation of PHP trait

前端 未结 3 2092
灰色年华
灰色年华 2021-01-02 17:52

I\'m creating projects with Symfony2/Doctrine and try to implement traits. So far no problem on small tryouts, but I usually do UML class and sequence diagrams before deep i

3条回答
  •  失恋的感觉
    2021-01-02 18:04

    As I see it a PHP trait is nothing else than a protocol definition you find in other languages. The protocol is some functional extension to the class. You would usually model that with an interface (the Trait) and the class using it where you draw a <> relation from the class to the Trait.

提交回复
热议问题