Jezze wrote:That sounds tempting to do but how would you communicate the information without subjecting yourself to feature creep?
You simplify the interface that you use for communication (to the greatest extent possible), and push all of the logic down to another layer.
As an example, think about USB. It's main advantage, in my opinion, is that the physical interface (four wires), and wire communication protocol are very simple to implement (extremely simple, in fact.) This allows future versions/revisions to be handled at the software level, for the most part, and it allows for backwards compatibility (Plug in a USB3 device into a USB1 port, or vice-versa).
The key is to
not design yourself into a scenario where you make a decision early on that prevents you from solving new problems later on. "Feature creep" is fine, as long as it doesn't require breaking changes. And simplifying your hard-coded interfaces reduces the likelihood that you will be forced to make breaking changes to that interface at a later date.
For example, all of your method calls could take a single string, named "parameters", instead of multiple, distinct values with specific types (int, float, datetime, etc.). Although performance would be negatively impacted, flexibility and extensibility would be improved. Every method could be designed to expect data in XML format, or CSV format, or anything else that made sense. Additional data could be added at any time, and could either be ignored by the method if it did not understand the data, or handled by the method if it was understood.
I'm not suggesting this as a solution... I'm just pointing out that the "traditional" C-style approach to passing arguments to methods is rigid, and does not allow for future expansion, just like the old Parallel DB-25 printer cables, or the IDE ribbon cable. They have all been replaced, over the years, by USB and SATA cables, because these cables have a simpler interface, and rely heavily on the controllers to handle the "logic" of sending and receiving complex data over a simple serial data stream.
Hopefully, this all makes sense, and answers your question, somewhat.