cvs: peardoc /en/package/php/php-uml conversion-rules.xml intro.xml

From: Date: Sat, 14 Jun 2008 15:40:25 +0000
Subject: cvs: peardoc /en/package/php/php-uml conversion-rules.xml intro.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-10874@lists.php.net to get a copy of this message
baptiste750 Sat Jun 14 15:40:25 2008 UTC Added files: /peardoc/en/package/php/php-uml conversion-rules.xml intro.xml Log: Initial publish http://cvs.php.net/viewvc.cgi/peardoc/en/package/php/php-uml/conversion-rules.xml?view=markup&rev=1.1 Index: peardoc/en/package/php/php-uml/conversion-rules.xml +++ peardoc/en/package/php/php-uml/conversion-rules.xml <?xml version="1.0" encoding="ISO-8859-1" ?> <!-- $Revision: 1.1 $ --> <refentry id="package.php.php-uml.conversion-rules"> <refnamediv> <refname>Conversion rules</refname> <refpurpose>How do PHP elements map to UML?</refpurpose> </refnamediv> <refsect1> <title>Logical view</title> <para> <itemizedlist> <listitem> <simpara> A PHP class (or interface) maps to an UML Class (or Interface). </simpara> <simpara> A PHP function maps to an UML Operation. </simpara> <simpara> A PHP property, or class constant, maps to an UML Attribute. </simpara> </listitem> </itemizedlist> </para> <para> Packages do not exist in PHP, like they do in Java. There are two possible ways to mimic them: <itemizedlist> <listitem> <simpara> by using the docblock <literal>@package</literal> in the comment of a class (or of a file) </simpara> <simpara> by interpreting the namespace of a class </simpara> </listitem> </itemizedlist> In the latter case, <classname>PHP_UML</classname> understands the double-colon <literal>::</literal> as the package delimiter. This works in conjunction with the PHP namespacing instructions (<literal>namespace</literal> and <literal>use</literal>). </para> </refsect1> <refsect1> <title>Deployment view</title> <para> <itemizedlist> <listitem> <simpara> A PHP file maps to an UML Artifact. </simpara> <simpara> A physical folder maps to an UML Package. </simpara> </listitem> </itemizedlist> </para> </refsect1> <refsect1> <title>Component view</title> <para> In UML 1.4: <itemizedlist> <listitem> <simpara> A PHP file maps to an UML Component. </simpara> <simpara> A physical folder maps to an UML Subpackage. </simpara> </listitem> </itemizedlist> </para> <para> In UML 2.1: <itemizedlist> <listitem> <simpara> A PHP file maps to an UML Component. </simpara> <simpara> A physical folder maps to a nesting UML Component. </simpara> </listitem> </itemizedlist> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/peardoc/en/package/php/php-uml/intro.xml?view=markup&rev=1.1 Index: peardoc/en/package/php/php-uml/intro.xml +++ peardoc/en/package/php/php-uml/intro.xml <?xml version="1.0" encoding="ISO-8859-1" ?> <!-- $Revision: 1.1 $ --> <refentry id="package.php.php-uml.intro"> <refnamediv> <refname>Introduction</refname> <refpurpose>Purpose and simple usage example</refpurpose> </refnamediv> <refsect1> <title>Description</title> <para> <classname>PHP_UML</classname> is a reverse-engineering tool, and a documentation tool. </para> <para> It parses PHP files and directories, and generates an XMI file corresponding to the parsed code. </para> <para> XMI is an <ulink url="http://www.omg.org/">OMG</ulink> standard for exchanging metadata information via XML, and is commonly used as an interchange format for UML models. Many UML softwares support importing and exporting of XMI files. </para> </refsect1> <refsect1> <title>Features</title> <para> Like <link linkend="package.php.phpdocumentor">PhpDocumentor</link>, <classname>PHP_UML</classname> can parse the following PHP elements: classes, interfaces, properties, and functions. It can also retrieve information from the inline comments, via the docblocks: <literal>@package</literal>, <literal>@var</literal>, <literal>@param</literal> <itemizedlist> <listitem> <simpara> <literal>@param</literal> and <literal>@var</literal> learn PHP_UML about the expected types of a parameter or a property. </simpara> <simpara> <literal>@package</literal> learns PHP_UML about the nesting package of an element. </simpara> </listitem> </itemizedlist> </para> <para> So the more documented your PHP code is, the more precise your XMI file will be. </para> <para> At the current time, the UML/XMI standard exist in two different versions, 1.4 and 2.1. PHP_UML can generate XMI in both versions. Be warned, though, that some UML tools might not render well this or that aspect of your XMI file. For example, the link between an UML artifact (i.e. a source file) and the logical elements defined in the artifact is only available in version 2 of UML. </para> </refsect1> <refsect1> <title>Example</title> <example> <title>Parsing a single file <filename>test.php</filename>, and generating its XMI file:</title> <programlisting role="php"> <![CDATA[ <?php require_once 'PHP/UML.php'; $uml = new PHP_UML(); $uml->parseFile('test.php'); $uml->generateXMI(1); // UML version number (1 or 2) $uml->saveXMI('test.xmi'); ?> ]]> </programlisting> </example> <para> Note that, since UML is a strong object-oriented standard, <classname>PHP_UML</classname> ignores all "procedural" elements, like global functions, or global constants. </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->

« previous php.pear.doc (#10874) next »