Andreas Hartmann wrote:
Hi Lenya devs,
recently there was a discussion about the Creator interface in 1.4. I guess some of you lost track, so I'd like to summarize a question that IMO should be discussed:
Do we want to keep the Creator mechanism? An alternative would be to handle specific creation mechanisms in usecases. The usecase framework provides an easy-to-use approach for overriding usecases in publications, as already used in the blog publication.
The basic question is if we need a configurable doctype-based creation polymorphism. IMO we don't - it is not too hard to implement something like that in a publication. This would be more flexible, and would probably allow better mechanisms than the current parameter map.
I agree that it's complicated at the moment and stuff grew historically.
Neverthless I still think we should offer some kind of "framework".
IIUC the question is this:
should Lenya provide, in its core, a doctype-specific mechanism for creating documents of this doctype ? Or, should the core mechanism be publication-wide; meaning the default mechanism is the same for all documents in a publication, regardless of its doctype ?
What we now have is this:
the doctype configuration specifies which class is used to create a document of this type. In default & blog pubs, the way they are now in the Lenya source base, this feature is not used: the types in default use one class, the type in blog uses another; so the knowledge of how documents are created is (de facto) publication-wide, and not doctype specific.
Has anybody using Lenya implemented a doctype which requires another creation mechanism than another doctype in the same publication ? Or, can anybody come up with a meaningful scenario where this would be needed ?
I can't think of such a scenario right now :) Furthermore, the current framework is actually dangerous, which I painfully found out last week. The way document ids are mapped to Lenya paths is defined as a publication-wide mechanism (configured in publication.xconf); but if the individual document creator specifies an id creation mechanism which is different from what is expected for the publication (this was the case in blog), you have an incompatibility between the publication and some or all of its documents.
Plus, I agree with Andreas' comments re. the magic parameter map being passed through now, being suboptimal.
So, unless somebody comes up with scenarios where doctype-specific creation is required, here is my
+1 to completely remove the doctype creator and move any knowledge currently there to publication code.
What exactly "publication code" means is then a subject of debate ;) We can put this knowledge in the usecases as Andreas pointed out, which are already pub-specific. Or maybe we can provide some smarter mechanism, configured via the publication.xconf, to reduce the amount of code in the individual usecases.
-- Wolfgang
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
