Discussions

Web tier: servlets, JSP, Web frameworks: what about private data after getteng serialized......??????

  1. Hi,
      When a object is getting serialized(since it implements serializable) it can now make in to a BLOB and write in to a secondary storage or can be sent through network.
    Mean while what about the private data????
       Whether it is also getting serialized thern it will cause the violation of data abstraction in OOPS
    If so why sun specification is like this???
    Give me exact reason
    In waiting foru ur reply
    MaRu.
  2. Serializing private data is certainly NOT in violation of OO principles.
    After deserialization it won't magically become available without the accessors...

    And you can of course always implement writeObject and readObject to force the fields not to be written out.