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

Add a framework to embrace the REPR pattern #423

Open
Kaliumhexacyanoferrat opened this issue Nov 24, 2023 · 0 comments
Open

Add a framework to embrace the REPR pattern #423

Kaliumhexacyanoferrat opened this issue Nov 24, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@Kaliumhexacyanoferrat
Copy link
Owner

As a developer of an API, I would like to use the REPR pattern with GenHTTP, so that I can quickly create endpoints to handle my requests without the need of boilerplate code but with enough structure to separate the endpoints from each other.

Additional reads: vertical slicing, CQRS

Example

We could easily add endpoints as a concept and let the MethodHandler handle them. As devs may would like to configure their endpoints directly in a single class, we need to check how to implement this with the handler chain and builder pattern that we have in place.

public class MyEndpoint : IEndpoint<MyRequest, MyResponse> 
{

  public MyEndpoint()
  {
    Compression();
    // clarify how to implement this or a similar approach
  }

  public MyResponse Handle(MyRequest request)
  {
    // do stuff
  ]

}

Acceptance criteria

  • The functionality is implemented in a new module
  • The functionality re-uses the MethodHandler if applicable
  • Clarify how to work with path and query parameters
  • Clarify how to add concerns re-using the existing modules and functionality (composition over structure/hierarchy)
  • There is a project template for this kind of project
  • The documentation is updated for this kind of project
  • The readme of the GenHTTP server is updated to include this kind of project
@Kaliumhexacyanoferrat Kaliumhexacyanoferrat added the enhancement New feature or request label Nov 24, 2023
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
None yet
Development

No branches or pull requests

1 participant