Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: Dev

z3c.schema2xml and z3c.schema2json

 

 

Zope dev RSS feed   Index | Next | Previous | View Threaded


janwijbrand at gmail

Nov 25, 2009, 4:11 AM

Post #1 of 3 (636 views)
Permalink
z3c.schema2xml and z3c.schema2json

Hi,

I'm about to work a bit on z3c.schema2json [1]. As has been briefly
discussed before (a while ago [2]), z3c. schema2json is so similar to
z3c.schema2xml [3] in what it does and how it does it, that I wonder
about merging the two packages somehow.

One way to do this - maybe - is to use named registrations for the
(de)serialization adapters. The name could reflect the serialization
"mode" - for example "xml" or "json".

But maybe there're other ideas to achieve this? Or, could it be that
merging has no real benefit?

regards,
jw

[1] http://svn.zope.org/Sandbox/paulwilson/z3c.schema2json/
[2] https://mail.zope.org/pipermail/zope-dev/2009-June/037091.html
[3] http://svn.zope.org/z3c.schema2xml/

_______________________________________________
Zope-Dev maillist - Zope-Dev [at] zope
https://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope )


faassen at startifact

Nov 26, 2009, 1:44 AM

Post #2 of 3 (581 views)
Permalink
Re: z3c.schema2xml and z3c.schema2json [In reply to]

Hey,

Jan-Wijbrand Kolman wrote:
> I'm about to work a bit on z3c.schema2json [1]. As has been briefly
> discussed before (a while ago [2]), z3c. schema2json is so similar to
> z3c.schema2xml [3] in what it does and how it does it, that I wonder
> about merging the two packages somehow.
>
> One way to do this - maybe - is to use named registrations for the
> (de)serialization adapters. The name could reflect the serialization
> "mode" - for example "xml" or "json".
>
> But maybe there're other ideas to achieve this? Or, could it be that
> merging has no real benefit?

I'm still not sure there'd be a real benefit. It depends on how much
code would end up being shared. If a lot of code is shared it might make
sense to merge them (or factor the code out into a general schema-based
serialization and deserialization framework). If it turns out your
improvements to z3c.schema2json also make sense in z3c.schema2xml then
that's an argument in favor of sharing code between them.

Regards,

Martijn




_______________________________________________
Zope-Dev maillist - Zope-Dev [at] zope
https://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope )


paulalexwilson at gmail

Nov 26, 2009, 7:56 AM

Post #3 of 3 (576 views)
Permalink
Re: z3c.schema2xml and z3c.schema2json [In reply to]

2009/11/26 Martijn Faassen <faassen [at] startifact>:
> Hey,
>
> Jan-Wijbrand Kolman wrote:
>> I'm about to work a bit on z3c.schema2json [1]. As has been briefly
>> discussed before (a while ago [2]), z3c. schema2json is so similar to
>> z3c.schema2xml [3] in what it does and how it does it, that I wonder
>> about merging the two packages somehow.
>>
>> One way to do this - maybe - is to use named registrations for the
>> (de)serialization adapters. The name could reflect the serialization
>> "mode" - for example "xml" or "json".
>>
>> But maybe there're other ideas to achieve this? Or, could it be that
>> merging has no real benefit?
>
> I'm still not sure there'd be a real benefit. It depends on how much
> code would end up being shared. If a lot of code is shared it might make
> sense to merge them (or factor the code out into a general schema-based
> serialization and deserialization framework). If it turns out your
> improvements to z3c.schema2json also make sense in z3c.schema2xml then
> that's an argument in favor of sharing code between them.

I can't see much core code being shared to be honest. However, the
benefits of merging would be more apparent to clients of these modules
who want to be able to use z3c.schema2json and z3c.schema2xml together
to support both serialization formats.

I can see two use cases from the perspective of client code:

* I want to have my objects serialized and deserialized but don't
want to know what format is used, just use an agnostic interface
(z3c.autoinclude wires the correct implementation from the list of
dependencies).
* I want to present a list of possible serialization formats and have
the user select the appropriate one.

Thanks,
Paul
_______________________________________________
Zope-Dev maillist - Zope-Dev [at] zope
https://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope )

Zope dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.