On Mon, 28 Nov 2016 22:29:08 +0100, Esteban Lorenzano <estebanlm@gmail.com> wrote:

Hi, 

On 28 Nov 2016, at 21:32, stepharo <stepharo@free.fr> wrote:

Hi

- Could we rename FastTable into Table?

not for Pharo 6 but Pharo 7 yes��� in fact, I think it should be called TableMorph.
(Also we need to refactor a lot, to eliminate the FT prefix, etc.)


- Then I miss an important design point. Why datasource returns Morph?
I do not get get why a data source should return UI element. To me it violates layers.

no, because that���s its purpose: to provide the table with the cell elements (which are by definition Morphs��� any kind of morphs). 
a TableDataSource is not a spec, is the provider of cells.

What a ugly name then...
Why this is not a CellMorphFactory or something like that. 



I got inspired for Cocoa NSTableView design (and NSTableViewDataSource), and that���s what it does. 
See for example here: https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/TableView/PopulatingView-TablesProgrammatically/PopulatingView-TablesProgrammatically.html
This function: 
- (NSView *)tableView:(NSTableView *)tableView
   viewForTableColumn:(NSTableColumn *)tableColumn
                  row:(NSInteger)row

is the equivalent of our FTDataSource>>cellColumn:row:

Esteban


Stef



--
Using Opera's mail client: http://www.opera.com/mail/





--
Using Opera's mail client: http://www.opera.com/mail/