[FT improvements] [GSoC] [guidance needed] move some of the data source responsibilities to the cells

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

[FT improvements] [GSoC] [guidance needed] move some of the data source responsibilities to the cells

Elhamer
Dear Pharo community,

I've been working on improving the FT package recently and i would like to get your opinions about  introducing a new cell data source layer.
The idea is to move some of the data source responsibilities to the <cell data source, cell morph> in order to have a 'less dumber cell morphs' and a better design that reduces the complexity of extending the functionalities of a fast table.
The changes are kind of expensive and might break Glamour and some other FT-based packages out there (unless the new implementation is integrated in the FT package as an alternative way -the old implementation will be deprecated and removed progressively-).
 
There three main parts in the fast table package:

- The data source
- The table Morph
- The cell Morph
In the current design, all data managements are centralized around the data source. The Data source has the following responsibilities (schema below):

- Creates the cell Morphs and populate them (cellColumn: column row: rowIndex).
- Creates the header cells Morphs.
- Manipulates the data that will be used to populate the table.
- Updates the cell data (when the strong selection announcement is handled for example).




 Limitation of this design:

- A high level of complexity in the data source.
- The cell morph is a dumb object and it’s not being used to its full potential.
- Extending the cell functionalities (usually done from the data source) can be challenging.
 

 A better design would be for the cell morph to interact directly with a new layer of data source “the cell data source”, and the cell's data source will propagate to the table’s data source (the table refresh will triggered from the table's data source).


Here are the responsibilities for each part (schema below):

The cell Morph responsibilities:
- Handle mouse/keyboard events and fire announcements.

The cell data source responsibilities:
- Handles cell’s announcements and manage cell’s data.
- Propagates the changes to the data source.
- Creates the cell morphs.

The table’s data source responsibilities:
- Send refresh messages to the table morph when data changed.
- Create the cell data sources object for each data element.

The table morph responsibilities:
- Render the morphs/widgets …
- Handle column/row selection.
- …



Requirement changes:

The cell data source:
- A light version of the data source package to manage cell content.
- …
Announcements:
- Create new cells announcements that propagate the required properties to the cell's data source to handle data changes.
- Propagate those announcements when the required event is fired on the cell morph.
- …
The data source
- Creates cells' data sources instead of cell Morphs.
- …
The cell Morph
- Fires the announcements, plus some tiny changes to bound the morph to its data source.
- …
The table Morph
- The FTTableMorph doesn’t need much modification, just few changes here and there, The FTTableContainerMorph might be improved as well to take advantage from the fact that the cell morph knows its data (probably a better exposed-rows updates).
- …
 

Notes:

- These updates will definitely break Glamour, so some changes to the Glamour FT package is also required.
- The best way to introduce these changes is by adding this new cell data source layer side by side with the current implementation, and mark the old implementation as deprecated (will be removed progressively in the next versions).

Thank you :)
Best regards,
Elhamer.
Reply | Threaded
Open this post in threaded view
|

Re: [FT improvements] [GSoC] [guidance needed] move some of the data source responsibilities to the cells

Elhamer
Since there are no response, I am guessing that this design is okay and i will go for it :D.

Best,
Elhamer.
Reply | Threaded
Open this post in threaded view
|

Re: [FT improvements] [GSoC] [guidance needed] move some of the data source responsibilities to the cells

Stephane Ducasse-3
Esteban is moving this week-end from another part of France to Lille
so I think that he will get back to live wednesday.

On Fri, Jun 30, 2017 at 12:14 PM, Elhamer <[hidden email]> wrote:

> Since there are no response, I am guessing that this design is okay and i
> will go for it :D.
>
> Best,
> Elhamer.
>
>
>
> --
> View this message in context: http://forum.world.st/FT-improvements-GSoC-guidance-needed-move-some-of-the-data-source-responsibilities-to-the-cells-tp4952783p4953058.html
> Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
>