in reply to inherit Readonly variables (constants)

Thanks for your answers but what would be a common solution? I read that it is bad practice to export from an object module. Or perhaps use a separate "Constants" module which exports what I need? But then again I will have to "use" it in every sub class which looks somewhat clumsy.
Is there a (clean) way where I can do whatever is necessary in the base class and have the variables automatically be imported into every sub-class?
  • Comment on Re: inherit Readonly variables (constants)

Replies are listed 'Best First'.
Re^2: inherit Readonly variables (constants)
by JavaFan (Canon) on Mar 16, 2009 at 14:12 UTC
    I read that it is bad practice to export from an object module.
    If someone says "bad practice" (or "good practice") they usually voice an opinion. And if the practice includes the words "never" or "always", it usually means they haven't really thought things over.

    I happily export constants from object modules. It takes the user of the module not more than 2 keystrokes from preventing any importing anyway, so it's not something that's forced upon the inheriter.