Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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

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

1 Answer

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...