Creating virtual resources
The next technique that we are going to discuss helps you solve conflicts in your manifests and build some elegant solutions in special situations.
Remember the uniqueness constraint that was introduced in Chapter 1, Writing Your First Manifests; any resource must be declared at most once in a manifest. There cannot be two classes or defined type instances that declare the same file
, package
, or any other type of resource. Each resource must have a unique type/name combination. This applies to instances of defined types as well as native resources.
This can pose issues when multiple modules need a common resource, such as an installed package, or perhaps even independent settings in the same configuration file. A component class for such resources, as introduced in Chapter 4, Modularizing Manifests with Classes and Defined Types, will resolve basic conflicts of this kind. It can be included an arbitrary number of times in the same manifest.
This can be impractical...