[dojo-contributors] XmlStore - what are advised extending patterns

Sasha Firsov suns at firsov.net
Fri Jun 15 10:39:57 EDT 2012


XmlStore as base for several extensions is ready( not for release 
though). Now it is time to extend memory-only store with url Read, 
Write, multiple data feeds, etc.
This hierarchy kind of  into straight inheritance similar to Java/C 
streams.
     XmlStore - (Read | Write) - Compound


Another aspect of XmlStore that while it follows dojo.store interface 
the object type it natively work with is XmlElement instead of POJsO(js 
object). And it does not fit into existing dijits. XmlStoreJso meant to 
wrap XmlElement and provide JS hash interface.

The confusing part is where to fit it. On one hand this wrapper is 
perfect candidate for mix-in which could be applied on top of each class 
in the chain. From another it should not replace any methods, just 
intercept them.

While C interfaces are capable to be parametrized by type( Coumpound 
could carry either Read or Write or both), JS has own ways. AOP, mix-in, 
plugin and customer-assembled classes(as in dgrid), etc.

Your wishes and advises? Asking contributors list as XmlStore package 
meant to be contribution candidate.

Cheers,
Sasha

PS. Work is in progress, tested against Chrome only. For curious the 
sources:
https://bitbucket.org/sasha.firsov/dojoplay2012/src/1b5b0949c64d/lib/DAL
http://simulationlabs.com/dojo/DojoPlay2012/libcommon/DTK1.7/util/doh/runner.html?testModule=lib.DAL.XmlStore.test.test&paths=lib,../../../lib 
<http://simulationlabs.com/dojo/DojoPlay2012/libcommon/DTK1.7/util/doh/runner.html?testModule=lib.DAL.XmlStore.test.test&paths=lib,../../../lib>

PPS. Note the QueryEngine 
<https://bitbucket.org/sasha.firsov/dojoplay2012/src/1b5b0949c64d/lib/DAL/XmlQueryEngine> 
has been extended with undefined field and function as field filter [in 
addition to object.test() ] I guess it worth to port back some features.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.dojotoolkit.org/pipermail/dojo-contributors/attachments/20120615/0d1c18d1/attachment.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3861 bytes
Desc: S/MIME Cryptographic Signature
Url : http://mail.dojotoolkit.org/pipermail/dojo-contributors/attachments/20120615/0d1c18d1/attachment.p7s 


More information about the dojo-contributors mailing list