Search this blog

18 March, 2010

Homework 2

1) Choose a component in your game/project that is both small and functionally well isolated. In example, the camera system
2) Identify the modules that depend on its functionality
3) Identify the modules that functionality depends on
note: You might want to use dependency matrices to do this. You can use the excellent NDepend, or similar tools like Understand, Lattix, Visual Studio 2010 Team System, JDepend, Structure 101, DTangler.Net Reflector (opensource) and so on (opensource),

Now, for each of the dependency, think about them. Remove from the list all the dependencies that you think you could easily eliminate, because they are not really needed. Remove all the ones that are behind well defined interfaces (that's to say, they don't depend on the implementation, or in C++, they don't require static linking of the dependent object files).

Everything that survives this process, is a big problem. If you end up having many of those dependencies, on a component that you choose because it was small and functionally well isolated, how many do you have everywhere else? 
Is it strange now that your compile and link times are _so_ high? What if you want to trash a component, and rewrite it? Code does degenerate, but if it's not isolate that degeneration will turn into a cancer that you can't operate.

Enjoy.

No comments: