# Package / class naming fails

**URL:** <https://forums.visual-paradigm.com/t/package-class-naming-fails/8005>\
**Category:** General Questions/Discussions\
**Created:** [April 29, 2005, 12:00am UTC](https://forums.visual-paradigm.com/t/package-class-naming-fails/8005 "2005-04-29T00:00:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marco\_Rotellini](https://avatars.discourse-cdn.com/v2/letter/m/f04885/32.png) [@Marco\_Rotellini](https://forums.visual-paradigm.com/u/Marco_Rotellini)\
**Post date:** [December 17, 2003, 12:00am UTC](https://forums.visual-paradigm.com/t/package-class-naming-fails/8005/1 "2003-12-17T00:00:00Z")

</div>

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?

Thanks  
Marco

---

<div class="post-metadata">

**Author:** ![Harou](https://avatars.discourse-cdn.com/v2/letter/h/48db29/32.png) [@Harou](https://forums.visual-paradigm.com/u/Harou)\
**Post date:** [December 18, 2003, 12:00am UTC](https://forums.visual-paradigm.com/t/package-class-naming-fails/8005/2 "2003-12-18T00:00:00Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![martyn](https://avatars.discourse-cdn.com/v2/letter/m/a6a055/32.png) [@martyn](https://forums.visual-paradigm.com/u/martyn)\
**Post date:** [December 18, 2003, 12:00am UTC](https://forums.visual-paradigm.com/t/package-class-naming-fails/8005/3 "2003-12-18T00:00:00Z")

</div>

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.  
or
- attach the project file which generates the problem

Thanks.

Martyn

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

---

<div class="post-metadata">

**Author:** ![Marco\_Rotellini](https://avatars.discourse-cdn.com/v2/letter/m/f04885/32.png) [@Marco\_Rotellini](https://forums.visual-paradigm.com/u/Marco_Rotellini)\
**Post date:** [December 18, 2003, 12:00am UTC](https://forums.visual-paradigm.com/t/package-class-naming-fails/8005/4 "2003-12-18T00:00:00Z")

</div>

Hi Harou

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

Marco
