Last week a young student ask me if marshalling is the same as casting. My answer was definetly no. Marshalling is seralization, the way to transform a memory representation of an objet into bytes in order to be transmitted to a network whereas casting is related to type convertion / coercion.
Later on, rethinking the question I was thought that marshalling can be seen as a special case of casting. For example the transformation of the memory representation is in xml then one can say that you are "casting" to the type defined by the corresponding xsd grammar of that xml file.
What do you think about this?