two question about fasttable

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
27 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: two question about fasttable

Ben Coman
On Tue, Nov 29, 2016 at 3:45 PM, Esteban Lorenzano <[hidden email]> wrote:

>
> On 29 Nov 2016, at 00:00, Ben Coman <[hidden email]> wrote:
>
>
>
> On Tue, Nov 29, 2016 at 5:29 AM, Esteban Lorenzano <[hidden email]>
> wrote:
>>
>> Hi,
>>
>> On 28 Nov 2016, at 21:32, stepharo <[hidden email]> 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.
>>
>>
>
> so maybe TableCellSource / TableCellProvider ?
>
>
> I’m not against changing its name, in general the family of names are
> “DataSource”, “Store”, etc. so I imagine that “Provider” fits (even if I
> tend to hate names style “Manager”, “Factory”, “Provider”, because there are
> too generic… sometimes is that what you have :P)
> But is not just a “cell provider”, it does something more, is a general
> model of the TableMorph: it provides cells, headers and interaction
> capabilities (like drag&drop)… so it is more like a "table data provider”,

cool.  I was only reflecting back your first description (and so I
learnt something more about it)

> TableDataSource, TableStore, TableProvider are then better names, IMO…

/refers to thesaurus
TableWidgetSource, TableComponentSource, TableElementSource,
TablePartProvider, TableAspectProvider, TableFacetProvider

cheers -ben

>
> this changes will impact Pharo 7… is very good that we can have a discussion
> like this now, that we have the time to reach a consensus :)
>
> Esteban
>
>
> cheers -ben
>
>

Reply | Threaded
Open this post in threaded view
|

Re: two question about fasttable

stepharo
In reply to this post by EstebanLM
Ok so I never understand it that way. 
What a bad name. 

Stef


On 28 Nov 2016, at 22:25, Henrik Nergaard <[hidden email]> wrote:

The datasource is a wrapper/binding between the real object and the view (table/list) and provides the necessary stuff for display and interaction between them. Returning custom UI elements (cells and rows) from the datasource is part of what makes it possible to reuse the same table/container morph for lists/tables/trees. 

this ^ :)

Esteban




--
Using Opera's mail client: http://www.opera.com/mail/
Reply | Threaded
Open this post in threaded view
|

Re: two question about fasttable

stepharo
In reply to this post by EstebanLM
On Mon, 28 Nov 2016 22:29:08 +0100, Esteban Lorenzano <[hidden email]> wrote:

Hi, 

On 28 Nov 2016, at 21:32, stepharo <[hidden email]> 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. 
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/
Reply | Threaded
Open this post in threaded view
|

Re: two question about fasttable

stepharo
In reply to this post by EstebanLM


- 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.



so maybe TableCellSource / TableCellProvider ?

I’m not against changing its name, in general the family of names are “DataSource”, “Store”, etc. so I imagine that “Provider” fits (even if I tend to hate names style “Manager”, “Factory”, “Provider”, because there are too generic… sometimes is that what you have :P)
But is not just a “cell provider”, it does something more, is a general model of the TableMorph: it provides cells, headers and interaction capabilities (like drag&drop)… so it is more like a "table data provider”, TableDataSource, TableStore, TableProvider are then better names, IMO… 

Please please please. 
So I was always confused. 



this changes will impact Pharo 7… is very good that we can have a discussion like this now, that we have the time to reach a consensus :)

Esteban


cheers -ben 




--
Using Opera's mail client: http://www.opera.com/mail/
Reply | Threaded
Open this post in threaded view
|

Re: two question about fasttable

stepharo
In reply to this post by EstebanLM

No, because is not *just* a cell provider. 
TableDataSource, TableStore, TableProvider, yes.

I kind of like “TableStore”. 
Also we have other stores in image: FileSystem stores… which conceptually do more or less the same… so better to unify concepts/names… what do you think?

TableMorphStore?
Because I was really shocked to see that it returned Morph. 




Esteban


Christophe




--
Using Opera's mail client: http://www.opera.com/mail/
Reply | Threaded
Open this post in threaded view
|

Re: two question about fasttable

stepharo
In reply to this post by Aliaksei Syrel
On Tue, 29 Nov 2016 09:58:41 +0100, Aliaksei Syrel <[hidden email]> wrote:

"DataSource" is responsible for providing visual elements that represent items in a data set.

who said that. 
I could say exactly: DataSource is responsible to cut data so that they are delivered by row or columns. 



I don't see how word "Store" fits here, because DataSource does not store anything.

Store in the sense of serving something. 

DataSource is also not the best name since it is not a data source itself.

Clearly not

An object that is now called DataSource, basically just knows a single function that from mathematical point of view can be defined as follows:
f: Object -> Morph . You see, it is a mapping, not a souse or store.

Cheers,
Alex

On 29 November 2016 at 09:44, Denis Kudriashov <[hidden email]> wrote:

2016-11-29 9:35 GMT+01:00 Esteban Lorenzano <[hidden email]>:
yes, something like TableCellSource or TableCellProvider is more intention revealing.

No, because is not *just* a cell provider. 
TableDataSource, TableStore, TableProvider, yes.

I kind of like “TableStore”. 

And if we have TableMorph then this guy should be TableMorphStore IMO.




--
Using Opera's mail client: http://www.opera.com/mail/
Reply | Threaded
Open this post in threaded view
|

Re: two question about fasttable

stepharo
In reply to this post by Aliaksei Syrel
On Tue, 29 Nov 2016 10:46:09 +0100, Aliaksei Syrel <[hidden email]> wrote:

Called by the table view to return the data object associated with the specified row and column.
https://developer.apple.com/reference/appkit/nstableviewdatasource/1533674-tableview


If dataSource does not return view then you are right for the name. 
Now in Pharo the name is wrong and may be the design too :)

Cheers,
Alex

On 29 November 2016 at 10:44, Aliaksei Syrel <[hidden email]> wrote:

On 29 November 2016 at 10:39, Esteban Lorenzano <[hidden email]> wrote:
not true. 
it returns an NSView.

Could you name a method (send a link to a documentation) that is implemented by DataSource and returns an NSView?

According to documentation NSView for an item at row/column index is created and returned by NSTableView:

I didn't find any NSView related method in DataSource. Am I looking in a wrong place?

Cheers,
Alex




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