-
1. Re: Where to place constants?
hezekiel Aug 20, 2002 2:30 PM (in response to pavel_c)in ejb-jar.xml: <env-entry> (environment entry) look for ejb-jar.xml examples or documentation from the net.
-
2. Re: Where to place constants?
pavel_c Aug 22, 2002 11:52 AM (in response to pavel_c)This is inefficient, because you have to look them up from JNDI. Besides, these are internal application constants, not deployment-specific parameters, for which the env-entry mechanism is designed.
-
3. Re: Where to place constants?
ppetit Aug 23, 2002 5:06 AM (in response to pavel_c)I use to put them in an interface that I implement in the class that needs the constants...
It's just the way I do this, I don't arg it is "THE WAY"!
You can also put them in a public class with a private constructor to avoid any instanciation and use static final variables.
Philippe -
4. Re: Where to place constants?
mipe Aug 23, 2002 7:04 AM (in response to pavel_c)I suggest you to download the petstore example for j2ee from java.sun.com if you hadn't done it.
They placed JNDI and other (database related) constants into a util package at the same level to the ejb package.
For example if you have
com.company.product.comp.ejb package, your constants can be put into the
com.company.product.comp.util package where you place files like JNDINames.java or DatabaseNames.java