Hi Stack,
here's an example:
in this class I create a pair of bookend anchors, and then shove a yumrepo, and a file resource between them.
Your other classes/resources can then declare a relationship to the end anchor to establish the relationship.
some gotchas:
- Make sure to include the class declaring the anchor into the class which has the dependency.
- Remember that you've just permanently established a relationship between these two classes. This is important to know, and can take you in a direction that leads to complications down the road.
- It is common to have specific software classes depend on your base-type 'i set up my package repositories, and some other core things that will happen most everywhere' resources. The caveat here is that modules you share with the world will NOT have that base class, and as such may have dependency issues.
- Use the anchor pattern as sparingly as possible. Consider having to use it like having to resort to an exec. It is occasionally the right tool for the job, but not usually.
Hope that helps.