Should I disclose actions instead of events?

While working with WF 4.0, I noticed that the WorkflowApplication class provides action properties (Aborted, Complete, etc.) instead of events. Is there a specific reason? When should properties of an action be preferred over events?

thank

+9
c # lambda
07 Oct 2018-10-10 at
source share
3 answers

I sent an email to one member of the WF team and, kindly, he answered me. He told me that events and actions are almost equivalent, but the team feels better with the API using actions.

+1
08 Oct '10 at 8:35
source share

Wow; I see what you mean ; it really surprises me.

However, if you cannot think of a good reason to use properties here (and I cannot), then stick with event s; they avoid a lot of problems (accidentally unsubscribing and incorrect calling are the biggest). A.

The only thing I can think of is that maybe they needed it for serialization purposes, but I can think of other ways to crack this nut. Alternatively, perhaps regular events do not make sense in the crazy state of the “dependency” / “attached property” / “routed event” of the WF world. A.

+6
Oct 07 '10 at 5:57
source share

Edit: the following is inaccurate, see Project Commentary below.

On the one hand, events allow the use of several handlers, and the Action property allows only one handler. Yes, the Action property can translate itself, but it is not very connected or idiomatic.

I am with Mark on this, I am surprised that they used Action properties instead of standard events.

+3
Oct 07 2018-10-10T00:
source share



All Articles