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

2 views (last 30 days)
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 Comment
per isakson
per isakson on 11 Aug 2017
Edited: per isakson on 11 Aug 2017
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.

Sign in to comment.

Answers (1)

Edoardo Patelli
Edoardo Patelli on 21 Jun 2017
Edited: Edoardo Patelli on 21 Jun 2017
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' );

Categories

Find more on Software Development Tools in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!