Skip to content

MVC pattern #94

@alensiljak

Description

@alensiljak

I'm just throwing an idea here to see what you think of it.
Looking at the Python web UI libraries, I find them unnecessarily complex. They introduce another layer and a framework to learn. If they stop being maintained, all the effort goes down the drain, both for the library and the code that uses it.
I would prefer to see the use of widely accepted standards, like HTML and CSS, and some separation of concerns into an MVC pattern.
The view would be created in HTML, allowing anything that is currently available in the standard and not waiting for the implementation in the framework. I see your issue list is pretty long and does exactly that - translates HTML elements into Python, or rather into a specific framework, making it non-transferable in the process. HTML is supported by many tools created in the past 30 years. Many more people are familiar with it than with Python, for that matter. It also allows the use of any CSS framework for customising the look and feel of the final product.

What you have here is the heart of the system: linking HTML elements' events to the code in Python. Some additional tools would be useful, like parser of the HTML view, getting all the element IDs, and generating a Python link file, which gets imported into the main app.

Manipulation of the elements can happen through editing the properties, style elements, and assigned classes.

I hope such an approach would speed up the development of the libraries, make it easier to implement, would not waste time on reinventing the wheel, would allow introduction of new elements and CSS frameworks, and so on.

So far I've tried PySimpleGUI, Remi, Reahl, and Sofi. They all suffer from the same issues, listed at the top. A lot of time is spent on reimplementation of the HTML elements, which have been around for decades, instead of creating something usable and independent of the view technology.
I'd wish to see your thoughts on the topic and hopefully find a library that does not get in the way but builds on what is already there.
Cheers

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions