Skip to content

Consider Extension Types and Class Modifiers for Header Design #11

Closed

Description

@klkucaj

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)

Activity

  1. added
    enhancement
    on Dec 9, 2024
  2. changed the title [-]Consider Extension Types and Class Modifiers for Header Design[/-] [+]RELIC: Consider Extension Types and Class Modifiers for Header Design[/+] on Dec 9, 2024
  3. moved this to Later 🥳 in Relic Roadmapon Dec 18, 2024
  4. moved this from Later 🥳 to Backlog in Relic Roadmapon Mar 25, 2025
  5. self-assigned this
    on Mar 27, 2025
  6. moved this from Backlog to Now 🔥 in Relic Roadmapon Mar 27, 2025
  7. changed the title [-]RELIC: Consider Extension Types and Class Modifiers for Header Design[/-] [+]Consider Extension Types and Class Modifiers for Header Design[/+] on Mar 27, 2025
  8. moved this from Now 🔥 to Done in Relic Roadmapon Apr 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions