Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Theory read issue in in :gui module, branch feature/web-gui #508

Open
fmuratori opened this issue May 28, 2023 · 0 comments
Open

Theory read issue in in :gui module, branch feature/web-gui #508

fmuratori opened this issue May 28, 2023 · 0 comments

Comments

@fmuratori
Copy link

This is not really a bug but an issue i've found while using the implementation in my fork of the 2p-kt repo.

the issue i am going to present can be found in the implementation of gui/src/commonMain/kotlin/it/unibo/tuprolog/ui/gui/impl/PageImpl.kt of branch feature/web-gui.

Background:
Basically, inside of the PageImpl implementation, the theory field getter contains a side effect that allows for theory parsing optimizations. To my understanding, if no updates have been made to the user defined theory, we do not need to parse it again but instead can use the previously parsed one.

Issue:
My point is that this getter may no be the best point where to implement such a logic since outside users may tamper with the optimization logic by simply reading the theory field.

Fixes(?):
I'd like to suggest a different approach:

  • explicitly split the optimization flag by effectively calling a separate method
  • make the theory field private and force the end users to access the updated theory by using the already implemented observable Page
    events (onTheoryChange)
@fmuratori fmuratori changed the title theory read issue Theory read issue in in :gui module, branch feature/web-gui May 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant