|
Re: Initializing a containment list from the containing object? [message #425384 is a reply to message #425383] |
Sun, 23 November 2008 19:15 |
|
Bryan,
Because of the expected problem during deserialization it is not
possible to let a model implicitely create containment structures. Well,
you could inspect the stack to see if "you are in a load operation". But
this looks hacky. In general an EFactory is expected to create bare objects.
The only way is to add custom create methods to the factory which can be
used by the application, as you already indicated.
Cheers
/Eike
----
http://thegordian.blogspot.com
Bryan Hunt schrieb:
> In my workflow model, WorkflowUnitOfWork has a containment list of
> WorkflowParameter. Consider the use case where a designer extends
> WorkflowUnitOfWork to perform a domain specific task that is
> parameterized with a fixed set of parameters. Is there a good way to
> initialize the parameter list from the extended class?
>
> I can't initialize the parameter list in the constructor since I'll
> get duplicate parameters when the model is de-serialized. I thought
> about making the parameters transient, but that doesn't work because
> the parameters are used (serialized references) by the
> WorkflowContext, and therefore must have a container. Are there any
> hooks I can use to determine that the instance is being constructed
> because it's loading from serialized form vs being constructed from
> nothing? Any other obvious solution to this problem?
>
> One solution is to require the designer to specify the parameter list
> using the generated editor and have the code make assumptions about
> the order of the parameter list to locate a specific parameter. I
> really don't like this solution.
>
> Bryan
>
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
Powered by
FUDForum. Page generated in 0.03561 seconds