Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Connections & Ports

This chapter focuses on how to model connections between the components of your system. You’ve already seen the basic component-to-component connection schema:

This is fine, but high-level. We just know that two components talk to each other and that’s it. What if we wanted to dig deeper, how about:

  • What kind of protocol is used to talk between those components?
  • Is client even supporting that protocol?
  • Does server has any port for the client to connect to?

Note

Programmers reading this probably think about ports in terms of networking. In the case of this book, think about a more broad/generic definition of “something to connect to”.

While this model compiles without any errors, the model completion score points us towards things to specify further:

  • There are 0 ports defined
  • There are 0 messages defined

TODO: what the hell is “Connections 0/1”? Some bug prolly…

Defining & connecting ports

TODO: 0/4 ports, marked as unused or what? Why isn’t completion score up? Same issue with connections as before.

The work-computer system defines 2 usb-c ports on the component level. Now we have more details about what exactly we’re connecting to. The component states what port it exposes and the compiler will raise an error if you try to connecting to a non-existing port. Consider having an inventory of components from some iteration of your product, while designing a new version of that product. Having ports specified inside components allows you to quickly see what parts can be easily re-used and which ones will require changes at interface level, or even need a complete rework.