Amber: [RFC] Standardize naming for pipe, pipeline, handler, middleware.

Created on 30 Nov 2017  路  9Comments  路  Source: amberframework/amber

Description

This mostly has to do with the folder that custom pipes are placed in. The auth generator uses handlers but there are preferences for other names, and it doesn't seem to be consistent.

If a naming convention is chosen, it may have an effect beyond just the folder name.

AFAIK, these are the potential options for names:
Could we get a vote on those names (for the folder), we can change the auth generator to use it as well - I may be able to incorporate that into the PR that I have going for it:

  • handlers
  • pipes
  • pipelines
  • middleware
question rfc

Most helpful comment

Yes, yes, I mean pipes were "standardized" in Amber, and the underlying concept of handlers is not visible.

All 9 comments

I vote for pipes

src/pipes 馃憠 Amber::Pipe
src/controllers 馃憠 Amber::Controller

pipes 馃憤

Yes, looks like pipes/ would be the right one. I would rule out the other 3 here due to:

  • handlers: not bad, but unnecessary additional word in the terminology, when pipes are already standardized on
  • middleware: very broad IT term, including unwanted associations with complex contexts or Java
  • pipelines: pipelines consist of "instantiated" pipes, but pipe classes/templates must be in their own directory. (In theory, in the future there may be another directory pipelines/ for pipelines, in case it ends up being needed)

Crystal uses handlers - https://crystal-lang.org/api/0.24.1/HTTP/Handler.html

but I like the metaphor of plugging a pipe into a pipeline.

Yes, yes, I mean pipes were "standardized" in Amber, and the underlying concept of handlers is not visible.

I'm all for pipes and pipelines, but plugsounds like the opposite of what it's accomplishing. I know you plug a lamp into the wall, but when I read plug I think about stopping things from leaking.

What about connect, include, attach, link, etc?

When designing the api I thought of connect as off when someone is connecting pipes together, but plug is shorter less typing and still means the same in the context of plugging together pipes.

This may be taking the analogy too far, but don't you plumb pipes together?

Resolved #681 #664

Was this page helpful?
0 / 5 - 0 ratings

Related issues

netwarp picture netwarp  路  6Comments

aarongodin picture aarongodin  路  7Comments

olegsobchuk picture olegsobchuk  路  5Comments

elorest picture elorest  路  7Comments

elorest picture elorest  路  6Comments