Writing modular software is like agglomerative clustering. Can you apply aspects used in clustering algorithm to write better modules?
In software engineering, we write code to address a certain requirement, such as opening a database, defining a data model, or processing data. We try to create code just once, then reuse.
But how do we know which part to put that code? How do we know we can reuse it and not write a new one? We look at the objects or concepts that the application has then group the code accordingly.
If a certain code or idea that initially was part of a single object but eventually gets needed by another object, we pull it out and create a new object or a new interface, which the previous two objects can now refer.
