views:

35

answers:

4

Say you have data in the format:

name=john;age=33;gender=male

What would you call a method that converts data like that into an an object / associative array?

I've been thinking about:
- unserialize_variables
- parse_variables

+1  A: 

DeserialisePerson

Preet Sangha
The method should with any kind of data - not just person related.
Emanuil
what about just Deserialise
Preet Sangha
Yes that's an option but what if I need another "deserialize" method for another data format?
Emanuil
+1  A: 

Person.Unserialize?

Jon
A: 

In two steps:

ContainerType person = data.parse();

Employee employee( person["name"], person["age"], person["gender"] );
bitc
+1  A: 

PersonReader. Works if you change how you persist the person data in the future too.

derdo