<br><br><div class="gmail_quote">On Wed, Jun 15, 2011 at 1:30 PM, Levente Uzonyi <span dir="ltr">&lt;<a href="mailto:leves@elte.hu">leves@elte.hu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Wed, 15 Jun 2011, Eliot Miranda wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Wed, Jun 15, 2011 at 11:20 AM, Chris Muller &lt;<a href="mailto:asqueaker@gmail.com" target="_blank">asqueaker@gmail.com</a>&gt; wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
This sounds even worse.  Are you implying that you&#39;re going to pepper the<br>
system with &quot;ProgressInitiationException signal&quot;s just in case there&#39;s a<br>
progress morph waiting to update?<br>
</blockquote>
<br>
ProgressInitiationException was put into Squeak (presumably, in the<br>
Exceptions package) back in 2000 - before I ever started using Squeak.<br>
 The main entry point for its creation all these years has been<br>
through String&gt;&gt;#displayProgressAt:from:to:during: - which includes a<br>
comment with an example, and for which there are senders are all<br>
throughout the system.  I am not going to pepper anything except my<br>
English breakfast.  :)<br>
<br>
</blockquote>
<br>
So if that remains the main entry-point (and I think it&#39;s poor; one on<br>
UIManager would be better) the exception belongs in Collections, along side<br>
String.  Btu since progress is a UI function, there needs to be an<br>
entry-point there, and personally I think that either ToolBuilder or a<br>
generic UI package would be the place for both the entry-points such<br>
as #displayProgressAt:from:to:during:, and for the exception.  Just because<br>
something&#39;s been the way its been for 1 years doesn&#39;t mean it&#39;s right ;)<br>
</blockquote>
<br></div>
Right, UIManager seems to be a good place. The only value I see in using an exception is that it can be caught, so code can avoid showing the progress, but that feature seems to be rarely used and it can be solved in another way with UIManager.<div class="im">
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
That&#39;s absurd, a) on performance grounds,<br>
an unhandled exception is an expensive thing (an entire stack walk to<br>
discover there&#39;s no handler),<br>
</blockquote>
<br>
There&#39;s only one signal which occurs only for the _initiation_, not<br>
every update.  The exception is instantiated with a workBlock, which<br>
takes one argument which is the bar that the client-code can then<br>
update (via #value:).  An unhandled exception may be expensive (still<br>
usually well under 1 second though, right?), but it&#39;s just one signal<br>
for something that the domain thinks is going to take long enough<br>
anyway to consider needing to initiate a progress bar..<br>
<br>
</blockquote>
<br>
If the signal is only raised in the context of a progress-epcific<br>
entry-point then that&#39;s fine.  Form your initial response to my question it<br>
seemed that you were talking about something much less contained. An<br>
unhandled exception is likely to cost significantly less than opening a<br>
progress widget, so the cost is acceptable.<br>
<br>
<br>
And I agree with Frank that the progress exception should inherit from<br>
Notification.<br>
</blockquote>
<br></div>
The word Notification (along with Warning and Error) sounds like a system event. It&#39;s nothing more than an Exception with the #defaultAction implemented as ^nil. I wonder what it&#39;s original purpose was besides marking Exceptions which implement #defaultAction.<br>
</blockquote><div><br></div><div>The distinction is between an exception which if uncaught stops execution (an exception) and one which if uncaught has no effect (a notification).  So ProgressInitiationException is definitely a Notification (IMO :) ).</div>
<div><br></div><div>best,</div><div>Eliot</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><font color="#888888">
<br>
<br>
Levente</font><div><div></div><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
cheers,<br>
Eliot<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
 - Chris<br>
<br>
<br>
On Wed, Jun 15, 2011 at 12:07 PM, Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>&gt;<br>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
On Wed, Jun 15, 2011 at 9:54 AM, Chris Muller &lt;<a href="mailto:asqueaker@gmail.com" target="_blank">asqueaker@gmail.com</a>&gt;<br>
</blockquote>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
If, by &quot;the progress bar&quot; you mean SystemProgressMorph, I disagree,<br>
since that would create a dependency on Morphic.<br>
ProgressInitiationException allows domain-level code to signal that<br>
something worth indicating progress is occurring, and different UI<br>
frameworks can capture that notification (or not) and render it each<br>
in their own way.<br>
</blockquote>
<br>
</blockquote>
b) on neatness/complexity grounds, littering<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
the system with dependencies, yuck.  The Exceptions package is for the<br>
exceptions machinery and core exceptions, /not/ for every conceivable<br>
exception, notification or warning imaginable.  I haven&#39;t been keeping<br>
</blockquote>
up,<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
so could you outline the usage model here and give some examples?  I<br>
</blockquote>
think<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
there needs to be very careful thought on the interface between domain<br>
</blockquote>
code<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
and progress; a) where separation can&#39;t be obtained something analogous<br>
</blockquote>
to<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
MVC where changed messages are cheap if a Model has no dependents, b)<br>
</blockquote>
where<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
separation can be obtained (the traditional showProgessWhile: aBlock<br>
</blockquote>
form)<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
the progress additions are nicely encapsulated within the<br>
</blockquote>
showProgressWhile:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
form.<br>
best<br>
Eliot<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
 - Chris<br>
<br>
<br>
On Wed, Jun 15, 2011 at 11:48 AM, Eliot Miranda &lt;<br>
</blockquote></blockquote>
<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>&gt;<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Chris,<br>
    just because ProgressInitiationException is an exception doesn&#39;t<br>
imply<br>
it belongs in exceptions.  Surely it belongs in the same package as<br>
</blockquote></blockquote></blockquote>
the<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

progress bar.<br>
best<br>
Eliot<br>
<br>
On Wed, Jun 15, 2011 at 9:13 AM, &lt;<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Chris Muller uploaded a new version of Exceptions to project The<br>
</blockquote></blockquote></blockquote></blockquote>
Trunk:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<a href="http://source.squeak.org/trunk/Exceptions-cmm.34.mcz" target="_blank">http://source.squeak.org/trunk/Exceptions-cmm.34.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Exceptions-cmm.34<br>
Author: cmm<br>
Time: 15 June 2011, 11:13:51.392 am<br>
UUID: f0144460-f227-7b43-bee2-019786f35a4e<br>
Ancestors: Exceptions-nice.33<br>
<br>
First step toward preferredProgressBarPosition preference.<br>
<br>
=============== Diff against Exceptions-nice.33 ===============<br>
<br>
Item was changed:<br>
 Exception subclass: #ProgressInitiationException<br>
       instanceVariableNames: &#39;workBlock maxVal minVal aPoint<br>
progressTitle&#39;<br>
+       classVariableNames: &#39;PreferredProgressBarPosition&#39;<br>
-       classVariableNames: &#39;&#39;<br>
       poolDictionaries: &#39;&#39;<br>
       category: &#39;Exceptions-Kernel&#39;!<br>
<br>
 !ProgressInitiationException commentStamp: &#39;&lt;historical&gt;&#39; prior: 0!<br>
 I provide a way to alter the behavior of the old-style progress<br>
notifier<br>
in String. See examples in:<br>
<br>
 ProgressInitiationException testWithout.<br>
 ProgressInitiationException testWith.<br>
 !<br>
<br>
Item was changed:<br>
 ----- Method: ProgressInitiationException<br>
class&gt;&gt;display:at:from:to:during: (in category &#39;signalling&#39;) -----<br>
+ display: aString at: aPoint from: minVal to: maxVal during:<br>
</blockquote></blockquote></blockquote></blockquote>
workBlock<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
- display: aString at: aPoint from: minVal to: maxVal during:<br>
</blockquote></blockquote></blockquote></blockquote>
workBlock<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-<br>
       ^ self new<br>
+               display: aString<br>
+               at: (aPoint ifNil: [ self preferredProgressBarPoint<br>
</blockquote></blockquote></blockquote></blockquote>
])<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+               from: minVal<br>
+               to: maxVal<br>
+               during: workBlock!<br>
-               display: aString at: aPoint from: minVal to: maxVal<br>
during: workBlock!<br>
<br>
Item was added:<br>
+ ----- Method: ProgressInitiationException<br>
class&gt;&gt;display:from:to:during:<br>
(in category &#39;signalling&#39;) -----<br>
+ display: aString from: minVal to: maxVal during: workBlock<br>
+       ^ self<br>
+               display: aString<br>
+               at: nil<br>
+               from: minVal<br>
+               to: maxVal<br>
+               during: workBlock!<br>
<br>
Item was added:<br>
+ ----- Method: ProgressInitiationException<br>
class&gt;&gt;preferredProgressBarPoint (in category &#39;accessing&#39;) -----<br>
+ preferredProgressBarPoint<br>
+       ^ self preferredProgressBarPosition = #cursorPoint<br>
+               ifTrue: [ Sensor cursorPoint ]<br>
+               ifFalse: [ UIManager default screen perform: self<br>
preferredProgressBarPosition ]!<br>
<br>
Item was added:<br>
+ ----- Method: ProgressInitiationException<br>
class&gt;&gt;preferredProgressBarPosition (in category &#39;accessing&#39;) -----<br>
+ preferredProgressBarPosition<br>
+       ^ PreferredProgressBarPosition ifNil: [ #center ]!<br>
<br>
Item was added:<br>
+ ----- Method: ProgressInitiationException<br>
class&gt;&gt;preferredProgressBarPosition: (in category &#39;accessing&#39;) -----<br>
+ preferredProgressBarPosition: aSymbol<br>
+       &quot;Specify any of:  #center, #topCenter, #bottomCenter,<br>
#leftCenter,<br>
#rightCenter, #topLeft, #topRight, #bottomLeft or #bottomRight or<br>
#cursorPoint.&quot;<br>
+       ^ PreferredProgressBarPosition!<br>
<br>
Item was changed:<br>
 ----- Method: ProgressInitiationException class&gt;&gt;testInnermost (in<br>
category &#39;examples and tests&#39;) -----<br>
 testInnermost<br>
<br>
       &quot;test the progress code WITHOUT special handling&quot;<br>
<br>
       ^&#39;Now here&#39;&#39;s some Real Progress&#39;<br>
+               displayProgressFrom: 0<br>
-               displayProgressAt: Sensor cursorPoint<br>
-               from: 0<br>
               to: 10<br>
               during: [ :bar |<br>
                       1 to: 10 do: [ :x |<br>
                               bar value: x. (Delay forMilliseconds:<br>
500)<br>
wait.<br>
                               x = 5 ifTrue: [1/0].    &quot;just to make<br>
life<br>
interesting&quot;<br>
                       ].<br>
                       &#39;done&#39;<br>
               ].<br>
<br>
 !<br>
<br>
<br>
</blockquote>
<br>
<br>
<br>
<br>
<br>
</blockquote>
<br>
</blockquote>
<br>
<br>
<br>
<br>
<br>
</blockquote>
<br>
<br>
</blockquote>
<br>
</blockquote>
<br>
</div></div></blockquote></div><br>