A Mechanism for Ad-hoc Remote Procedure Calls
If the communication between PHP and Java teach you anything, it is the importance of using an abstraction layer to hide messy and unimportant details. In this case, you were able to turn the simple function of adding two numbers into a full-fledged, multi-threaded network service, while keeping the actual addition code very simple and clean. The communication details were hidden away in specialized classes, which can be re-used for any other network service.
What you've actually built is an ad-hoc remote procedure call (RPC) mechanism. RPC systems can be pretty complicated, but you avoided that by both making your system simple and robust, and allowing for very general data structures.
The downside is your network protocol is a bit wasteful on bytes, but that is probably not a concern for simple applications. And if it does become a problem, you can always change the protocol layerwithout having to disrupt the application code. The code in this article can also serve as an excellent tool for rapid prototyping.