Quantcast

Data interchange formats

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Data interchange formats

Matthew Ratzloff
It seems that Zend Framework needs some data interchange format classes.
There's currently Zend_Json.  Instead of Zend_Xml, Zend_Yaml, etc., I
think these should be collected under an interface that implements common
functions like reading, writing, validating, and so on.

Maybe it could be called Zend_Data.  Zend_Json would become
Zend_Data_Json, Zend_Data_Xml would basically be a wrapper around
SimpleXml, and Zend_Data_Yaml would be from scratch.  The Ini format being
discussed for Zend_Config could be Zend_Data_Ini, and Zend_Config would
simply take in a Zend_Data_Interface object in the constructor and read()
it.  The resulting object would be identical regardless.

Translation methods could be added later.  If I have $xml (an object of
type Zend_Data_Xml), it would be great to be able to say $json =
$xml->toJson();

Thoughts?

-Matt

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Data interchange formats

Stefan Koopmanschap
I really really second this call. What a very good idea! This would make data even more portable and passing around data much easier.

On 5/15/06, Matthew Ratzloff <[hidden email]> wrote:
It seems that Zend Framework needs some data interchange format classes.
There's currently Zend_Json.  Instead of Zend_Xml, Zend_Yaml, etc., I
think these should be collected under an interface that implements common
functions like reading, writing, validating, and so on.

Maybe it could be called Zend_Data.  Zend_Json would become
Zend_Data_Json, Zend_Data_Xml would basically be a wrapper around
SimpleXml, and Zend_Data_Yaml would be from scratch.  The Ini format being
discussed for Zend_Config could be Zend_Data_Ini, and Zend_Config would
simply take in a Zend_Data_Interface object in the constructor and read()
it.  The resulting object would be identical regardless.

Translation methods could be added later.  If I have $xml (an object of
type Zend_Data_Xml), it would be great to be able to say $json =
$xml->toJson();

Thoughts?

-Matt




--
Stefan Koopmanschap
http://www.stefankoopmanschap.nl/
http://www.leftontheweb.com/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Data interchange formats

Elisamuel Resto
I like this idea, as it leaves space for inter-operability with the
rest of the framework.
Loading...