I am starting out with Google’s App Engine in Java. I have seen the tutorial video but I do not understand the naming of the project package.
It is going to be a guestbook, that’s why the name is guestbook, I understand that part. But after that I see package name. 1)Is that something you import into the project, or is is something you create.
I have seen this a lot in projects, something like com.xxx.xxx. 2)How do you name this type of thing or is this an import.
I have looked at another tutorial there they take the naming to a whole new level. The name of both the project and the package is de.vogella.gae.java.todo. 3)What does this mean in java terms.
4)Maybe one of you can help me with this specific project I want to start. I want to create a Google App project that for now only serves static files. I will leave the project empty and just put all my static files in the war directory of the project. I want the domain name to be mydomainstatic
1 & 2) Package name is actually the
com.xxx.xxxthing you have already seen in other projects. It provides a namespace so that you don’t collide with the naming scheme used by other applications.The namespace is also the directory structure that the source files follow. com.xxx.xxx would have its files as
src/com/xxx/xxx/Classname.javaThe most common use for a package is in import lines to make Java look in specific packages for code files.
import com.xxx.xxx.*;would allow you to use anything directly incom.xxx.xxx(but notcom.xxx.xxx.yyy) without giving the entire package name every time.Generally, the package name is an reversed domain name, followed by a project name.
For example, if StackOverflow had a Guestbook written in Java, it could have the package
com.stackoverflow.guestbook.3) de is the top level domain (TLD) for Germany (Deutschland). Their package name breaks down to: TLD.domain name.Google App Engine.language (Java).Project Name
4) Really the naming style is up to you. If you went by the tutorials’ style, it would be
com.mydomainstatic.gae.java.projectPersonally, I think the java level is redundant, although the gae level could be useful information.