public BehaviorGraph(IConfigurationObserver observer) { RouteIterator = new SortByRouteRankIterator(); // can override in a registry Observer = observer; _chainsForType.OnMissing = findChainsByType; _chainsForTypeAndCategory.OnMissing = type => new Cache <string, IEnumerable <BehaviorChain> >( category => { return(ChainsFor(type).Where(x => x.UrlCategory.Category == category).ToList()); }); _chainsForMethod = new Cache <Type, ChainGroup>(type => new ChainGroup(type, this)); _creators = new Cache <Type, BehaviorChain>( type => { return(Behaviors.SingleOrDefault(x => x.UrlCategory.Creates.Contains(type))); }); }