Re: [flexcoders] Credit Card number encryption

2010-02-11 Thread W.R. de Boer
As far as I am aware you aren't allowed to store credit card numbers yourself 
without a weekly security audit from the card issuer...

Re: [flexcoders] Best practices regarding XML to VO conversion

2010-02-09 Thread W.R. de Boer
Hi Claudiu,

I am using my custom unmarshaller class in combination with XML/E4X but I keep 
having a memory. Maybe I am just doing something? Maybe it's the use of a 
Vector-type in main VO object which stores child VO objects?

Maybe I have to nullify the variables with vectors or arrays? I can put some 
code online on pastebin.com. If anyone is interested.

Weyert de Boer

[flexcoders] Best practices regarding XML to VO conversion

2010-02-09 Thread W.R. de Boer
Hello,

I am having a question what the best approach is to convert existing XML data 
to a object graph of value objects. I have spend quite some time to fix a 
memory leak in my existing parsing practice and I am curious how others solve 
this problem.

My common approach is to create a class such as EventReader and EventItemReader 
class which is responsible for the parsing of the specific XML element and 
return the appropriate value object. But somehow this code is leaking like a 
mad dog (200kb per time) while the XML file is only 16kb. Now I have currently 
rewritten it so that just using simple strong typed objects. 

But I would love to find out what I am doing wrong in my current approach and 
how to solve it. Because it makes it easier to reuse the parsing code/logic. 

For example, normally, I use the approach of creating a public class with a few 
public variables like this:

   public class EventItemVO {
  public var eventDate: Date;
  public var eventName: String;
  public var location: String;
   }

and then I am having code like this to parse it:

try {
var xml: XML = new XML( loaderContent );
   var parser: EventItemXMLReader = new EventItemXMLReader( xml );
   parser.parse();
} catch (e: Error) {
  trace("Error occured while parsing");
} finally {
 parser = null;
 xml = null;
}

in the EventItemXMLReader-class I then return an instance of the 
EventItemVO-class

Somehow this leaks and while I do the same stuff in the onComplete-handler of 
the Loader and do:
array.push( {eventDate:date, eventName:name, location:location} );

The memory leak disappears. I would expect their is some reference kept alive 
but I am having a hard-time finding the reference which keeps it from garbage 
collecting it all.

How do you parse XML and convert it in value objects?

Yours,
Weyert de Boer