Skip to content

Feature implementing plan : Allow other rendering #3

@Yopai

Description

@Yopai

Hi,

I just found your library, and find some improvements would be really useful.

I would like to do some refactoring to allow more flexibility.

Mainly, my goal is to separate the building engine and the rendering engine.

It will allow other rendering than HTML. For example :

So, a schematic working plan on it would be :

  • move printTable content into a "HTML Renderer class"
  • split "toHtml" into buildTable and call to render
  • inject an instance
  • it implies making interfaces to contractualize :
    ** what a renderer is (RendererInterface)
    ** what a pivot table, built, is (currently, what are in $table, $maxX, $maxY. With DataObjects classes for sub-objects)

Well, in fact... the more I'm thinking to it, the more I went to the conclusion that what is needed is :

  • create another library, more generic (let's call it "stats")
  • deports the code in it
  • make this library a simple caller of a method "createPivotTable" in stats

Please let me know what you think of it. I plan to do that with successive PRs, but, as refactoring can be time-consuming, I would'nt like to spent it if you're not agreeing this plan

Furthermore, to avoid conflicts, can you tell me what coding style rules you use ? It would help me push commits without space or braces change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions