Re: Question about OpenDocument API development

From: Date: Tue, 23 Jun 2009 06:36:44 +0000
Subject: Re: Question about OpenDocument API development
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-52029@lists.php.net to get a copy of this message
Christian Weiske wrote: > Currently, every single element class (+ the opendocument one) implements the create*() methods > itself, redirecting the calls to the element::instance() methods. What I don't like is that, > when adding support for a new element - e.g. lists - I have to do this in every single element class > that supports it! > > So there needs to be a better way - for example using __call and throwing exceptions in the > cases the element-to-be-created is not supported. I could also try to find class hierarchies with > elements that are supported in certain classes only, and base them all off a common element class. In my book grouping classes and basing them of common base classes sounds like the cleanest approach in this situation. > The problem with that approach is that I don't know yet if that hierarchy is tree-like or > not. I don't know how much time you are willing to invest in the theory behind OpenDocument. But getting intimate with its format and structure can't be a bad thing, right? :) Martin

« previous php.pear.dev (#52029) next »