Skip to content

Alternative design pattern for handlePOST etc methods #52

@nohponex

Description

@nohponex

Further discussion needed

Current design pattern makes it very complicated when implementing complex handlePOST or PATCH methods.

Since in real life world additional checks, transformations have to be made before executing, custom logs, notifications should be processed after and flags and messages to be passed between these two.

Current validationCallbacks and viewCallback is no fit for the job, since passing message requires passing variables by reference so the modified value can be passed to viewCallback

Proposals:

  • a Perhaps a layered pattern like small middleware will be useful
  • b Use context for callables
    An alternative approach might be to create an object context and transform callables to closures, so set context for them.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions