Global Variables
-
Is there a way to make Global Vaiables? Can I add them to the Application or ApplicationContext? Stefan
-
Is there a way to make Global Vaiables? Can I add them to the Application or ApplicationContext? Stefan
Global variables are generally a sign of poorly thought out design. However there are cases when you want to make something available to classes across your application (like values from the application's config class). I would suggest a couple of approaches: 1. Is to make the variable available through a static property of an appropriate class. 2. Is to make a class (a singleton) that exposes these values through static properties. For instance a Config class that retrieves the information from a config file and exposes them to the rest of the application.
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar Coming soon: The Second EuroCPian Event