Complex problems in a dynamic environment

time to read 1 min | 170 words

My last post made me think about how it is best to approach a problem in a dynamic environment. The problem that I have in mind is the one I solved with IoC and static typing here. The problem is as follows:

You have several customers, each of them has its own database, with its own schema, data and behaviors, There is a common ground between the customers, but each does (different things!) differently. You need to handle each incoming user according to its associated customer.

For the purpose of discussion, let us say that we want to list all employees that are direct subordinates for the current user, where the employee's names and their associations to their manager can change based on the customer.

How would you approach such an issue using Ruby?

This is not an idle question, I had to face such a task, and it is complex in the infrastructure layer, but still let me use clear, intention revealing code in most cases.