开发者

PHP4 and UML: does it make sense to design an object diagram?

开发者 https://www.devze.com 2023-01-26 15:19 出处:网络
I am documenting a PHP4 system I\'m building for a client. The system will be written following an object开发者_如何学Go-oriented logic, using the MVC pattern. I have already sketched up a class diagr

I am documenting a PHP4 system I'm building for a client. The system will be written following an object开发者_如何学Go-oriented logic, using the MVC pattern. I have already sketched up a class diagram; however, I am now wondering if it makes sense to create object diagrams for such a system, since it follows the OOP model rather loosely.

The closest thing to object-oriented behavior in this system will probably be a handful of methods changing their behavior based on how they're being called, although this can't exactly be called instancing straight-up classes; would an object diagram capture anything useful from this scenario, or am I better off just skipping them altogether? Thanks in advance.


In my experience, UML Class diagrams are best used in an isolated context -- to describe a section of the system.

So my answer is that if you are describing a piece of your system in a document, and a UML class diagram would help a reader understand the relevant section of the system then you should do a diagram for that section and include it.

Doing one class diagram for the entire system is rarely, if ever, useful. And including various class diagrams without context is also rarely useful.

Be strategic in your use of UML; it's a communication tool, not a documentation tool. (Sort of like writing. Words on paper means nothing unless used and organized thoughtfully)


I think the flexibility of your situation conflicts with expectations of UML.

I would suggest abstracting the implementation level from your diagram (and lie) and represent the functionality of those methods as independent methods performing their own work.

0

精彩评论

暂无评论...
验证码 换一张
取 消