<div dir="ltr"><div><div><div><div><div><div><div>Concerning StringHolder, that's the classical "is a" versus "has a".<br></div>A FileList is a special kind of StringHolder (the file contents - presumably bytes interpreted with some encoding) with many gadget for switching the content.<br></div>A FileList is a tool for inspecting directories and files and has a Text pane for viewing interpreted file contents (or why not another with raw code in hexadecimal, etc...).<br><br></div>Of course "is a" kind of work, but sounds like a very partial POV, unless all files are text files.<br></div>IMo it's an abuse of inheritance.<br><br></div>Moreover, StringHolder has hooks for selectedMessageName/selectedClassName, and many action for Smalltalk code.</div><div>So the name does not really tells what it is, it's a model for holding Smalltalk snippet/code.</div><div>If we want a model for holding text without evaluation nor navigation capabilities, then we have to undo in sublcass the default behaviour of super class.</div>Also note that #selectedClass is implemented in Model, though it is mostly for text panes, it's strange to find such hook at such high level.</div><div>This kind of model aggregates all possible features of tools, and it's not surprising to see the litany of *Tool-something in the method categories (protocols).</div><div>That's the easy way to share features between tools, but not the simple way</div><div>(understand simple vs easy like in Rich Hickey's talk <a href="https://www.infoq.com/presentations/Simple-Made-Easy">https://www.infoq.com/presentations/Simple-Made-Easy</a>).<br></div>So I perfectly understand the will of Pharo to sanitize a bit the code (separate concerns, modularize, encapsulate).<br></div><div class="gmail_extra"><br><div class="gmail_quote">2017-10-05 10:43 GMT+02:00 H. Hirzel <span dir="ltr"><<a href="mailto:hannes.hirzel@gmail.com" target="_blank">hannes.hirzel@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello<br>
<br>
Tim R. asked  about the FileList hierarchy [1] (see<br>
FileList2>listForPattern(s): and MessageSend abuse thread)<br>
<br>
On 10/4/17 9:27 PM, tim Rowledge wrote:<br>
<br>
>>    Don’t suppose you recall anything about why it is subclassed from StringHolder?<br>
>>    That really does seem odd...<br>
<br>
Bob A:<br>
>Well, the whole point is to provide a view of the contents of a file which you can read, edit >and save. The rest is just how to get that content in the first place. So, it's a StringHolder >with some extra buttons attached.<br>
<br>
Pharo directly subclasses Model [2]<br>
<br>
I think the current solution of subclassing StringHolder is OK.<br>
<br>
Interesting to note that if you select an image file in the file list<br>
you get the dimensions of the image file plus a thumbnail view of it.<br>
Very nice.<br>
<br>
I agree that a complete rewrite of FileList (and subclasses) is a<br>
worthwhile thing to do.<br>
<br>
Regards<br>
Hannes<br>
<br>
<br>
[1] FileList printHierarchy '<br>
ProtoObject #()<br>
        Object #()<br>
                Model #(''dependents'')<br>
                        StringHolder #(''contents'')<br>
                                FileList #(''fileName'' ''directory'' ''volList'' ''volListIndex''<br>
''list'' ''listIndex''<br>
                                              ''pattern'' ''sortMode''<br>
''brevityState'' ''directoryCache''<br>
                                               ''lastGraphicsExtent'')<br>
                                        FileList2 #(''showDirsInFileList'' ''currentDirectorySelected''<br>
                                               ''fileSelectionBlock''<br>
''dirSelectionBlock''<br>
                                               ''optionalButtonSpecs''<br>
''modalView''<br>
                                               ''directoryChangeBlock'' ''ok'')<br>
                                                FileChooser #(''view'' ''caption'' ''captionMorph'' ''captionBox''<br>
<br>
''cancelButton'' ''okButton'' ''buttonPane''<br>
<br>
''captionPane'' ''directoryPane''<br>
<br>
''filePane'' ''showShortFileNames'')<br>
                                        PluggableFileList #(''accepted'' ''fileFilterBlock'' ''canAcceptBlock''<br>
<br>
''validateBlock'' ''newFiles'' ''prompt'' ''resultBlo<br>
<br>
<br>
[2] FileList in Pharo6:<br>
    ProtoObject #()<br>
        Object #()<br>
                Model #(#dependents #announceur)<br>
                        FileList #(#reference #volumeList #volumeListIndex #list #listIndex<br>
#pattern #brevityState #dirSelectionBlock #modalView #ok #contents<br>
#optionalButtonSpecs #grid #fileEncoding #sortBlock #baseLabel<br>
#configuredServices #sourceTextModel)<br>
<br>
</blockquote></div><br></div>