Skip to main content

Interface Driven Development

Interface Driven Development (IDD) is also frequently referred to as contract-driven development. IDD lets you focus on what your code needs, not how those need are met. In other circles this may simply be referred to as loose coupling.

Interface (or contract) driven development is the core idea that makes wasmCloud possible. Regular WebAssembly modules operate in a completely isolated sandbox, with no access to the operating system, I/O, networking, or anything else. They can take numbers in and give numbers out. In functional programming circles, we might call this type of code "pure" because it produces no side-effects.

If WebAssembly modules are isolated and sandboxed, how are we supposed to write any meaningful code after implementing the add function? We use abstractions called interfaces. These interfaces give our code access to things like key-value stores, HTTP servers, HTTP clients, message brokers, and much more. As you make your way through the fundamentals section you'll see many examples of interfaces and their implementations (called capability providers).