是否可以在UML中可视化一堆函数 [英] Is it possible to visualize a bunch of functions in UML

查看:52
本文介绍了是否可以在UML中可视化一堆函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在改进一个使用类以及功能文件(只是包含各种功能的php文件)的内容管理系统.

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

例如我有一个名为 Admin 的类和一个功能文件,该文件具有用于显示管理员概述,创建新管理员,编辑现有管理员,删除管理员的功能...

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 ...

功能文件使用这些类并执行mvc概念的可视化部分,而这些类负责控制器部分.模型部分由mysql数据库完成.

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.

我知道在UML中有一个类图.有没有一种方法可以使用功能文件中的松散功能来扩展此图,从而使文档完整?

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?

我正在使用Visual Paradigm社区.

I'm using Visual Paradigm Community.

推荐答案

没有用于表示独立功能的UML元素.

There is no UML element for representing independent functions.

但是,您可以将独立式函数视为其自身类中对象的一种特殊形式.实际上,在某些设计中,甚至将"functor"对象设计为代替功能使用.

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.

为避免可能造成的混乱,您可以使用自己的概要文件定型 «功能»的a>.任何严格的UML建模工具都支持原型,此处为视觉范式).

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.

这篇关于是否可以在UML中可视化一堆函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆