while playing around with the new object model of php 5 i discovered the
mighty reflection api. to explore its complete power i decided to write
a simple XMI generator (XMI is used by most UML tools for im/exporting diagrams).
i must admit i am impressed : i took me only 3-4 hours to get the
export stuff working. at the moment it only exports classes and interfaces but it is imho a very handy tool for getting an uml view on projects (see attachment). anyone interested in completing such a tool?
Interesting, very interesting. I don’t know about completing it, but I would defenently like to see the code. This could be a good tool to get a quick overview of a class library. Played with a similar tool last year on a large app in C# and it was defenently a good help.
Brilliant! I was just viewing WACT’s documentation and even saw a request for someone to transform the current model into UML, and thought if it could be done automated.
Brilliant! Took the words …err… diagram right out of my mind. Are you going to try and start a project for an automated XMI/UML tool?
just cleaned some things up and zipped all files.
you will need php5 and mysql4 to run the scripts and
poseidonCE or any other xmi 2.0 capable editor to import
the xmi and create diagrams from it.
edit parse_source.php and generate_xmi.php for database settings.
parse_source : will persist all classes to mysql with REPLACE
generate_xmi : transforms persisted data into xmi v2.0 files : xmi.xmi and xmi.xml
Sike
ps. i am not shure if this really is xmi2 but poseidon claimed it (;
Played with it, had to fix the class names for the reflection classes though: ReflectionClass instead of Reflection_Class ( latest CVS ), other than that it worked like a charm.
Attatched is a quick test with some of the cowiki classes through poseidon.
I decided to get ambitious as do something like say WACT. I used one of the example called BLOCK.php with the program sike has so generously offered and then used posiden to depict the image. You wact guys might get happy about this picture.
It shows a compile in progress, so HTMLSax’s classes are also loaded and diagrammed. This is goiing to be tool of the year. Awesome!
PS: The Zip is a posiden CLASS UML file of the whole scenario… So you only need posiden to view it - if you don;t have php5 and the program set up! Check it out.
while working with the uml view on my project i realized that
using packages would improve readability so i implemented it (:
this will work only if you use DocBlocks with @package tags.
same for variable types (@param).
then use that function to print the message depending on where you are executing the file. ( I’ll implement this later tonight when I get off work if you don’t want to do it )