With
the 'add' mode included, however, its behavior on retrieval is
the same, but its behavior on submission changes. If the primary
key is submitted, the node behaves essentially like an edit
node, except that it requires all non-nullables to be included
in the submission. If the primary key is not submitted, the node
simply adds the record to the table, after using the table's key
generation mechanism (such as select max or getting from an
Oracle sequence or a key generator object if one is provided) to
generate the key.
To quote an instance, an Edit UDM for editing contacts will
do a double duty. If you invoke it with a
parameter, you are editing an existing contact, otherwise you
are adding a new contact.
The main advantage of creating this kind of dual-purpose UDM is
to reuse code and reduce effort. You expend all this effort to
build an edit UDM, so you might as well reuse it for adding new
data.
|