What's required of an automatic UML Class Diagrams tool to be useful?

조회 수: 3 (최근 30일)
per isakson
per isakson 2016년 10월 25일
편집: per isakson 2017년 8월 11일
Updated version of m2uml on File Exchange:&nbsp m2uml 1.1 - Hyper-links and tool-tips
I think, this version is more useful than the previous one. It's more of a tool to support design and implementation of software.
New features of the class diagram:
  • The class diagram can now be displayed in the web browser of Matlab - preferably on a second monitor.
  • The names of classes and methods are hyper-linked to appropriate lines in the m-file.
  • Hovering over the names of classes and methods shows the appropriate H1-line in a tool-tip.
  • The class box has an extra compartment with hyper-links and tool-tips of FIXME and TODO annotations in the code.
Does Class Diagrams have a role in the development of Matlab programs? I like to hear about experiences (good and bad) of using UML diagrams.
&nbsp
Original post, 2016-10-25
This question is about UML class diagrams to support construction of larger and more complex applications. And it is based on my own experience from efforts to develop such applications with Matlab. To support this question I've uploaded m2uml to the File Exchange. m2uml is an automatic tool to generate UML Class Diagrams. The code is very much as-was four years ago. I use Matlab Answers because it provides a much better support for discussion than does File Exchange.
IMO: Design becomes more important with larger and more complex applications. The design evolves throughout the construction phase. Some carefully selected UML-diagrams would help direct more attention to the design.
Since some years, Matlab has the capabilities needed to develop larger and more complex a applications. New object-oriented programming capabilities, MCOS, appeared in R2008a. Every(?) release since has added to MCOS. A unit testing framework appeared in R2007a and has evolved significantly since.
What's required of m2uml? Most importantly, it should be easy to
  • keep the diagrams in sync with the code
  • select the classes to be displayed; the diagram shall provide overview rather than detail
  • show all dependencies between the classes
  • read and interpret the diagrams
However, more user-value is needed to make the class diagrams living documents.
youemel by Nicholas demonstrates that it is possible to
  • display the diagram as a svg-file in the Matlab Web Browser
  • attach hyperlinks, e.g. &nbsp<matlab:matlab.desktop.editor.openAndGoToFunction(...)>, and tooltips to the names of classes and methods
I have no experience with UML features in other IDEs; I just watched a few video presentations at Youtube.
&nbsp
QUESTIONS:
  • What's required of m2uml to become a useful addition to the Matlab IDE?
With your help I hope to make this a living document over the next couple of weeks.
  댓글 수: 1
per isakson
per isakson 2017년 8월 11일
편집: per isakson 2017년 8월 11일
Update of get_H1_line.m
Andrew Joslin wrote in a comment 9 Aug 2017 to m2uml
I might have found a bug in get_H1_line.m that you might want to know
about (user error is possible). For me, it throws an error when the
method in the "fnc_name" variable is inherited from a superclass. In
this instance, the 2 cases defined in the code ("1. Implicit contructor
of class", and "2. Inherited from superclass") don't seem to cover the
3rd case where the method is inherited from the superclass. For me, it
throws an error when the method in the "fnc_name" variable is inherited
from a superclass.
Here is an updated version of get_H1_line.m, which returns an appropriate string when the method is defined in a superclass.

댓글을 달려면 로그인하십시오.

답변 (1개)

Edoardo Patelli
Edoardo Patelli 2017년 6월 21일
편집: Edoardo Patelli 2017년 6월 21일
Thanks for providing this nice package. Very useful. You should replace the hardcoded regularexpression to be able to deal with non-windows filesystem.
For instance in filespec2fqn you are looking for \@ while in the unix file system is /@
You should replace
cal = regexp( filespec, '\\\+', 'split', 'once' );
with
if isunix
ca1 = regexp(filespec, [filesep '\+'], 'split', 'once' )
else
ca1 = regexp( filespec, '\\\+', 'split', 'once' );
end
and
ca2 = regexp( p1, '\\@', 'split', 'once' );
with
ca2 = regexp( p1, [filesep '\@'], 'split', 'once' );

카테고리

Help CenterFile Exchange에서 Class Introspection and Metadata에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by