[ prog / sol / mona ]

prog


Who should own an interface?

1 2019-10-18 21:37

Assume an interface X which is used between two components A and B. Who should be the owner of X? I see three fundamental possibilities:

1. One of the components A or B, so one depends on the other.
2. A parent component, so A and B depend on the parent.
3. The user, so there must be an adapter to map between A and B.

Of course, the answer depends on the circumstances and tradeoffs but are there insights to help with it?

I would expect that it was already discussed heavily in the seventies between Fred Brooks, Alan Perlis, and Dijkstra. However, I don't know any such publication.

2 2019-10-19 04:22

It depends on which is most natural. Without further context, I would expect neither of A or B to own interface X, as this is the nicest to me in general.

How are you defining what an interface is here? If you send TCP traffic, TCP is the interface, but neither side owns it.

3 2019-10-19 07:29

Does one of the components provide a service to the other?

4 2019-10-19 09:33 *

Interface X should be owned by The Professor.

5 2019-10-20 12:36

>>2 TCP would be an example, where a parent (the standard) owns the interface.

A more interesting example would be the Protobuf schema which is used between A and B.

In a client-server relationship the server "provides a service", usually the server owns the interface.

6 2019-10-24 00:24

Trick question! Each has it's own. This means sometimes work needs to be done to make interfaces compatible, e.g. making wrappers.

You probably didn't mean the intellectual property of the interface, which, by default, is owned by the maker. There may be agreements that alter who owns the interface.

7


VIP:

do not edit these