PHP meets UML Marcus Brger Linux Tag 2004
PHP meets UML Marcus Börger Linux. Tag 2004 Marcus Börger PHP meets UML
Overview þ PHP 5 vs. PHP 4 þ PHP 5 OO þ PHP and UML Marcus Börger PHP meets UML 2
PHP 4 and OO ? ¨ Poor Object model þ Methods ý No visibility ý No abstracts, No final ý Static without declaration þ Properties ý No default values ý No static properties þ Inheritance ý No abstract, final inheritance, no interfaces þ Object handling ý Copied by value ý No destructors Marcus Börger PHP meets UML 3
PHP 5's revamped OO Model þ PHP 5 has really good OO þ Better code reuse þ Better for team development þ Easier to refactor þ Some patterns lead to much more efficient code þ Fits better in marketing scenarios Marcus Börger PHP meets UML 4
Completely new XML support þ PHP 4's XML was pathetic þ SAX was OK þ DOM was crappy, DOM was fake þ There was nothing else þ PHP 5's XML is brilliant þ þ SAX is OK DOM is functional Simple. XML is the solution to all your problems Native SOAP support Marcus Börger PHP meets UML 5
Reflection API þ Can reflect nearly all aspects of your PHP code þ Functions þ Classes, Methods, Properties þ Extensions <? php class Foo { public $prop; function Func($name) { echo "Hello $name"; } } Reflection. Class: : export('Foo'); Reflection. Object: : export(new Foo); Reflection. Method: : export('Foo', 'Func'); Reflection. Property: : export('Foo', 'prop'); Reflection. Extension: : export('standard'); ? > Marcus Börger PHP meets UML 6
Reflection API þ Can be used to generate XMI þ Can be used to reverse engineer PHP Marcus Börger PHP meets UML 7
Unified Database API þ PHP 5. 1 will come with PDO þ Unified object oriented API þ Support for MSSql, My. SQL, Oracle, Postgres, . . . þ Support for transactions þ Support for LOBs þ Support for iterators Marcus Börger PHP meets UML 8
Why UML þ Improve Communication þ With customer þ With management þ Between developers þ þ þ Visualize Concepts Improve documentation Model verification þ Mistakes during design are cheap þ Mistakes during implementation are expensive þ Automatic code generation Marcus Börger PHP meets UML 9
PHP and UML þ Support for OO syntax/semantic þ Support through open source tools þ Doxygen þ Umbrello þ Argo. UML þ Support through commercial/proprietary tools þ þ Poseidon Waterproof UML BITPlan smart. GENERATOR Sybase Power. Designer Marcus Börger PHP meets UML 10
Doxygen þ Doxygen is a documentation system þ þ Code comments to documentation Creates UML like graphs automatically Generates html, chm, TEX, Post. Script, PDF, man pages Runs on Linux/Windows Marcus Börger PHP meets UML 11
Umbrello þ þ Most of UML 1 diagram types Code generation for C++, Java, PHP, Perl, Python, SQL, ADA, AS, Java. Script, IDL, XML Schema þ þ þ Export to PNG and XMI Runs on Linux/KDE Manual in English and German Marcus Börger PHP meets UML 12
Argo. UML þ þ þ Runs on any platform with Java 1. 3+ Exports GIF, PS, EPS, PGML and SVG XMI Support OCL Support Code generation þ C++ þ Java þ PHP þ Support through commercial version Poseidon Marcus Börger PHP meets UML 13
BITPlan smart. GENERATOR þ Code generation from XMI þ This allows to use all XMI compliant UML tools þ Rational Rose þ Poseidon Gentleware þ micro. TOOL objectiv. F þ Together Soft Together/J oder C++ þ Object Domain from Object Domain Systems þ JDBC-Quellen and other Repositories ¨ At the moment only a prototype Marcus Börger PHP meets UML 14
Sybase Power. Designer þ þ Complete UML 1. 3 support Process Execution þ Service Oriented Architecture support þ eb. XML, BPEL 4 WS þ Data Modeling þ Conceptual, Logical, Physical and Warehouse Data þ Roundtrip engineering for databases þ Enterprise Modeling þ Model Driven Architecture þ Object/Relational, XML to Database and Warehouse Source mapping Techniques þ Roundtrip engineering for C#, C++, Java, VBA, XML, . . . þ þ Documentation generation Highly Extensible and Customizable Marcus Börger PHP meets UML 15
Sybase Power. Designer þ Working with class diagrams Marcus Börger PHP meets UML 16
Sybase Power. Designer þ Teaching PHP Marcus Börger PHP meets UML 17
Sybase Power. Designer þ Teaching PHP Marcus Börger PHP meets UML 18
Sybase Power. Designer þ Teaching PHP Marcus Börger PHP meets UML 19
Sybase Power. Designer þ Generating PHP scripts from UML Marcus Börger PHP meets UML 20
Sybase Power. Designer þ Generating PHP code for constants Marcus Börger PHP meets UML 21
What to do next þ Automatically generate data query classes þ Extending PHP’s reflection API to write XMI þ Typehints for properties and return values þ Implement roundtrip engineering þ Implement a script packaging extension þ Extend PHP with the keyword ‘package’ Marcus Börger PHP meets UML 22
What else? þ Using PHP to script UML tools þ Generate PHP code from Activity Diagrams þ Validating generated PHP code Marcus Börger PHP meets UML 23
Links þ This slides http: //somabo. de/talks þ PHP http: //php. net þ Doxygen http: //doxygen. org þ Argo. UML http: //argouml. tigris. org þ Poseidon http: //www. gentleware. com þ Umbrello http: //uml. sourceforge. net þ Waterproof http: //www. waterproof-software. com/uml/ þ Power. Designer http: //www. sybase. com/products/enterprisemodeling Marcus Börger PHP meets UML 24
- Slides: 24