how to do something after publishing to Store

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
J G
Reply | Threaded
Open this post in threaded view
|

how to do something after publishing to Store

J G
(I encountered some issue so my post my not have been sent out. Sorry
if this is repeating)

Hi,
After publishing to local Store I'd like to do some back up work
however when I check for references to announcement Publishing it
seems to have no client who cares about.
Is it the correct (no harming) to do when: Publishing do:[:work|  work
finished ifTrue:["my backup here" ]] ?
If it is the way then who should be the receiver (announcer) of the
#when:do: message? How can other objects get it?

Thanks a lot.


--
Best Regards,

Jim G
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: how to do something after publishing to Store

Samuel S. Shuster-2
 J G:

> After publishing to local Store I'd like to do some back up work
> however when I check for references to announcement Publishing it
> seems to have no client who cares about.
> Is it the correct (no harming) to do when: Publishing do:[:work|  work
> finished ifTrue:["my backup here" ]] ?
> If it is the way then who should be the receiver (announcer) of the
> #when:do: message? How can other objects get it?


On Announcements in general... There are no specific receiver for Publishing. For Announcements, you can "when:send:" to the superclass of an Announcement and the receiver will get all announcements for all subclasses. This is the case here, StoreProgressView uses StoreWorkActivity which is the superclass of Publishing.

                                And So It Goes
                                     Sames
______________________________________________________________________

Samuel S. Shuster [|]
VisualWorks Engineering, Store Project
Smalltalk Enables Success -- What Are YOU Using?





_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
J G
Reply | Threaded
Open this post in threaded view
|

Re: how to do something after publishing to Store

J G
On Tue, Jun 1, 2010 at 5:02 AM, Samuel S. Shuster
<[hidden email]> wrote:

>  J G:
>
>> After publishing to local Store I'd like to do some back up work
>> however when I check for references to announcement Publishing it
>> seems to have no client who cares about.
>> Is it the correct (no harming) to do when: Publishing do:[:work|  work
>> finished ifTrue:["my backup here" ]] ?
>> If it is the way then who should be the receiver (announcer) of the
>> #when:do: message? How can other objects get it?
>
>
> On Announcements in general... There are no specific receiver for Publishing. For Announcements, you can "when:send:" to the superclass of an Announcement and the receiver will get all announcements for all subclasses. This is the case here, StoreProgressView uses StoreWorkActivity which is the superclass of Publishing.


Thank you Samuel for you answering.
Here I couldn't understand. Should I supposed to send the message to
an instance but not the class? For example:
aStoreProgrssView when: Publishing do:[:p| p finished
ifTrue:[Transcript cr;nextPutAll:'finished publishing']].

If that's true how to get the instance object then?
( I even tried to send this message to those two classes but all failed )

Best Regards,

J G

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
J G
Reply | Threaded
Open this post in threaded view
|

Re: how to do something after publishing to Store

J G
Well I guess I could do this:
StoreWorkActivity notifications when: Publishing do:[:p| p finished
> ifTrue:[Transcript cr;nextPutAll:'finished publishing']].
However the publishing process seems to hang when I do this civil thing :)

Now how to...


On Tue, Jun 1, 2010 at 11:50 AM, J G <[hidden email]> wrote:

> On Tue, Jun 1, 2010 at 5:02 AM, Samuel S. Shuster
> <[hidden email]> wrote:
>>  J G:
>>
>>> After publishing to local Store I'd like to do some back up work
>>> however when I check for references to announcement Publishing it
>>> seems to have no client who cares about.
>>> Is it the correct (no harming) to do when: Publishing do:[:work|  work
>>> finished ifTrue:["my backup here" ]] ?
>>> If it is the way then who should be the receiver (announcer) of the
>>> #when:do: message? How can other objects get it?
>>
>>
>> On Announcements in general... There are no specific receiver for Publishing. For Announcements, you can "when:send:" to the superclass of an Announcement and the receiver will get all announcements for all subclasses. This is the case here, StoreProgressView uses StoreWorkActivity which is the superclass of Publishing.
>
>
> Thank you Samuel for you answering.
> Here I couldn't understand. Should I supposed to send the message to
> an instance but not the class? For example:
> aStoreProgrssView when: Publishing do:[:p| p finished
> ifTrue:[Transcript cr;nextPutAll:'finished publishing']].
>
> If that's true how to get the instance object then?
> ( I even tried to send this message to those two classes but all failed )
>
> Best Regards,
>
> J G
>



--
Best Regards,

Jim G

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: how to do something after publishing to Store

Travis Griggs-3

On May 31, 2010, at 9:37 PM, J G wrote:

> Well I guess I could do this:
> StoreWorkActivity notifications when: Publishing do:[:p| p finished
>> ifTrue:[Transcript cr;nextPutAll:'finished publishing']].
> However the publishing process seems to hang when I do this civil  
> thing :)
>
> Now how to...

You want *isFinished*, not *finished*.

In this particular context, finished is a directive sent to a  
StoreWorkActivity which causes it to announce itself. So in that case  
above, you've basically created an infinite loop.

It's not a universal Smalltalk style thing, but I happen to know the  
bozo that wrote that particular code, and that as a general rule, he  
always makes predicate methods (ones that "test" things without having  
side effects) include a helping verb, e.g.

isFinished
hasState
wasRunning

etc

One could argue that a more direct verb, such as #finish would have  
avoided this confusion even further. Probably so. The "adjective"  
nature of it made it read nice at call sites though.

Publishing started.
"...do some some publishing work..."
Publishing finished.

Sorry for the confusion.

--
Travis Griggs
[hidden email]
"The dissenter is every human being at those moments of his life when  
he resigns momentarily from the herd and thinks for himself." -
Archibald MacLeish, poet and librarian



_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
J G
Reply | Threaded
Open this post in threaded view
|

Re: how to do something after publishing to Store

J G
On Tue, Jun 1, 2010 at 1:43 PM, Travis Griggs <[hidden email]> wrote:
>

>
> You want *isFinished*, not *finished*.
>
> In this particular context, finished is a directive sent to a
> StoreWorkActivity which causes it to announce itself. So in that case above,
> you've basically created an infinite loop.
>
> It's not a universal Smalltalk style thing, but I happen to know the bozo
> that wrote that particular code, and that as a general rule, he always makes
> predicate methods (ones that "test" things without having side effects)
> include a helping verb, e.g.
>
> isFinished
> hasState
> wasRunning
>
> etc
>
> One could argue that a more direct verb, such as #finish would have avoided
> this confusion even further. Probably so. The "adjective" nature of it made
> it read nice at call sites though.
>
> Publishing started.
> "...do some some publishing work..."
> Publishing finished.
>
> Sorry for the confusion.
>
> --
> Travis Griggs
> [hidden email]
> "The dissenter is every human being at those moments of his life when he
> resigns momentarily from the herd and thinks for himself." -Archibald
> MacLeish, poet and librarian
>
>
>
>

Travis,

It's my carelessness. Anyway it's nice to remember the style by heart
:) since it's really time saving for maintaining code. Thanks for the
details.


Best Regards,

Jim G
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc