I am looking for an article or other articles about a form of modular design. Unfortunately I didn't fully read the article before I lost it so this might be kind of vague but I will try to be as specific as I can be and explain what I am trying to do so that someone might be able to suggest other articles.
The article (blog post) in question was by a programmer who said in his experience the best way to design software was in a sort of modular or component based approach so that different components could be selected for different versions of the same or similar software.
The main thing I remember from it was a diagram showing different programs on one axis and different components on another and showing how you could select specific components for specific programs.
The reason I am looking for this is that I am dealing with some non-object oriented PHP code which is too large to revise to object oriented. This program displays different branded web applications with different but similar rules for each site. Currently much of the code looks like:
if($_SESSION['country'] === "Canada" && $_SESSION['brand'] === "X"
&& $_SESSION['type'] !== "1" || $_SESSION['brand'] !== "Y"
&& $_SESSION['type'] === "2") {
include("mod_something.php");
}
Where the conditions might be repeated in several places in the code for including different files.
And I would like to revise some of it to look more like:
if($_SESSION['component-red'] === true && $_SESSION['country'] === "Canada") {
include("mod_something.php");
}
and have the component variables set in a central location based on brand and user choices (the sites use a front loading or FrontController design pattern).
Any suggestions or tips about how to accomplish this would be appreciated, but I am not entirely sure how to research this for non-OOP code.
Thank you.
Edit: I was educated in OOP but that is not my question.