Separation of Powers
The government of the United States is made up of three unique entities - the Judicial Branch, the Legislative Branch, and the Executive Branch. Each has a separate set of responsibilities in the business of government. Think about your software like the founders thought about our country.Separating your code modules, objects, methods, and functions in accordance with areas of responsibility makes it so that your code is easier to read, easier to re-use, and easier to troubleshoot. It also makes permission restricting functionality easier in the future as those requirements creep up (and they will).
MVC
I wrote recently about a layered MVC methodology. MVC is an architectural model that implies a separation of code from display properties and data set. Separating these things opens up a lot of avenues for future expansion because data and interface elements aren't necessarily dependent on the underlying logic base.Taking this architecture into your logic base creates the same world of possibilities for your code set. Object interdependencies will still exist, but compartmentalizing things allows for easier replacement and upgrades to code fragments, data objects, and business logic without having to address the larger logical template.
The Tie that Binds
Compartmentalization of responsibilities and functionality requires some sort of logical imperative that takes advantage of your available elements. In a great deal of my own code, I create an "application object" that contains pointers or references to my logical objects for use within the global namespace. Object interdependencies make for complex reference strings, but the upside is that it is much easier to add hooks for entity or functionality expansion - that and my global structure is made almost entirely of pointers which makes for better memory efficiency.What visitors have to say about Separation of Powers in the Programming World
