Discussion:
[Erp5-dev] HowToUseTheCmfActivityTool r40
Vincent Pelletier
2010-04-12 13:45:26 UTC
Permalink
Hi.

This mail is about the following wiki page change:
http://www.erp5.org/HowToUseTheCmfActivityTool?action=diff&rev1=39&rev2=40

This change is not as precise as it should be, and as I don't want to just
edit it without explanations, I prefer to send a mail here.

First, I'll start stating the obvious:
CMFActivity provides as way to make executions asynchronous in Zope, in a
transactional manner.

Now, a bit less obvious:
Doing so, it provides 2 main "policies" for such executions:
- factorised executions (SQLDict)
Used with "activate(activity='SQLDict')" or "activate()"
- systematic executions (SQLQueue)
Used with "activate(activity='SQLQueue')"

By "factorised", I mean that when independent transactions trigger activities,
maybe some of those activities have no need to be executed more than once.
A trivial example is when doing 2 consecutive changes on a document, each
change will plan an indexation of modified document. Executing the indexation
operation once is enough to have the latest version in the catalog.

And now, to the point ("points", as they are 2):
- If one wants that each and every activity must be executed, he should use
SQLQueue by specifying it. So the proposed page change advertises a way to
make SQLDict somewhat work like SQLQueue. This is what I don't like in
mentioned change.
- Finally, there is indeed a behaviour in SQLQueue which is surprising when it
first bites you, which is that the decision that 2 activities in SQLDict are
actually to be executed just once is based on a finite (and quite restricted
at that) list of activity properties. Aggravating, SQLDict is the default
behaviour when creating an activity, which makes this behaviour more
dangerous when not known beforehand (but I think backward compatibility will
strongly prevent us from changing this). I believe this should be mentioned
in the wiki page, with the list of activity properties it uses (which gets
extended from time to time).
--
Vincent Pelletier
Yoshinori Okuji
2010-04-13 02:48:47 UTC
Permalink
Post by Vincent Pelletier
Hi.
http://www.erp5.org/HowToUseTheCmfActivityTool?action=diff&rev1=39&rev2=40
This change is not as precise as it should be, and as I don't want to just
edit it without explanations, I prefer to send a mail here.
I don' think so. Wiki exists to edit. If something is wrong, simply edit it
and add your comment when saving it. If you need to say more, this probably
means that you should write more articles on the wiki, but not sending mail at
somewhere else. ;)
Post by Vincent Pelletier
CMFActivity provides as way to make executions asynchronous in Zope, in a
transactional manner.
- factorised executions (SQLDict)
Used with "activate(activity='SQLDict')" or "activate()"
- systematic executions (SQLQueue)
Used with "activate(activity='SQLQueue')"
By "factorised", I mean that when independent transactions trigger
activities, maybe some of those activities have no need to be executed
more than once. A trivial example is when doing 2 consecutive changes on a
document, each change will plan an indexation of modified document.
Executing the indexation operation once is enough to have the latest
version in the catalog.
- If one wants that each and every activity must be executed, he should use
SQLQueue by specifying it. So the proposed page change advertises a way
to make SQLDict somewhat work like SQLQueue. This is what I don't like in
mentioned change.
I don't like, either. But I don't have time to rewrite it nicely, so I only
removed it.
Post by Vincent Pelletier
- Finally, there is indeed a behaviour in SQLQueue which is surprising when
it first bites you, which is that the decision that 2 activities in
SQLDict are actually to be executed just once is based on a finite (and
quite restricted at that) list of activity properties. Aggravating,
SQLDict is the default behaviour when creating an activity, which makes
this behaviour more dangerous when not known beforehand (but I think
backward compatibility will strongly prevent us from changing this). I
believe this should be mentioned in the wiki page, with the list of
activity properties it uses (which gets extended from time to time).
I myself believe that there is no way to prevent the beginners from getting
surprised with activities anyway, because the nature of distributed computing
and soft-realtime makes things so complicated. If I would remake CMFActivity
in long future, I would make the selection of an activity explicit.

BTW, I think it is bad that the terminology is often confused even by people
in Nexedi. "Activity" is an agent / engine planning and executing objects
(e.g. SQLDict). Objects are activated, then they become "Active Objects". But
I see people mistakenly calling active objects "activities" - this kind of
confusion is quite dangerous when teaching. Note that this terminology is not
specific to ERP5. In fact, "Active Object" is a well-known design pattern in
distributed computing.

Regards,
YO
--
Yoshinori Okuji, Nexedi KK President
Nexedi: Consulting and Development of Free / Open Source Software
http://www.nexedi.co.jp/
ERP5: Full Featured High End Open Source ERP
http://www.erp5.com/
ERP5 Wiki: Developer Zone for ERP5 Community
http://www.erp5.org/
Vincent Pelletier
2010-04-13 07:44:15 UTC
Permalink
Post by Yoshinori Okuji
I don' think so. Wiki exists to edit. If something is wrong, simply edit it
and add your comment when saving it. If you need to say more, this probably
means that you should write more articles on the wiki, but not sending mail
at somewhere else. ;)
Right.
Post by Yoshinori Okuji
I don't like, either. But I don't have time to rewrite it nicely, so I only
removed it.
That's what I didn't want to do (at least, not without explanations from
initial mail).
I added a link to this thread in the page, so this doesn't get lost.
Post by Yoshinori Okuji
If I would remake CMFActivity in long future, I would make the selection of
an activity explicit.
+1
Post by Yoshinori Okuji
BTW, I think it is bad that the terminology is often confused even by
people in Nexedi. "Activity" is an agent / engine planning and executing
objects (e.g. SQLDict). Objects are activated, then they become "Active
Objects". But I see people mistakenly calling active objects "activities"
- this kind of confusion is quite dangerous when teaching. Note that this
terminology is not specific to ERP5. In fact, "Active Object" is a
well-known design pattern in distributed computing.
Right, I am confused too about the namings.
There is also the "message" naming used in the code to refer to an active
object, and "active object" in the code is in fact used as container for
asynchronous processing results...
A naming cleanup would make a lot of good, I think (I think of a lexicon in
the wiki which would clearly state what is misnamed in the code, and the
definition of each term).
--
Vincent Pelletier
Bartek Gorny
2010-04-13 08:11:00 UTC
Permalink
Post by Yoshinori Okuji
BTW, I think it is bad that the terminology is often confused even by people
in Nexedi. "Activity" is an agent / engine planning and executing objects
(e.g. SQLDict). Objects are activated, then they become "Active Objects". But
I see people mistakenly calling active objects "activities" - this kind of
confusion is quite dangerous when teaching. Note that this terminology is not
specific to ERP5. In fact, "Active Object" is a well-known design pattern in
distributed computing.
In this case, it is probably because of the "Activities" tab in
portal_activities, which says:

Queued Activities

Warning: Invoking or canceling activities will invoke/cancel all
activities with both the same path and the same method_id.

Warning: Invoking an activity will not run any dependency check.

Bartek
Post by Yoshinori Okuji
Regards,
YO
--
Yoshinori Okuji, Nexedi KK President
Nexedi: Consulting and Development of Free / Open Source Software
http://www.nexedi.co.jp/
ERP5: Full Featured High End Open Source ERP
http://www.erp5.com/
ERP5 Wiki: Developer Zone for ERP5 Community
http://www.erp5.org/
_______________________________________________
Erp5-dev mailing list
Erp5-dev at erp5.org
http://mail.nexedi.com/mailman/listinfo/erp5-dev
--
"Software is largely a service industry operating under the persistent
but unfounded delusion that it is a manufacturing industry."
Eric S.Raymond, "The Magic Cauldron"
Loading...