Package / class naming fails

Hi there

I use VP-UML 3 Professional Edition and I want to generate code from classes in a class diagram. This works fine until I try to make a package for this classes. I tried two different ways, both failed:

  1. I name all classes in the diagram with the full path name like com.solarmax.newpackage.Class1, com.solarmax.newpackage.Class2 etc. When I then start the code checker, I get the messages “Invalid name of class” for every class.

  2. I place a package model into the class diagram and name it “com.solarmax.newpackage”. Then I connect all the classes with containments to the package model. When I start code generation I get the message “Invalid package name” for all classes.

The working directory for the Code Engine is like c:/projects/vp-uml/src. I expect that the code engine creates sub-dirs com/solarmax/newpackage, but it doesn’t. I also create the directory structure manually and set the working directory for the Code Engine to c:/projects/vp-uml/src/com/solarmax/newpackage. This also fails.

Any advice?


I think you may try to create a package for each package.

I mean you may try to create the following:
[com] ±- [solarmax] ±- [newpackage] ±- , and
[com] ±- [solarmax] ±- [newpackage] ±- .

p.s. [] is package, <> is class, and ±- is containment.

Hi Marco,

I’m not too sure what you are talking about. Could you either:

  • explain step by step how to create the problem you experienced.
  • attach the project file which generates the problem



In question 1, when you name the class com.solarmax.newpackage.Class1 are you expecting the packages to be automatically created in the code?

Hi Harou

That’s exactly what I wanted to do, thanks! Sometimes the easyest things are hard to see.