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

[TASK] refactor AccessUtility #42

Open
calien666 opened this issue Feb 8, 2024 · 0 comments
Open

[TASK] refactor AccessUtility #42

calien666 opened this issue Feb 8, 2024 · 0 comments

Comments

@calien666
Copy link
Member

          As I cannot comment it on the class above, I'm doing it here how - also not related to this change.

Not for this change, but for a followup - I would suggest to transform this to a shared stateless service instead and let it be injected into the classes needing it.

Furthermore, the checkTableIsAllowedOnPage is using a static property to share a DataHandler instance. This is a completly no-go.

a) Static utility classes are required to be stateless !
b) DataHandler is a stateless class, and should not be shared

So, if the internal state should be reshared, better use a RuntimeCache (can be injected if this class is transformed from a static utility class to a shared service) and cache the $pageId, $tablename result directly and only call the datahandler method (on a new instance) if needed.

So please do me at least the favour to add a proper class todo comment that this class should be refactored to a stateless service and removing the datahandler reusage / property.

Originally posted by @sbuerk in #35 (comment)

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