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

RELIC: Consider Extension Types and Class Modifiers for Header Design #11

Open
klkucaj opened this issue Dec 9, 2024 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@klkucaj
Copy link
Collaborator

klkucaj commented Dec 9, 2024

Is your feature request related to a problem? Please describe.
Currently, the header parsing system creates an object for each header, which might involve parsing headers that aren't used or read. This could result in unnecessary overhead, especially in scenarios where headers are only partially consumed. Additionally, there is no mechanism to restrict users from implementing header-related classes, which might limit the ability to extend these classes in the future.

Describe the solution you'd like

  1. Extension Types:
    Use extension types to reduce the need for object creation for each header. This can improve performance and potentially allow for a more dynamic and efficient design.

  2. Class Modifiers:
    Apply class modifiers (e.g., sealed or final) to prevent direct implementation of header-related classes by users, ensuring controlled extensibility of these interfaces in the future.

Describe alternatives you've considered

  • Continuing with the current approach, where objects are created for each header. While straightforward, this may not be as efficient as using extension types.
  • Relying on documentation or usage conventions to discourage direct implementation of certain classes instead of using class modifiers. However, this lacks enforceability.

Additional context
This suggestion originates from feedback pointing out potential optimizations and maintainability improvements. It may also help align the design with best practices for API extensibility.

Feedback: serverpod/serverpod#2744 (comment)

@klkucaj klkucaj added the enhancement New feature or request label Dec 9, 2024
@klkucaj klkucaj changed the title Consider Extension Types and Class Modifiers for Header Design RELIC: Consider Extension Types and Class Modifiers for Header Design Dec 9, 2024
@SandPod SandPod transferred this issue from serverpod/serverpod Dec 16, 2024
@SandPod SandPod moved this to Later 🥳 in Relic Roadmap Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Later 🥳
Development

No branches or pull requests

1 participant