2

The software architecture literature has lots of information on software connectors as in component and connector views of architecture.

What kind of connector is a file descriptor? I noticed in the source code we have that a C module ABC will communicate with another C module XYZ using calls to things like vm_open, vm_write, and vm_read.

These functions open a file descriptor, and allow modules to read and write information. How would you depict this in architecture? Is this like a pipe-and-filter architecture?

0

1 Answer 1

3

File descriptors can implement connectors of different types, depending on how they are used within a system:

  • When used in a Fifo manner, where one component writes data into a file stream and another reads that data simultanously (and waits until new data is written into the stream), then this is pipe-like connector or stream connector.

  • When the data written into such a file stream is structured as messages, then this is a kind of message queue.

  • A file descriptor can also point to a single-file database like an SQLite file with random access to the data blocks inside the file - then this is a shared database connector.

  • Files / file descriptors can also be used for emitting / simulating events: one component creates a file in a folder. Another component observes that folder by polling and reacts as soon as the file is created.

So depicting should not be special for file descriptors, but only for the type of connector implemented by them. I am not aware of any normative standard which distinguishes the formentioned types of connectors, neither in UML nor in BPM, but here I found a few self-explanatory examples:

3
  • That's an excellent summary. Another hint I found was in the book Documenting Software Architecture: Views and Beyond, 2nd Edition: "Other specializations may prescribe that components have certain named ports, such as the stdin, stdout, and stderr ports of UNIX filters." Since those are also based on file descriptors, this leads me to believe that these could be ports on the boundaries of the software components. Components then read and write on those ports. Regardless of whether it is event-based, pipe-like, message queue, it seems that the file descriptor is shown as a port. Commented Dec 5, 2024 at 11:52
  • @Passeris: I would not depict a file descriptor pointing to an SQLite database as a port, but YMMV. Commented Dec 5, 2024 at 12:03
  • in that instance, since it has a database involved, I would have to model that explicitly. Commented Dec 5, 2024 at 14:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.