Sebastian,

If you look at a generated SDO class, you'll notice that, by default, all
the setXXX() methods include some code that notifies observers of the
object that a change has happened:

    if (isNotifying())
      notify(ChangeKind.SET, ...);

The only part of SDO that relies on this, is the ChangeSummary support -
that is, if you have a ChangeSummary and call cs.beginLogging(), the logger
registers itself as a change observer of all the objects in the
ChangeSummary's scope.

The -noNotification option is really just an experimental option that tells
the generator to not generate the notification calls, to increase the
performance of the set() methods. I believe we concluded this speedup is
not very significant, so the option is not recommended. As you might guess,
you cannot use classes generated this way in an application that uses a
ChangeSummary.

For your second question, Factory.register() is used to define types with
static implementation classes. Load from XSD is used for dynamic SDO types.

Frank


"Millies, Sebastian" <[email protected]> wrote on 10/05/2010
03:07:51 AM:

> [image removed]
>
> [SDO] Samples for notification feature / register ?
>
> Millies, Sebastian
>
> to:
>
> user
>
> 10/05/2010 03:08 AM
>
> Please respond to user
>
> Hello there,
>
> The XSD2JavaGenerator has a feature to enable/disable coding for
notification.
>
> Can anyone point me to a tutorial/example about how this notification
feature
> works and what it is used for? There seems to be nothing in the samples
in
> the SDO release distribution archives (as revealed by a text search
> on ?notify?).
>
> Another question: when would I explicitly use the Factory.register
> (HelperContext),
> of the generated factory classes and how does it relate to coding like
this:
>         HelperContext scope = createScopeForTypes();
>         loadTypesFromXMLSchemaFile(scope, mytypes.xsd);
>         DataObject myobj = scope.getDataFactory().create
> (mynamespace, "desiredType");
>
> Again, there doesn't seem to be an example, or I have overlooked it.
>
> -- Sebastian

Reply via email to