Bug 136242 - Umbrello PHP5 generator doesn't honor dependencies
Summary: Umbrello PHP5 generator doesn't honor dependencies
Status: RESOLVED WORKSFORME
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-24 18:52 UTC by gmud
Modified: 2006-11-06 13:17 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Class diagram picture that shows the tc (3.01 KB, image/png)
2006-10-24 18:53 UTC, gmud
Details

Note You need to log in before you can comment on or make changes to this bug.
Description gmud 2006-10-24 18:52:33 UTC
Version:           1.5.5 (using KDE 3.5.5, Gentoo)
Compiler:          gcc version 3.4.6 (Gentoo 3.4.6-r1, ssp-3.4.5-1.0, pie-8.7.9)
OS:                Linux (i686) release 2.6.17-suspend2-r6

Steps to reproduce:
Start a new class diagram with the following classes:

ClassA
ClassB
ClassC (inherits ClassB and has ClassA as dependency)
(see attached testcase picture)

When umbrello generates code for php5 with this scenario "ClassC" looks like this:
<?php
require_once 'ClassB.php';


/**
 * class ClassC
 */
class ClassC extends ClassB
{

  /** Aggregations: */

  /** Compositions: */

   /*** Attributes: ***/

} // end of ClassC
?>

But it should look like this (generated with argoUML):
<?php
require_once('ClassA.php');
require_once('ClassB.php');
class ClassC
{
    // --- ATTRIBUTES ---

    // --- OPERATIONS ---

} /* end of class KlasseC */

?>

The problem here is the missing require_once statement for "ClassA".
Comment 1 gmud 2006-10-24 18:53:28 UTC
Created attachment 18249 [details]
Class diagram picture that shows the tc
Comment 2 Oliver Kellogg 2006-11-05 23:01:04 UTC
SVN commit 602397 by okellogg:

CodeGenerator::findObjectsRelated(): Include associations of type at_Dependency.
CCBUG:136242


 M  +28 -37    codegenerator.cpp  
 M  +2 -1      codegenerator.h  
 M  +9 -8      codegenerators/adawriter.cpp  
 M  +1 -1      codegenerators/adawriter.h  
 M  +2 -3      codegenerators/aswriter.cpp  
 M  +5 -5      codegenerators/cppheadercodedocument.cpp  
 M  +2 -2      codegenerators/idlwriter.cpp  
 M  +5 -5      codegenerators/javaclassifiercodedocument.cpp  
 M  +2 -2      codegenerators/javawriter.cpp  
 M  +2 -3      codegenerators/jswriter.cpp  
 M  +8 -7      codegenerators/pascalwriter.cpp  
 M  +1 -1      codegenerators/pascalwriter.h  
 M  +6 -7      codegenerators/perlwriter.cpp  
 M  +2 -2      codegenerators/php5writer.cpp  
 M  +2 -2      codegenerators/phpwriter.cpp  
 M  +2 -2      codegenerators/pythonwriter.cpp  
 M  +9 -9      codegenerators/simplecodegenerator.cpp  
 M  +3 -3      codegenerators/simplecodegenerator.h  
 M  +2 -2      codegenerators/xmlschemawriter.cpp  
Comment 3 gmud 2006-11-06 12:33:21 UTC
Works for me, thanks!
Yet, there is another problem, I don't know, if its related to this. I get the following output, although there aren't any compositions and aggregations:
 /** Aggregations: */

  var $m_;

  var $m_;

  var $m_;

  var $m_;

  var $m_;

  var $m_;

  var $m_;

  var $m_;

  /** Compositions: */
  var $m_;
  var $m_;
  var $m_;
  var $m_;
  var $m_;
  var $m_;
  var $m_;
  var $m_;

Artifacts?
Comment 4 gmud 2006-11-06 13:17:24 UTC
It's another problem, I opened a new Bug #136940.