Administrator
|
I really like Announcements! It's so much easier to update complex GUIs when you can pass state :)
I hit one glitch when unsubscribing... The CollaborActive book suggests unsubscribing in #delete. For complex UIs, this doesn't seem to work because #delete is only called for the one morph that was deleted, not for its submorphs (which may need to unsubscribe). I tried this: MyMorph>>delete super delete. "Must come first. Deleting a submorph before self = emergency evaluator" aSubmorphThatNeedsToUnsubscribe delete. SubmorphMentionedAbove>>delete self inventory announcer unsubscribe: self. super delete. But it seems like a lot of work and coupling. Is there no hook that is guaranteed to be called when a morph is going away - i.e. it or a morph in the owner chain is being deleted? Thanks. Sean
Cheers,
Sean |
Two comments:
(1) there needs to be a way to unregister interest; (2) the registrations need to be weak so that (1) is largely optional. If Dolphin has a weakness, it is that failure of an MVP triad to open can leave the system in a confused state. Morphic appears to be a little more robust about that, though in fairness, I do not push Pharo's GUI nearly as hard as I have Dolphin's. If in doubt, some type of #ifCurtailed: or similar protection around the assembly of a complex morph might be a good idea. ________________________________________ From: [hidden email] [[hidden email]] On Behalf Of Sean P. DeNigris [[hidden email]] Sent: Monday, January 17, 2011 1:18 AM To: [hidden email] Subject: [Pharo-project] Unsubscribing for Announcements I really like Announcements! It's so much easier to update complex GUIs when you can pass state :) I hit one glitch when unsubscribing... The CollaborActive book suggests unsubscribing in #delete. For complex UIs, this doesn't seem to work because #delete is only called for the one morph that was deleted, not for its submorphs (which may need to unsubscribe). I tried this: MyMorph>>delete super delete. "Must come first. Deleting a submorph before self = emergency evaluator" aSubmorphThatNeedsToUnsubscribe delete. SubmorphMentionedAbove>>delete self inventory announcer unsubscribe: self. super delete. But it seems like a lot of work and coupling. Is there no hook that is guaranteed to be called when a morph is going away - i.e. it or a morph in the owner chain is being deleted? Thanks. Sean -- View this message in context: http://forum.world.st/Unsubscribing-for-Announcements-tp3220751p3220751.html Sent from the Pharo Smalltalk mailing list archive at Nabble.com. |
Two comments:
(1) there needs to be a way to unregister interest; (2) the registrations need to be weak so that (1) is largely optional. If Dolphin has a weakness, it is that failure of an MVP triad to open can leave the system in a confused state. Morphic appears to be a little more robust about that, though in fairness, I do not push Pharo's GUI nearly as hard as I have Dolphin's. If in doubt, some type of #ifCurtailed: or similar protection around the assembly of a complex morph might be a good idea. ________________________________________ From: [hidden email] [[hidden email]] On Behalf Of Sean P. DeNigris [[hidden email]] Sent: Monday, January 17, 2011 1:18 AM To: [hidden email] Subject: [Pharo-project] Unsubscribing for Announcements I really like Announcements! It's so much easier to update complex GUIs when you can pass state :) I hit one glitch when unsubscribing... The CollaborActive book suggests unsubscribing in #delete. For complex UIs, this doesn't seem to work because #delete is only called for the one morph that was deleted, not for its submorphs (which may need to unsubscribe). I tried this: MyMorph>>delete super delete. "Must come first. Deleting a submorph before self = emergency evaluator" aSubmorphThatNeedsToUnsubscribe delete. SubmorphMentionedAbove>>delete self inventory announcer unsubscribe: self. super delete. But it seems like a lot of work and coupling. Is there no hook that is guaranteed to be called when a morph is going away - i.e. it or a morph in the owner chain is being deleted? Thanks. Sean -- View this message in context: http://forum.world.st/Unsubscribing-for-Announcements-tp3220751p3220751.html Sent from the Pharo Smalltalk mailing list archive at Nabble.com. |
In reply to this post by Sean P. DeNigris
Den 17.01.2011 07:18, skrev Sean P. DeNigris:
> I really like Announcements! It's so much easier to update complex GUIs when > you can pass state :) > > I hit one glitch when unsubscribing... The CollaborActive book suggests > unsubscribing in #delete. For complex UIs, this doesn't seem to work > because #delete is only called for the one morph that was deleted, not for > its submorphs (which may need to unsubscribe). > > I tried this: > MyMorph>>delete > super delete. "Must come first. Deleting a submorph before self = > emergency evaluator" > aSubmorphThatNeedsToUnsubscribe delete. > > SubmorphMentionedAbove>>delete > self inventory announcer unsubscribe: self. > super delete. > > > But it seems like a lot of work and coupling. Is there no hook that is > guaranteed to be called when a morph is going away - i.e. it or a morph in > the owner chain is being deleted? > > Thanks. > Sean self and submorphs as part of #removeMorph: So I THINK you'd get away with: SubmorphMentionedAbove>>outOfWorld: aWorld self inventory announcer unsubscribe: self. super outOfWorld: aWorld . Cheers, Henry |
In reply to this post by Schwab,Wilhelm K
Yes but having good weakstructure will not arrive by accident.
On Jan 17, 2011, at 4:34 PM, Schwab,Wilhelm K wrote: > Two comments: > > (1) there needs to be a way to unregister interest; > (2) the registrations need to be weak so that (1) is largely optional. > > If Dolphin has a weakness, it is that failure of an MVP triad to open can leave the system in a confused state. Morphic appears to be a little more robust about that, though in fairness, I do not push Pharo's GUI nearly as hard as I have Dolphin's. If in doubt, some type of #ifCurtailed: or similar protection around the assembly of a complex morph might be a good idea. > > > ________________________________________ > From: [hidden email] [[hidden email]] On Behalf Of Sean P. DeNigris [[hidden email]] > Sent: Monday, January 17, 2011 1:18 AM > To: [hidden email] > Subject: [Pharo-project] Unsubscribing for Announcements > > I really like Announcements! It's so much easier to update complex GUIs when > you can pass state :) > > I hit one glitch when unsubscribing... The CollaborActive book suggests > unsubscribing in #delete. For complex UIs, this doesn't seem to work > because #delete is only called for the one morph that was deleted, not for > its submorphs (which may need to unsubscribe). > > I tried this: > MyMorph>>delete > super delete. "Must come first. Deleting a submorph before self = > emergency evaluator" > aSubmorphThatNeedsToUnsubscribe delete. > > SubmorphMentionedAbove>>delete > self inventory announcer unsubscribe: self. > super delete. > > > But it seems like a lot of work and coupling. Is there no hook that is > guaranteed to be called when a morph is going away - i.e. it or a morph in > the owner chain is being deleted? > > Thanks. > Sean > -- > View this message in context: http://forum.world.st/Unsubscribing-for-Announcements-tp3220751p3220751.html > Sent from the Pharo Smalltalk mailing list archive at Nabble.com. > > |
Of course. But when the status quo has been robustly defended, it seems reasonable to lobby for change as a start.
________________________________________ From: [hidden email] [[hidden email]] On Behalf Of Stéphane Ducasse [[hidden email]] Sent: Tuesday, January 18, 2011 2:22 PM To: [hidden email] Subject: Re: [Pharo-project] Unsubscribing for Announcements Yes but having good weakstructure will not arrive by accident. On Jan 17, 2011, at 4:34 PM, Schwab,Wilhelm K wrote: > Two comments: > > (1) there needs to be a way to unregister interest; > (2) the registrations need to be weak so that (1) is largely optional. > > If Dolphin has a weakness, it is that failure of an MVP triad to open can leave the system in a confused state. Morphic appears to be a little more robust about that, though in fairness, I do not push Pharo's GUI nearly as hard as I have Dolphin's. If in doubt, some type of #ifCurtailed: or similar protection around the assembly of a complex morph might be a good idea. > > > ________________________________________ > From: [hidden email] [[hidden email]] On Behalf Of Sean P. DeNigris [[hidden email]] > Sent: Monday, January 17, 2011 1:18 AM > To: [hidden email] > Subject: [Pharo-project] Unsubscribing for Announcements > > I really like Announcements! It's so much easier to update complex GUIs when > you can pass state :) > > I hit one glitch when unsubscribing... The CollaborActive book suggests > unsubscribing in #delete. For complex UIs, this doesn't seem to work > because #delete is only called for the one morph that was deleted, not for > its submorphs (which may need to unsubscribe). > > I tried this: > MyMorph>>delete > super delete. "Must come first. Deleting a submorph before self = > emergency evaluator" > aSubmorphThatNeedsToUnsubscribe delete. > > SubmorphMentionedAbove>>delete > self inventory announcer unsubscribe: self. > super delete. > > > But it seems like a lot of work and coupling. Is there no hook that is > guaranteed to be called when a morph is going away - i.e. it or a morph in > the owner chain is being deleted? > > Thanks. > Sean > -- > View this message in context: http://forum.world.st/Unsubscribing-for-Announcements-tp3220751p3220751.html > Sent from the Pharo Smalltalk mailing list archive at Nabble.com. > > |
Who defended what status quo?
The WeakAnnouncement are already on the agenda for 1.3. Cheers, Doru On 18 Jan 2011, at 20:40, Schwab,Wilhelm K wrote: > Of course. But when the status quo has been robustly defended, it seems reasonable to lobby for change as a start. > > > > ________________________________________ > From: [hidden email] [[hidden email]] On Behalf Of Stéphane Ducasse [[hidden email]] > Sent: Tuesday, January 18, 2011 2:22 PM > To: [hidden email] > Subject: Re: [Pharo-project] Unsubscribing for Announcements > > Yes but having good weakstructure will not arrive by accident. > > > On Jan 17, 2011, at 4:34 PM, Schwab,Wilhelm K wrote: > >> Two comments: >> >> (1) there needs to be a way to unregister interest; >> (2) the registrations need to be weak so that (1) is largely optional. >> >> If Dolphin has a weakness, it is that failure of an MVP triad to open can leave the system in a confused state. Morphic appears to be a little more robust about that, though in fairness, I do not push Pharo's GUI nearly as hard as I have Dolphin's. If in doubt, some type of #ifCurtailed: or similar protection around the assembly of a complex morph might be a good idea. >> >> >> ________________________________________ >> From: [hidden email] [[hidden email]] On Behalf Of Sean P. DeNigris [[hidden email]] >> Sent: Monday, January 17, 2011 1:18 AM >> To: [hidden email] >> Subject: [Pharo-project] Unsubscribing for Announcements >> >> I really like Announcements! It's so much easier to update complex GUIs when >> you can pass state :) >> >> I hit one glitch when unsubscribing... The CollaborActive book suggests >> unsubscribing in #delete. For complex UIs, this doesn't seem to work >> because #delete is only called for the one morph that was deleted, not for >> its submorphs (which may need to unsubscribe). >> >> I tried this: >> MyMorph>>delete >> super delete. "Must come first. Deleting a submorph before self = >> emergency evaluator" >> aSubmorphThatNeedsToUnsubscribe delete. >> >> SubmorphMentionedAbove>>delete >> self inventory announcer unsubscribe: self. >> super delete. >> >> >> But it seems like a lot of work and coupling. Is there no hook that is >> guaranteed to be called when a morph is going away - i.e. it or a morph in >> the owner chain is being deleted? >> >> Thanks. >> Sean >> -- >> View this message in context: http://forum.world.st/Unsubscribing-for-Announcements-tp3220751p3220751.html >> Sent from the Pharo Smalltalk mailing list archive at Nabble.com. >> >> > > > -- www.tudorgirba.com "Every thing has its own flow." |
In reply to this post by Schwab,Wilhelm K
Who defended what status quo?
The WeakAnnouncement are already on the agenda for 1.3. Cheers, Doru On 18 Jan 2011, at 20:40, Schwab,Wilhelm K wrote: > Of course. But when the status quo has been robustly defended, it seems reasonable to lobby for change as a start. > > > > ________________________________________ > From: [hidden email] [[hidden email]] On Behalf Of Stéphane Ducasse [[hidden email]] > Sent: Tuesday, January 18, 2011 2:22 PM > To: [hidden email] > Subject: Re: [Pharo-project] Unsubscribing for Announcements > > Yes but having good weakstructure will not arrive by accident. > > > On Jan 17, 2011, at 4:34 PM, Schwab,Wilhelm K wrote: > >> Two comments: >> >> (1) there needs to be a way to unregister interest; >> (2) the registrations need to be weak so that (1) is largely optional. >> >> If Dolphin has a weakness, it is that failure of an MVP triad to open can leave the system in a confused state. Morphic appears to be a little more robust about that, though in fairness, I do not push Pharo's GUI nearly as hard as I have Dolphin's. If in doubt, some type of #ifCurtailed: or similar protection around the assembly of a complex morph might be a good idea. >> >> >> ________________________________________ >> From: [hidden email] [[hidden email]] On Behalf Of Sean P. DeNigris [[hidden email]] >> Sent: Monday, January 17, 2011 1:18 AM >> To: [hidden email] >> Subject: [Pharo-project] Unsubscribing for Announcements >> >> I really like Announcements! It's so much easier to update complex GUIs when >> you can pass state :) >> >> I hit one glitch when unsubscribing... The CollaborActive book suggests >> unsubscribing in #delete. For complex UIs, this doesn't seem to work >> because #delete is only called for the one morph that was deleted, not for >> its submorphs (which may need to unsubscribe). >> >> I tried this: >> MyMorph>>delete >> super delete. "Must come first. Deleting a submorph before self = >> emergency evaluator" >> aSubmorphThatNeedsToUnsubscribe delete. >> >> SubmorphMentionedAbove>>delete >> self inventory announcer unsubscribe: self. >> super delete. >> >> >> But it seems like a lot of work and coupling. Is there no hook that is >> guaranteed to be called when a morph is going away - i.e. it or a morph in >> the owner chain is being deleted? >> >> Thanks. >> Sean >> -- >> View this message in context: http://forum.world.st/Unsubscribing-for-Announcements-tp3220751p3220751.html >> Sent from the Pharo Smalltalk mailing list archive at Nabble.com. >> >> > > > -- www.tudorgirba.com "Every thing has its own flow." |
Administrator
|
In reply to this post by Henrik Sperre Johansen
:) Good thought, and thanks for looking into it! However, that was my idea too; and it doesn't work. #outOfWorld: is also called when you embed a Morph in another Morph, for instance. So, even if the Morph is still open in the world, the subscriber list is hosed. Also, when #outOfWorld: is called, there is not enough context to tell whether it is being deleted or embedded, because the actual move happens after. Sean
Cheers,
Sean |
Administrator
|
In reply to this post by Tudor Girba
Ah, very good! Sean
Cheers,
Sean |
In reply to this post by Tudor Girba
Take a look in this thread:
http://thread.gmane.org/gmane.comp.lang.smalltalk.pharo.devel/15001/focus=15167 ________________________________________ From: [hidden email] [[hidden email]] On Behalf Of Tudor Girba [[hidden email]] Sent: Tuesday, January 18, 2011 2:52 PM To: [hidden email] Subject: Re: [Pharo-project] Unsubscribing for Announcements Who defended what status quo? The WeakAnnouncement are already on the agenda for 1.3. Cheers, Doru On 18 Jan 2011, at 20:40, Schwab,Wilhelm K wrote: > Of course. But when the status quo has been robustly defended, it seems reasonable to lobby for change as a start. > > > > ________________________________________ > From: [hidden email] [[hidden email]] On Behalf Of Stéphane Ducasse [[hidden email]] > Sent: Tuesday, January 18, 2011 2:22 PM > To: [hidden email] > Subject: Re: [Pharo-project] Unsubscribing for Announcements > > Yes but having good weakstructure will not arrive by accident. > > > On Jan 17, 2011, at 4:34 PM, Schwab,Wilhelm K wrote: > >> Two comments: >> >> (1) there needs to be a way to unregister interest; >> (2) the registrations need to be weak so that (1) is largely optional. >> >> If Dolphin has a weakness, it is that failure of an MVP triad to open can leave the system in a confused state. Morphic appears to be a little more robust about that, though in fairness, I do not push Pharo's GUI nearly as hard as I have Dolphin's. If in doubt, some type of #ifCurtailed: or similar protection around the assembly of a complex morph might be a good idea. >> >> >> ________________________________________ >> From: [hidden email] [[hidden email]] On Behalf Of Sean P. DeNigris [[hidden email]] >> Sent: Monday, January 17, 2011 1:18 AM >> To: [hidden email] >> Subject: [Pharo-project] Unsubscribing for Announcements >> >> I really like Announcements! It's so much easier to update complex GUIs when >> you can pass state :) >> >> I hit one glitch when unsubscribing... The CollaborActive book suggests >> unsubscribing in #delete. For complex UIs, this doesn't seem to work >> because #delete is only called for the one morph that was deleted, not for >> its submorphs (which may need to unsubscribe). >> >> I tried this: >> MyMorph>>delete >> super delete. "Must come first. Deleting a submorph before self = >> emergency evaluator" >> aSubmorphThatNeedsToUnsubscribe delete. >> >> SubmorphMentionedAbove>>delete >> self inventory announcer unsubscribe: self. >> super delete. >> >> >> But it seems like a lot of work and coupling. Is there no hook that is >> guaranteed to be called when a morph is going away - i.e. it or a morph in >> the owner chain is being deleted? >> >> Thanks. >> Sean >> -- >> View this message in context: http://forum.world.st/Unsubscribing-for-Announcements-tp3220751p3220751.html >> Sent from the Pharo Smalltalk mailing list archive at Nabble.com. >> >> > > > -- www.tudorgirba.com "Every thing has its own flow." |
Administrator
|
In reply to this post by Sean P. DeNigris
Bump... What is the status of this? Also, what are people doing in the mean time? I don't see a way to safely use Announcements without automatic unsubscribing. I have not found a hook in Morphic that's guaranteed to be called. Sean
Cheers,
Sean |
On 17 November 2011 05:17, Sean P. DeNigris <[hidden email]> wrote:
> > Tudor Girba wrote: >> >> The WeakAnnouncement are already on the agenda for 1.3. >> > > Bump... > What is the status of this? Also, what are people doing in the mean time? I > don't see a way to safely use Announcements without automatic unsubscribing. > I have not found a hook in Morphic that's guaranteed to be called. > annoucer weak on: Announcement send: #foo to: self. when self will die, so its subscription. > Sean > > -- > View this message in context: http://forum.world.st/Unsubscribing-for-Announcements-tp3220751p4078804.html > Sent from the Pharo Smalltalk mailing list archive at Nabble.com. > > -- Best regards, Igor Stasenko. |
On 17 Nov 2011, at 05:46, Igor Stasenko wrote:
> On 17 November 2011 05:17, Sean P. DeNigris <[hidden email]> wrote: >> >> Tudor Girba wrote: >>> >>> The WeakAnnouncement are already on the agenda for 1.3. >>> >> >> Bump... >> What is the status of this? Also, what are people doing in the mean time? I >> don't see a way to safely use Announcements without automatic unsubscribing. >> I have not found a hook in Morphic that's guaranteed to be called. >> > > annoucer weak on: Announcement send: #foo to: self. > > when self will die, so its subscription. This works since quite a while. I use it in Glamour extensively. Cheers, Doru >> Sean >> >> -- >> View this message in context: http://forum.world.st/Unsubscribing-for-Announcements-tp3220751p4078804.html >> Sent from the Pharo Smalltalk mailing list archive at Nabble.com. >> >> > > > > -- > Best regards, > Igor Stasenko. > -- www.tudorgirba.com "Problem solving should be focused on describing the problem in a way that makes the solution obvious." |
Administrator
|
Cool! Is it working well in 1.3 rc? Also, why do we still have the non-weak version? When would that be preferred? Sean
Cheers,
Sean |
On 18 November 2011 04:06, Sean P. DeNigris <[hidden email]> wrote:
> > Tudor Girba-2 wrote: >> >> This works since quite a while. I use it in Glamour extensively. >> > > Cool! Is it working well in 1.3 rc? > > Also, why do we still have the non-weak version? When would that be > preferred? > > Sean > > -- > View this message in context: http://forum.world.st/Unsubscribing-for-Announcements-tp3220751p4081871.html > Sent from the Pharo Smalltalk mailing list archive at Nabble.com. > > -- Best regards, Igor Stasenko. |
Administrator
|
Should the non-weak version be removed and replaced by the weak version (renamed to remove the weak specification)? Or some other consolidation...
Cheers,
Sean |
On 18 November 2011 06:32, Sean P. DeNigris <[hidden email]> wrote:
> > Igor Stasenko wrote: >> >> virtually nowhere :) >> > > Should the non-weak version be removed and replaced by the weak version > (renamed to remove the weak specification)? Or some other consolidation... > Why? Strong subscriptions may be desirable at some point. I imagine, that some models may need to not let subsribers die, even if the only reference to subscriber is strong subscription itself. IMO, it is unusual, since Announcements framework serves as a nice decoupling scheme, which means that in most cases, you want subscription to live as long as subscriber lives and not a bit longer. > -- > View this message in context: http://forum.world.st/Unsubscribing-for-Announcements-tp3220751p4082112.html > Sent from the Pharo Smalltalk mailing list archive at Nabble.com. -- Best regards, Igor Stasenko. |
In reply to this post by Sean P. DeNigris
On 18.11.2011 05:32, Sean P. DeNigris wrote:
> Igor Stasenko wrote: >> virtually nowhere :) >> > Should the non-weak version be removed and replaced by the weak version > (renamed to remove the weak specification)? Or some other consolidation... > > -- > View this message in context: http://forum.world.st/Unsubscribing-for-Announcements-tp3220751p4082112.html > Sent from the Pharo Smalltalk mailing list archive at Nabble.com. > It is valuable whenever you need to deterministically unsubscribe a subscriber at some point. If using weak subscribers, bugs related to not doing so can be hard to track down. (mainly when that point somewhat coincides to when the object also loses its last reference) Second, if you do need to unsubscribe them at some set point in the programs execution, also having it registered for weak cleanup only introduces additional overhead. Third, for the moment at least, when:do: anActionBlock subscription does not work weakly, you are constrained to when:send:to. Cheers, Henry |
Administrator
|
In reply to this post by Igor Stasenko
So it sounds like weak is the vast majority, so maybe have "announcer on:..." which gives you weak subscriptions and "announcer strong on:..." following "Make common things easy, rare things possible"?
Cheers,
Sean |
Free forum by Nabble | Edit this page |