The client has a list of classes. Class A, Class B. The server , has the same list. Class A, Class B.
In my mind, what serialization does is that the client extracts e.g. Class A instance's data. put it into a bytestream. Add something in front of the bytestream's header, indicating it's Class A. For exmple, a bytestream like this `IamClassA,data1,data2,data3`. And once the server got this, it `new` a Class A and put the data back.