[Zope-dev] Is there a de facto standard for manage_add() behavior?

Craeg K Strong cstrong@arielpartners.com
Tue, 16 Apr 2002 17:25:20 -0400


Hello:

I have a question about style.  

My ExternalFile product enables one to create zope objects that behave 
like DTML methods
or DTML documents but point to external files for their content.   The 
creation routines
handle many different possible cases

- external file does not exist yet, create it blank
- external file exists
- external file does not exist yet, upload a file and create it with 
uploaded content

etc, etc.

My manage_add() routine handles all of these cases, posting up 
confirmation dialogs, etc. when
necessary.  It then calls either

create_file() and/or
create_object()

to actually _create_ the external file (if necessary) and the 
ExternalFile instance (always).

The problem is this:  many users create ExternalFile instances 
programmatically.   To do this,
they expect to call manage_add()   when instead (according to my design) 
they should be calling
create_object() directly.

The question is-- am I violating some kind of de facto Zope standard?   
Is manage_add() supposed to
silently create an object without any sort of confirmation dialogs?   Or 
is this a simple case of
insufficient documentation-- I should make it more clear in the docs 
which methods to call in order
to create programmatically?

Of course, with Zope3 this wouldn't be an issue, because you have 
pluggable GUIs.  Don't like the default
dialogs? Plug in your own with by changing the deployment descriptor...  

In the meantime, however-- for Zope 2x, what do the Zope style mavens 
suggest?

Regards,

--Craeg