flow-based.org icon indicating copy to clipboard operation
flow-based.org copied to clipboard

hash port, addressable port with string indexes

Open forresto opened this issue 11 years ago • 2 comments

This would make it possible to specify names for the ports, as opposed to a numerical index. Otherwise, it would work the same as array ports.

https://github.com/noflo/noflo/issues/262

forresto avatar Sep 20 '14 08:09 forresto

Iterating over connected hash ports would be a needed functionality, also some convention for hash port names. I suggest sticking to lowercase and snake_case names for hashports.

alfa256 avatar Sep 20 '14 16:09 alfa256

This feature would improve readability and maintainability of static routing in FBP apps a lot.

Currently I have to write something like this:

'GET /index' -> PATTERN[0] Router
'GET /admin' -> PATTERN[1] Router

Router REQ[0] -> REQ IndexController
Router REQ[1] -> REQ AdminController

These numeric indexes are getting hard to maintain as the number of them grows. Compare it to this:

'GET /index' -> PATTERN[index] Router
'GET /admin' -> PATTERN[admin] Router

Router REQ[index] -> REQ IndexController
Router REQ[admin] -> REQ AdminController

Makes much more sense to a graph designer.

trustmaster avatar Sep 20 '14 18:09 trustmaster