<br><br><div class="gmail_quote">On Wed, Jun 15, 2011 at 11:20 AM, Chris Muller <span dir="ltr">&lt;<a href="mailto:asqueaker@gmail.com">asqueaker@gmail.com</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">&gt; This sounds even worse.  Are you implying that you&#39;re going to pepper the<br>
&gt; system with &quot;ProgressInitiationException signal&quot;s just in case there&#39;s a<br>
&gt; progress morph waiting to update?<br>
<br>
</div>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></blockquote><div><br></div><div>So if that remains the main entry-point (and I think it&#39;s poor; one on UIManager would be better) the exception belongs in Collections, along side String.  Btu since progress is a UI function, there needs to be an entry-point there, and personally I think that either ToolBuilder or a generic UI package would be the place for both the entry-points such as #displayProgressAt:from:to:during:, and for the exception.  Just because something&#39;s been the way its been for 1 years doesn&#39;t mean it&#39;s right ;)</div>
<div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><br>
&gt; That&#39;s absurd, a) on performance grounds,<br>
&gt; an unhandled exception is an expensive thing (an entire stack walk to<br>
&gt; discover there&#39;s no handler),<br>
<br>
</div>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></blockquote><div><br></div><div>If the signal is only raised in the context of a progress-epcific entry-point then that&#39;s fine.  Form your initial response to my question it seemed that you were talking about something much less contained. An unhandled exception is likely to cost significantly less than opening a progress widget, so the cost is acceptable.</div>
<div><br></div><div><br></div><div>And I agree with Frank that the progress exception should inherit from Notification.</div><div><br></div><div>cheers,</div><div>Eliot</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<font color="#888888"><br>
 - Chris<br>
</font><div class="im"><br>
<br>
On Wed, Jun 15, 2011 at 12:07 PM, Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt;<br>
&gt; On Wed, Jun 15, 2011 at 9:54 AM, Chris Muller &lt;<a href="mailto:asqueaker@gmail.com">asqueaker@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; If, by &quot;the progress bar&quot; you mean SystemProgressMorph, I disagree,<br>
&gt;&gt; since that would create a dependency on Morphic.<br>
&gt;&gt; ProgressInitiationException allows domain-level code to signal that<br>
&gt;&gt; something worth indicating progress is occurring, and different UI<br>
&gt;&gt; frameworks can capture that notification (or not) and render it each<br>
&gt;&gt; in their own way.<br>
&gt;<br>
</div><div><div></div><div class="h5">b) on neatness/complexity grounds, littering<br>
&gt; the system with dependencies, yuck.  The Exceptions package is for the<br>
&gt; exceptions machinery and core exceptions, /not/ for every conceivable<br>
&gt; exception, notification or warning imaginable.  I haven&#39;t been keeping up,<br>
&gt; so could you outline the usage model here and give some examples?  I think<br>
&gt; there needs to be very careful thought on the interface between domain code<br>
&gt; and progress; a) where separation can&#39;t be obtained something analogous to<br>
&gt; MVC where changed messages are cheap if a Model has no dependents, b) where<br>
&gt; separation can be obtained (the traditional showProgessWhile: aBlock form)<br>
&gt; the progress additions are nicely encapsulated within the showProgressWhile:<br>
&gt; form.<br>
&gt; best<br>
&gt; Eliot<br>
&gt;&gt;<br>
&gt;&gt;  - Chris<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On Wed, Jun 15, 2011 at 11:48 AM, Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>&gt;<br>
&gt;&gt; wrote:<br>
&gt;&gt; &gt; Hi Chris,<br>
&gt;&gt; &gt;     just because ProgressInitiationException is an exception doesn&#39;t<br>
&gt;&gt; &gt; imply<br>
&gt;&gt; &gt; it belongs in exceptions.  Surely it belongs in the same package as the<br>
&gt;&gt; &gt; progress bar.<br>
&gt;&gt; &gt; best<br>
&gt;&gt; &gt; Eliot<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; On Wed, Jun 15, 2011 at 9:13 AM, &lt;<a href="mailto:commits@source.squeak.org">commits@source.squeak.org</a>&gt; wrote:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Chris Muller uploaded a new version of Exceptions to project The Trunk:<br>
&gt;&gt; &gt;&gt; <a href="http://source.squeak.org/trunk/Exceptions-cmm.34.mcz" target="_blank">http://source.squeak.org/trunk/Exceptions-cmm.34.mcz</a><br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; ==================== Summary ====================<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Name: Exceptions-cmm.34<br>
&gt;&gt; &gt;&gt; Author: cmm<br>
&gt;&gt; &gt;&gt; Time: 15 June 2011, 11:13:51.392 am<br>
&gt;&gt; &gt;&gt; UUID: f0144460-f227-7b43-bee2-019786f35a4e<br>
&gt;&gt; &gt;&gt; Ancestors: Exceptions-nice.33<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; First step toward preferredProgressBarPosition preference.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; =============== Diff against Exceptions-nice.33 ===============<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Item was changed:<br>
&gt;&gt; &gt;&gt;  Exception subclass: #ProgressInitiationException<br>
&gt;&gt; &gt;&gt;        instanceVariableNames: &#39;workBlock maxVal minVal aPoint<br>
&gt;&gt; &gt;&gt; progressTitle&#39;<br>
&gt;&gt; &gt;&gt; +       classVariableNames: &#39;PreferredProgressBarPosition&#39;<br>
&gt;&gt; &gt;&gt; -       classVariableNames: &#39;&#39;<br>
&gt;&gt; &gt;&gt;        poolDictionaries: &#39;&#39;<br>
&gt;&gt; &gt;&gt;        category: &#39;Exceptions-Kernel&#39;!<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;  !ProgressInitiationException commentStamp: &#39;&lt;historical&gt;&#39; prior: 0!<br>
&gt;&gt; &gt;&gt;  I provide a way to alter the behavior of the old-style progress<br>
&gt;&gt; &gt;&gt; notifier<br>
&gt;&gt; &gt;&gt; in String. See examples in:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;  ProgressInitiationException testWithout.<br>
&gt;&gt; &gt;&gt;  ProgressInitiationException testWith.<br>
&gt;&gt; &gt;&gt;  !<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Item was changed:<br>
&gt;&gt; &gt;&gt;  ----- Method: ProgressInitiationException<br>
&gt;&gt; &gt;&gt; class&gt;&gt;display:at:from:to:during: (in category &#39;signalling&#39;) -----<br>
&gt;&gt; &gt;&gt; + display: aString at: aPoint from: minVal to: maxVal during: workBlock<br>
&gt;&gt; &gt;&gt; - display: aString at: aPoint from: minVal to: maxVal during: workBlock<br>
&gt;&gt; &gt;&gt; -<br>
&gt;&gt; &gt;&gt;        ^ self new<br>
&gt;&gt; &gt;&gt; +               display: aString<br>
&gt;&gt; &gt;&gt; +               at: (aPoint ifNil: [ self preferredProgressBarPoint ])<br>
&gt;&gt; &gt;&gt; +               from: minVal<br>
&gt;&gt; &gt;&gt; +               to: maxVal<br>
&gt;&gt; &gt;&gt; +               during: workBlock!<br>
&gt;&gt; &gt;&gt; -               display: aString at: aPoint from: minVal to: maxVal<br>
&gt;&gt; &gt;&gt; during: workBlock!<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Item was added:<br>
&gt;&gt; &gt;&gt; + ----- Method: ProgressInitiationException<br>
&gt;&gt; &gt;&gt; class&gt;&gt;display:from:to:during:<br>
&gt;&gt; &gt;&gt; (in category &#39;signalling&#39;) -----<br>
&gt;&gt; &gt;&gt; + display: aString from: minVal to: maxVal during: workBlock<br>
&gt;&gt; &gt;&gt; +       ^ self<br>
&gt;&gt; &gt;&gt; +               display: aString<br>
&gt;&gt; &gt;&gt; +               at: nil<br>
&gt;&gt; &gt;&gt; +               from: minVal<br>
&gt;&gt; &gt;&gt; +               to: maxVal<br>
&gt;&gt; &gt;&gt; +               during: workBlock!<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Item was added:<br>
&gt;&gt; &gt;&gt; + ----- Method: ProgressInitiationException<br>
&gt;&gt; &gt;&gt; class&gt;&gt;preferredProgressBarPoint (in category &#39;accessing&#39;) -----<br>
&gt;&gt; &gt;&gt; + preferredProgressBarPoint<br>
&gt;&gt; &gt;&gt; +       ^ self preferredProgressBarPosition = #cursorPoint<br>
&gt;&gt; &gt;&gt; +               ifTrue: [ Sensor cursorPoint ]<br>
&gt;&gt; &gt;&gt; +               ifFalse: [ UIManager default screen perform: self<br>
&gt;&gt; &gt;&gt; preferredProgressBarPosition ]!<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Item was added:<br>
&gt;&gt; &gt;&gt; + ----- Method: ProgressInitiationException<br>
&gt;&gt; &gt;&gt; class&gt;&gt;preferredProgressBarPosition (in category &#39;accessing&#39;) -----<br>
&gt;&gt; &gt;&gt; + preferredProgressBarPosition<br>
&gt;&gt; &gt;&gt; +       ^ PreferredProgressBarPosition ifNil: [ #center ]!<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Item was added:<br>
&gt;&gt; &gt;&gt; + ----- Method: ProgressInitiationException<br>
&gt;&gt; &gt;&gt; class&gt;&gt;preferredProgressBarPosition: (in category &#39;accessing&#39;) -----<br>
&gt;&gt; &gt;&gt; + preferredProgressBarPosition: aSymbol<br>
&gt;&gt; &gt;&gt; +       &quot;Specify any of:  #center, #topCenter, #bottomCenter,<br>
&gt;&gt; &gt;&gt; #leftCenter,<br>
&gt;&gt; &gt;&gt; #rightCenter, #topLeft, #topRight, #bottomLeft or #bottomRight or<br>
&gt;&gt; &gt;&gt; #cursorPoint.&quot;<br>
&gt;&gt; &gt;&gt; +       ^ PreferredProgressBarPosition!<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Item was changed:<br>
&gt;&gt; &gt;&gt;  ----- Method: ProgressInitiationException class&gt;&gt;testInnermost (in<br>
&gt;&gt; &gt;&gt; category &#39;examples and tests&#39;) -----<br>
&gt;&gt; &gt;&gt;  testInnermost<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;        &quot;test the progress code WITHOUT special handling&quot;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;        ^&#39;Now here&#39;&#39;s some Real Progress&#39;<br>
&gt;&gt; &gt;&gt; +               displayProgressFrom: 0<br>
&gt;&gt; &gt;&gt; -               displayProgressAt: Sensor cursorPoint<br>
&gt;&gt; &gt;&gt; -               from: 0<br>
&gt;&gt; &gt;&gt;                to: 10<br>
&gt;&gt; &gt;&gt;                during: [ :bar |<br>
&gt;&gt; &gt;&gt;                        1 to: 10 do: [ :x |<br>
&gt;&gt; &gt;&gt;                                bar value: x. (Delay forMilliseconds:<br>
&gt;&gt; &gt;&gt; 500)<br>
&gt;&gt; &gt;&gt; wait.<br>
&gt;&gt; &gt;&gt;                                x = 5 ifTrue: [1/0].    &quot;just to make<br>
&gt;&gt; &gt;&gt; life<br>
&gt;&gt; &gt;&gt; interesting&quot;<br>
&gt;&gt; &gt;&gt;                        ].<br>
&gt;&gt; &gt;&gt;                        &#39;done&#39;<br>
&gt;&gt; &gt;&gt;                ].<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;  !<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
<br>
</div></div></blockquote></div><br>