Chapter 6. Apache Thrift IDL
This chapter covers
- Understanding Interface Definition Languages (IDLs) in software development
- Using Apache Thrift IDL syntax and semantics
- Generating code for multiple languages with the Apache Thrift IDL compiler
In this chapter, we’ll examine the features of the Apache Thrift Interface Definition Language (IDL) and learn how to use the Apache Thrift compiler to generate cross-language type serialization and RPC support code (see figure 6.1). We’ll begin by exploring the syntax of the IDL itself and then cover compiler operation, trying out various bits of IDL along the way.
Interfaces exist in hardware and software, defining interactions between components running on a single system as well as components interoperating across networks. The power of abstraction delivered by interfaces is one of the most basic and critical tools in computer science for managing complexity.
Most developers design and use interfaces daily. In object-oriented programming, each class created has its own interface, allowing state and other implementation details to be encapsulated. When clients are isolated from implementation details, as long as the interface is preserved, object internals can change as needed. The implementation can even be moved to another computer if the client has a local proxy for the remote object that supports the same interface.