Using Castle Windsor, I\'d like to create a class that records an integer. But I\'d like to decorate it several times with other classes. I can see how this works if all c
You could wrap the seed in an interface (ISeedHolder ?) and register it with a singleton lifestyle. Then use the interface in your ModelUpdatingRecorder instead of the raw int. Unless your seeds may need to be parallelized it should allow you to set the seed and resolve it when constructing the ModelUpdatingRecorder
public interface ISeedHolder
{
int Seed {get;set;}
}
public class ModelUpdatingRecorder : IRecorder
{
int seed;
public ModelUpdatingRecorder(ISeedHolder seedHolder)
{
this.seed = seedHolder.Seed;
}
Would this solution achieve what you need?