If you have multiple installations of your system either for different clients or in different environments, then sometimes you may need to customize some of your static data for each installation. For example, you may need to translate static descriptions into different languages when installing your system in different countries, or different clients may want to see different texts or even store different values for the same items, or maybe have additional items or vice versa - exclude some of the items.
Xomega provides an easy way to do it by leveraging the ability to
inherit enumerations from each other and override any aspect of the enumeration as appropriate. The following steps provide you a detailed guide on how to do it.
- Declare a base enumeration that defines items and properties that are most common across all the installations.
- If this enumeration is not referenced by any type and is used solely as a base for other enumerations, then you can make it abstract by setting the abstract attribute to true. This will prevent generation of other artifacts, such as constants or SQL scripts, for this specific enumeration.
- For each installation, declare installation-specific enumerations that inherit from the base enumeration and override the values according to each installation. Give each of these enumerations the same name and place them each in their own file.
- Use the name of the inherited enumerations when associating it with a logical type or referencing it elsewhere.
- Create a model project file (.xomproj) for each installation, and include only those files in it, that have enumerations specific to this installation. You can then include all other common model files either directly in each project, or place them in their own common project file, which you would then import in each implementation specific project file as follows.
Code:
<Import Project="$(ProjectBasePath)\ProjectBase.Files" />