Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
360 views
in Technique[技术] by (71.8m points)

php - Is it possible to visualize a bunch of functions in UML

I'm improving a content management system which uses classes as well as function files (just php files which contain various functions).

E.g. I have a class called Admin and a function file which has functions for displaying an overview of the admins, create a new admin, edit an existing admin, delete an admin ...

The function files use the classes and do the visualization part of the mvc concept whereas the classes are responsible for the controller part. The model part is done by a mysql database.

I know that there a class diagrams in UML. Is there a way to extend this diagrams with the loose functions from the function files so that the documentation is complete?

I'm using Visual Paradigm Community.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

There is no UML element for representing independent functions.

You may however consider a free standing function as a special form of object in its own class. In fact, in some designs, “functor” objects are even designed to be used in place of a functions.

To avoid possible confusion, you may extend the class diagram with your own profile that would define a stereotype ?function?. Stereotypes are supported by any serious UML modeling tools (here for visual paradigm).

The multiplication of such micro-classes might not necessarily make your documentation easier to understand. You may therefore consider to regroup closely related functions in the same “box” (stereotype ?function group? or ?module? ?). Your narrative suggests for example that you have a group of functions which implement in reality a repository (from the list you gave: adding, changing, deleting, searching the same kind of persistent objects) or a view (from your explanation about visualization): the grouping would then in any case facilitate to understand their close relationship.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...