Showing posts with label serialization. Show all posts
Showing posts with label serialization. Show all posts

Tuesday, May 29, 2012

XML Serialization With XStream

XML Serialization is essential in some situations. Most probably we may use XML serialization when we need higher level of portability. XStream is a great library for xml serialization.
Serializing

Saturday, January 21, 2012

Python Note 7 (the pickle module)

In python we can use serialization functionality using pickle module. it can save live instances of objects to files and retrieve object instances from pickled files.
Code:
import pickle

class Transaction : 
 def __init__(self,userName,trnsID,payment):
  self.userName=userName
  self.trnsID=trnsID
  self.payment=payment
 
 def __del__(self):
  print("Destructed!")
 
 def getPaymentValue(self):
  return self.payment
 
 def getUserName(self) :
  return self.userName
#end of the class
© kani.stack.notez 2012 | Blogger Template by Enny Law - Ngetik Dot Com - Nulis