I have been given the task of redeveloping an "in house" solution to make it expandable and easier to maintain and administer.
The original solution had been hashed together over time using PHP as more requirements were added, and the need to expand is expected into the foreseeable future.
The solution, gathers many different files such as word documents and varying structures of XML document, from different "locations" and converts each into a specifically structured XML documents which get sent on via a web service. To add to the mix, some of the original XML files are retrieved from the same "location" but have varying levels of processing that are required depending on where they are from before that (identified by a "customer" field in the XML)
My intention is to make the new solution as modular as possible so that processing can be suspended at the individual "customer" or "location" level without affecting anything else.
While I have many puzzles to overcome and questions to answer, the question that is keeping me up at night at the moment is "Where should the processing to the structured XML be done?" At present it is done per "customer" but as you can imagine, it leads to a lot of duplicated code. Maybe it is unavoidable, due to the "customer" specific processing required sometimes but sanity tells me there must be a better way.