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

Use Scoped services more (and Transient services less) in app-lib? #751

Open
ivarne opened this issue Sep 7, 2024 · 0 comments
Open

Use Scoped services more (and Transient services less) in app-lib? #751

ivarne opened this issue Sep 7, 2024 · 0 comments
Labels
kind/chore status/draft Status: When you create an issue before you have enough info to properly describe the issue. status/triage
Milestone

Comments

@ivarne
Copy link
Member

ivarne commented Sep 7, 2024

Description

Singleton services is perceived by developers as more efficient, because they don't need to be initialised for every request.

The big drawback is that transient service dependencies inherit their singleton scope, which is really bad if someone in a transient dependent service decide to store user data in a class variable causing it to be reused cross request. If service scope validation is configured, we get an exception when a singleton service references a scoped service, making these kind of issues way more obvious, if we used scoped services more.

Additional Information

No response

Tasks

No response

Acceptance Criterias

No response

@ivarne ivarne added status/draft Status: When you create an issue before you have enough info to properly describe the issue. kind/chore labels Sep 7, 2024
@ivarne ivarne added this to the 9.0.0 milestone Sep 7, 2024
ivarne added a commit that referenced this issue Sep 8, 2024
Opened #751 to consider making bigger changes for v9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/chore status/draft Status: When you create an issue before you have enough info to properly describe the issue. status/triage
Projects
None yet
Development

No branches or pull requests

1 participant