index.php
Go to the documentation of this file.00001 <?php
00002 header("Location: ../public2/index.php" );
00003 exit();
00018 require_once( "../public/codetodiagram.php" );
00019
00020 ?>
00021 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
00022 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
00023 <html xmlns="http://www.w3.org/1999/xhtml">
00024 <head>
00025 <?php require_once( "header.php" ) ?>
00026 <style type="text/css">
00027
00028
00029 @import url("css/default.css");
00030
00031 </style>
00032 <title>
00033 Code To Diagram - Automatic Sequence Diagram
00034 </title>
00035 </head>
00036 <body>
00037 <center>
00038 <img src="./images/codetodiagramheader.jpg" alt="code to diagram logo" title="code to diagram"/>
00039 <h3>
00040 Code To Diagram
00041 </h3>
00042 </center>
00043 <h4> Converting Code Execution into Sequence Diagrams </h4>
00044 <div class="intro">
00045 <h5> Sequence Diagramas </h5>
00046 <p>
00047 The sequence diagram it is probably the must intuitive way to understand some code execution.
00048 </p>
00049 <p>
00050 Use it in the pre-project phase it is very common to describe the excepted behavior
00051 from some software. From the sequence diagram it is possible to developer test diagram,
00052 as check if all the features used on it was describe into the another phase of the planning
00053 as the use cases, for example.
00054 </p>
00055 <h5> Sequence Diagramas Weaknesses </h5>
00056 <p>
00057 When the sequence diagram it is used to describe the features into the code level, as the
00058 interaction of objects, using methods, it is possible to plan how the classes will be. But,
00059 as the code development evolves, been caused by the analysis fail or by requirement change,
00060 the diagrams will losing the link with the reality losing consequently the descriptive function
00061 to one analysis history function.
00062 </p>
00063 <p>
00064 Also, to require the existence of one diagram to each test methods of some project will bring
00065 a huge spent of time, into it's creation as is in the maintenance. This is because each change
00066 of some method name or attribute name will require a change into all diagrams what involve it.
00067 </p>
00068 <h5> Code to Diagram Propose </h5>
00069 <div style="float:left">
00070 <div style="width:50%; float:left">
00071 <p>
00072 The solution proposed here it is the automatic generation of sequence diagrams based on the PHP
00073 code execution. One full code execution or some stretch of execution it is monitored by classes
00074 of code instrumentation what, based on the in formations received, creating the diagram of that
00075 code execution. This diagram can be seen as HTML, saved as HTML, and also to be saved
00076 as XML and in the future exported as a jpeg image.
00077 </p>
00078 <p>
00079 The pattern used here was the factorys and printers. There is many factorys what builds uml sequence
00080 diagram objects and many options of printers what create a different result based on the uml sequence
00081 diagram object received.
00082 </p>
00083 <p>
00084 if you have some
00085 special case, when any of the avaliable printers and factorys
00086 solve your problem, everthing it is extremly well
00087 <a href="http://www.thiagomata.com/codetodiagram/doc/dox/html/">doc</a>
00088 to help
00089 to you create new classes and append new features.
00090 </p>
00091 </div>
00092 <div class="diagram_flow">
00093 <img src="./images/flow_codetodiagram.png"
00094 alt="code to diagram flow"
00095 longdesc="./images/flow_codetodiagram.txt"/>
00096 </div>
00097 </div>
00098 <h5> How it Works ? </h5>
00099 <p>
00100 All this process must be simple and enough to be used simply append one call, but flexible also
00101 to deal with all the special cases. The big idea it is to create the diagram of the execution been
00102 less invader as possible into the source code what the execution will run. You can see the runing
00103 examples <a href="../examples" title="click here to see the examples">here</a>.
00104 </p>
00105 <h5> Preview of Diagram from Code Execution </h5>
00106 <div>
00107 <div class="duasColunas">
00108 <p>
00109 In a short preview this code:
00110 </p>
00111 <div class="php">
00112 <p class="line">
00113 <span class="tag"><?php</span>
00114 </p>
00115 <p class="line"><span
00116 class="function">require_once</span><span
00117 class="parenthesis">(</span><span
00118 class="string">'../../public/codetodiagram.php'</span><span
00119 class="parenthesis">)</span><span
00120 class="semicolon">;</span>
00121 </p>
00122 <p class="line"><span
00123 class="php_class">CodeToDiagram</span><span
00124 class="static_operator">::</span><span
00125 class="method">getInstance</span><span
00126 class="parenthesis">()</span><span
00127 class="caller">-></span><span
00128 class="method">start</span><span
00129 class="parenthesis">()</span><span
00130 class="semicolon">;</span>
00131 </p>
00132 <p class="line"><span
00133 class="function">require_once</span><span
00134 class="parenthesis">(</span><span
00135 class="string">'Wolf.class.php'</span><span
00136 class="parenthesis">)</span><span
00137 class="semicolon">;</span>
00138 </p>
00139 <p class="line"><span
00140 class="function">require_once</span><span
00141 class="parenthesis">(</span><span
00142 class="string">'House.class.php'</span><span
00143 class="parenthesis">)</span><span
00144 class="semicolon">;</span>
00145 </p>
00146 <p class="line"><span
00147 class="function">require_once</span><span
00148 class="parenthesis">(</span><span
00149 class="string">'Pig.class.php'</span><span
00150 class="parenthesis">)</span><span
00151 class="semicolon">;</span>
00152 </p>
00153 <p class="line"><span
00154 class="function">require_once</span><span
00155 class="parenthesis">(</span><span
00156 class="string">'History.class.php'</span><span
00157 class="parenthesis">)</span><span
00158 class="semicolon">;</span>
00159 </p>
00160 <p class="line"><span
00161 class="new">new</span><span
00162 class="space"> </span><span
00163 class="object">History</span><span
00164 class="parenthesis">()</span><span
00165 class="semicolon">;</span>
00166 </p>
00167 <p class="line"><span
00168 class="tag">?></span>
00169 </p>
00170 </div>
00171 </div>
00172 <div>
00173 <p>
00174 Will bring to you this:
00175 </p>
00176 <p>
00177 <a style="border-style:none;" href="../examples/ThreeLittlePigs/threeLittlePigs.php">
00178 <img
00179 style="border-style:none;"
00180 src="./images/pigs_small.png"
00181 alt="three little pigs diagram automatically generated"
00182 longdesc="./images/pigs_small.txt"
00183 />
00184 </a>
00185 </p>
00186 </div>
00187 </div>
00188 <p>
00189 Click
00190 <a href="http://www.assembla.com/wiki/show/codetodiagram/How_To_Use" title="Code to Diagram - How to Use" >
00191 here
00192 </a>
00193 to know how to use this project into your application
00194 </p>
00195 <h5> Draw your diagram </h5>
00196 <p>
00197 One small component was created in the process of generation of this software what can be used separately.
00198 It is the generator of sequence diagrams from one XML.
00199 This application can be test
00200 <a href="xmlToDiagram.php"> here </a>
00201 where one XML of example it is used but can be change freely.
00202 </p>
00203 <p>
00204 The target of this project it is make possible the generation of a sequence diagram from each test method.
00205 Been each generated diagram saved with an easy to find name. Some new features should be appending to as
00206 show the code of the caller, make improvements into the parameters descriptions and many more.
00207 </p>
00208 <h5> Preview of Diagram from Xml Iterpretation </h5>
00209 <div>
00210 <div style="width:100%;float:left">
00211 <p>
00212 In a short preview this xml:
00213 </p>
00214 <?php CorujaDebug::printXmlCode(
00215 file_get_contents ( '../examples/xmls/mvc.xml' )
00216 );?>
00217 </div>
00218 <div style="width:100%;float:left">
00219 <p>
00220 Will bring to you this:
00221 </p>
00222 <p>
00223 <a style="border-style:none;" href="xmlToDiagram.php?file=mvc">
00224 <img
00225 src="./images/mvc_codetodiagram.jpg"
00226 longdesc="./images/mvc_codetodiagram.txt"
00227 alt="model view controller sequence diagram automatically generated by the code to diagram"
00228 />
00229 </a>
00230 </p>
00231 </div>
00232 </div>
00233 <h5> Download </h5>
00234 <p>
00235 You can download the last version of this project just downloading from it's
00236 <a href="http://subversion.assembla.com/svn/codetodiagram" title="Code to Diagram - SVN">
00237 SVN
00238 </a>.
00239
00240 But, if you just want to take a look into the code, it is better view by
00241 <a href="http://code.assembla.com/codetodiagram/subversion/nodes" title="Code to Diagram - SVN Nodes" >
00242 this
00243 </a>
00244 link.
00245 </p>
00246 <h5> Features </h5>
00247 <p>
00248 While still not fully working on Internet Explorer, the generator already makes life easier for those responsible
00249 in maintaining this kind of diagrams. We welcome anyone with the patience and desire to make the CSS changes need
00250 for it to work on IE.
00251 </p>
00252 <p>
00253 Also, fully compliance with UML 2.0 is still under development. Anyone interested in working in these fields is more
00254 than welcome to join the team. And if you have a patch on add-on to send, feel free to do so.And remember, this is
00255 free software, and as such, I can give you no warranty. Use it at your own risk. It's not for the faint of heart.
00256 </p>
00257 <h5> Who build this stuff ? And Why ? </h5>
00258 <p>
00259 This project was buid to create a high quality documentation in our other project,
00260 called Coruja PHP Framework. That aims to do everything with the highest quality
00261 and, of course, the documentation could not be out of this.
00262 </p>
00263 <p >
00264 Click
00265 <a href="http://www.assembla.com/wiki/show/codetodiagram/Team" title="Code to Diagram - Team">
00266 here
00267 </a>
00268 to see the team responsible for the development of these projects
00269 </p>
00270 <h5> Links Related </h5>
00271 <p>
00272 Click
00273 <a href="http://www.ibm.com/developerworks/rational/library/3101.html" title="IBM - UML's Sequence Diagram">
00274 IBM - UML's Sequence Diagram
00275 </a>
00276 to know more about sequence diagrams.
00277 </p>
00278 <p>
00279 Click
00280 <a href="http:
00281 The Tom Kyte Blog talk about Code Instrumentation
00282 </a>
00283 or
00284 <a href="http://www.glenmccl.com/instr/instr.htm" title="Java(tm) Source Code Instrumentation">
00285 Java(tm) Source Code Instrumentation
00286 </a>
00287 to know more about code instrumentation.
00288 </p>
00289 </div>
00290 <?php require_once( "footer.php" ); ?>
00291 </body>
00292 </html>