Skip to content

Building a new component, when to use commands and when to use ports? #1818

Answered by LeStarch
pauladam316 asked this question in Q&A
Discussion options

You must be logged in to vote

Commands typically come from the ground or from a set sequence to run. e.g. "ground commands that the system take a picture". Ports are designed to communicate between components within the system. e.g "I need to allocate memory now". When a component knows when to take an action, we add a port to allow that action. When the ground or a running sequence knows when to take an action, then we use a command.

Some projects have commands and ports both do the same thing by delegate to a helper function such that components and the ground can both engage the given action.

Does this help?

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@pauladam316
Comment options

Answer selected by pauladam316
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants