Communicant has a function for each type/class it can transfer. Instead, each class should have a toBytes and fromBytes methods and Communicant should only be calling those methods.
My current idea is to support this by creating an abstract class Serializable that exposes toBytes and fromBytes. Each class that can be sent over Communicant would inherit from Serializable.
Communicanthas a function for each type/class it can transfer. Instead, each class should have atoBytesandfromBytesmethods andCommunicantshould only be calling those methods.My current idea is to support this by creating an abstract class
Serializablethat exposestoBytesandfromBytes. Each class that can be sent overCommunicantwould inherit fromSerializable.