Skip to main content

The importance of interfaces

·2 mins

Interfaces are powerful. That’s why we see them everywhere in software engineering. In fact, I’d say they are essential when you want to depend on something provided by someone else.

For example, when you use a library in Java, Python, Go, whatever, you’re using their public interface. It’s (hopefully) well documented, versioned, and easy to use. You know that you can build on it with confidence and it’s going to be pretty stable. If/when it does need to change there will be a new major version of the library released with a migration path for you to follow, when you are ready to do so.

(Of course, none of these guarantees are provided if you’re using the libraries private interface.)

APIs (application programming interfaces) are another example, and used internally between services and externally between organisations. People build entire businesses upon APIs from organisations like Stripe, Slack and Github and can do so with confidence.

Data typically isn’t provided through an interface. It’s generally a dump of a database to the data warehouse or data lake or whatever, which we then build pipelines on. That’s the services private interface we’re building on, so of course we don’t get any guarantees on the dependability or the quality of the data.

Data contracts provide the interface to data.