New answers tagged serialization
Best pracrice is to use different classes on both sides of the service. After all if you were an external client consuming the service you would hardly have access to the service classes. However, as you point out, that is a pain. I would share the data classes. perhape compile them and stick on an internal nuget repo?
If you're doing logging, it would often be convenient to log the state of any singletons, as they represent global state that might be required to reproduce a crash. If your singleton can be logged by serializing a complete representation of itself, this is ideal as you might also be able to deserialize that state and rerun your program with the singleton in ...
As far as I remember the point of a Singleton is to have only one instance of the class in existence. Serialisation is a transformation of data into another form(at), so that it can be easily written to a file, database or be transmitted, if I recall that correctly. So let's say you have a a class representing some definition (for example, you have a class ...
First of all, I highly recommend you read up a little on Java serialization. This article is a bit dated but covers the essentials. Specifically, this bit is important: 2. Serialization is not secure It often comes as an unpleasant surprise to Java developers that the Serialization binary format is fully documented and entirely reversible. In ...
Top 50 recent answers are included