Component based software engineering

I have a dream...

I have a dream...

Definition

CBSE emphasizes the separation of concerns with respect to the wide-ranging functionality available throughout a given software system. It is a reuse-based approach to defining, implementing and composing loosely coupled independent components into systems.

What is a component?

A piece of software that is connected to other only through its interfaces

An "interface" is an element that exposes a communication channel with a known contract

Development roles

  • System architect (defines the requirements)

  • Component designer (implements components)

  • System integrator (composes components)

Communication Pattern: request-reply

  • A server port provides an interface.
  • 0-to-N clients send requests to server.
  • The only purpose of the server is to provide answers (replies) as quickly as possible.
  • Request can be either synchronous (wait for an answer) or asynchronous (don't wait, poll).
  • Server must NOT make any assumption about clients. 

Communication Pattern: publish-subscribe

  • A publisher exposes data (the topic).
  • 0-to-N subscribers notifies that they want to receive the data.
  • Publisher must NOT make any assumption about subscribers. 
  • The interface is always asynchronous for the publisher and might be either SYNC or ASYNC for the subscriber.

Good components have:

  • Strongly typed interfaces
  • Explicitly documented contracts
  • As little state as possible
  • A well defined functionality
  • An implementation that allow deployment to be configured by the integrator.

ROS doesn't enforce any of this

Coming next...

"Separation of concerns"