Cool stuff in FubuCore No. 4: Dependency Analysis with Directed Graph
This is the fourth post of the FubuCore series mentioned in the Introduction post.
There are several places in the Fubu-related projects (FubuMVC, Bottles packaging/deployment, etc) that we need to work out a dependency tree. This means, for a given node, we need to find out all the dependencies that node has and if there are any cycles in the dependency graph. I’m being vague. Let me be more concrete.
FubuMVC has script management functionality. Actually, it has resource management because it can handle more than just scripts (like CSS), but the main problem has to do with script dependencies. We do a *lot* of stuff with JavaScript and jQuery. We use a lot of jQuery plugins and we have a lot of internal plugins we’ve written for our app. The dependency graph gets kinda complicated: ScriptX depends on ScriptY which depends on jQuery.Validate and jQuery.UI and all these four scripts depend on jQuery proper. So if a view requests that ScriptX be added to the HTML output, our script manager has to also ensure that
