reverse-engineering

UML & PHP

Thie content or the technology discussed here is EXPERIMENTAL only

A Webel zone dedicated to attempts to interpret PHP as UML™.

The image below shows an attempt to represent a simple PHP system (some scripts developed by Webel for client for bulk migration and administration of Drupal™ SimpleNews subscription data) in UML™ by importing the XMI file generated by the PHP_UML tool into the MagicDraw™ UML tool.

Unfortunately - because PHP does not enforce typed Properties - it can very difficult to manage/reverse the Relationships between Classes ! PHP_UML uses an introduced DataType 'mixed' as a catch-all for any TypeAssociations. Instead Dependencies and Usages have been used.

Angry The process shown requires so much intervention that the (possibly enormous) benefits of obtaining an associative UML™ representation are largely undermined !

Note also that Visual Paradigm and Enterprise Architect both claim to reverse-engineer PHP to UML, and Enterprise Architect claims to be able to also generate PHP from class diagrams, and supports a degree of synchronised engineering. However if you look closely at the EA examples you'll see that in fact there is a contrived "links to / links from" system used to represent Relationships between Classes, instead of consistent Associations with Property ends !

PHP5 introduced type-hinting of object parameters to functions (and since PHP 5.1 also for array parameters), however this does not help reverse engineering to UML much, since the PHP class variables (if considered the equivalent of Properties) are not typed, and likewise function return values are not typed (so one can't interpret accessor/mutator methods as typed property methods).

Cool I suggest that PHP could be be improved by the introduction of optional type-hinting for variables of classes, either using explicit type notation, or by using @type annotations in comments, which could be interpreted by UML reversing engines for PHP.

However, none of this helps much if one wishes to reverse engineer very loosely typed legacy PHP systems with copious use of mixed types like Drupal™ !

UML reverse-engineering: code with the UML and your underlying model in mind

Dr Darren says:

It is a common misconception that the Unified Modeling Language™ (UML™) for software engineering is all about forward-engineering, and fancy Model Driven Architecture (MDA). In fact, UML™ is enormously useful for understanding existing object-oriented systems, and for refactoring them, through iterative reverse-engineering. This is especially true for software engineering in science and industry, and it is a major theme of the Webel UML™ tutorials and seminars.

These model-aware coding practices will prepare you for the impending revolution in model-driven development with executable UML tools, and will help to unify your modelling and implementation practices.

Service: UML Parsing Analysis of technical documents and digital texts into graphical UML models

Webel - the home of Dr Darren's UML™ Parsing Analysis recipe - is delighted to offer a unique service, the translation of digital texts into UML models capturing requirements, systems analysis, systems architecture, and designs as graphical Unified Modeling Language™ (UML™) models.

What comes in ?

Technical documents from your domain, preferrably as digital text, however the conversion of older documents such as printed materials and scans into digital text is also offered as part of the service.

Candidate source text documents include:

What comes out ?

Professional UML™ Parsing Analysis models and diagrams corresponding to every sentence of the source document, together with overview diagrams generated from the union of those diagrams, including Package and Model overview diagrams, Use Case diagrams, systems and architecture diagrams, and professional reports.

In the case where the domain involves scientific or engineering topics with flows, port-based engineering diagrams employing Systems Modeling Language™ (SysML™) can be provided to supplement traditional software engineering diagrams.

Does it run ?

Where there is appropriate correspondence between the domain and software engineering elements, the analysis layer can be related to a design layer of reverse-engineered Java components from existing APIs, or forward engineered to the Eclipse Modeling Framework (EMF).

Drancing_java3d.uml

Drancing_java3d.uml

The Java3D elements of the DranceWare Java visuals inherits common GUI-independent base and intermediate Java Swing elements.

DranceWare: Java3D: UML: accelerometer interaction demo

DranceWare: Java3D: UML: accelerometer interaction demo

The DranceWare Java3D base is extended to implement a simple demonstration of virtual interaction between the Drancing sensor suit with 5 triaxial accelerometers and Java3D colour cubes.

Syndicate content
randomness