Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get graphical UML class diagrams in Eclipse PDT?

I am an Eclipse-PDT user, who wants to have some graphical aids in OOP Class designing and refactoring process.

My IDE: Eclipse Mars.1 Release (4.5.1)

I have used Eclipse for Java Developing, and know there are plenty of tools which can help. The Eclipse PHP Developing Tools are still behind in the integration and support.

There are some tools written in php like phpuml, which help with the generation of xmi (v2.1). Currently phpuml (v1.6.2) does not generate a valid xmi because of outdated xmlns urls:

<?xml version="1.0" encoding="iso-8859-1"?>
<xmi:XMI xmi:version="2.1" 
        xmlns:uml="http://schema.omg.org/spec/UML/2.1.2"
        xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"
        xmlns:php="http://schemas/phpdoc/56af3cdf127e68.04124969">

These URLs cause Exceptions by trying opening in Eclipse Ecore Model Editor View:

org.eclipse.emf.ecore.xmi.PackageNotFoundException: 
Package with uri 'http://schema.omg.org/spec/XMI/2.1' not found

org.eclipse.emf.ecore.xmi.ClassNotFoundException: 
Class 'Documentation' is not found or is abstract.

Did someone know how i can fix this?

But generally I find such external tools as just temporary workarounds until something "integrated" is available.

A better approach could be direct implementation and generation in run-time. So the synchronization issue could be skipped by:

  1. Using eclipse internal parsing and analyzing of php classes. The information displayed in the Outline-View-Panel is basically the single class diagram. There could be a few steps from full class diagram:
  2. Just follow the inheritance tree upwards
  3. Display a folder or selected resources in a graphical class diagram overview.

This is at least the theory.

The Questions:

  • Am i thinking in the right direction?
  • Is there already something similar, which works language-independent, based on eclipse parsing?
  • How to get graphical UML class diagrams in Eclipse PDT?
like image 926
code_angel Avatar asked Feb 01 '16 12:02

code_angel


People also ask

Can Eclipse generate UML diagrams?

You can create UML project for any of your Java project in Eclipse.

How do I view UML in eclipse?

Opening a UML Project In Eclipse, select the Java project where you want to open its UML project. Right click on the project and select Open Visual Paradigm from the popup menu.

How do I display a UML diagram?

View UML class diagramIn the Project tool window, right-click an item for which you want to create a diagram and select Diagrams | Show Diagram Ctrl+Alt+Shift+U ). In the list that opens, select Python Class Diagram. PyCharm generates a UML diagram for classes and their dependencies.

How do you view class diagrams?

In Solution Explorer or Class View, right-click the project and choose View, then choose View Class Diagram.


1 Answers

Not an eclipse-related suggestion, but you can try out the IntelliJ IDEA-based Phpstorm.

It supports the generation of class diagrams from PHP code and also supports refactoring from within the class diagram, as well as "jump to code" from within the diagrams.

Source: https://confluence.jetbrains.com/display/PhpStorm/Working+with+UML+class+diagrams

While the IDE isn't free, you can download a 30-day trial to see if it can solve this problem of yours: https://www.jetbrains.com/phpstorm/

like image 99
Zanval Avatar answered Sep 22 '22 16:09

Zanval