Implementing contract-driven tooling
The final part of our sample implementation looks at how we can easily implement tooling driven by the data contract, using the example of a data anonymization service.
As we discussed in Chapter 7, A Contract-Driven Data Architecture, one of the key benefits of data contracts is that we can use the metadata we capture to build generic data tooling. These tools don’t know or care about the data itself or how it is structured. If it knows enough about the data, it can take the right action.
As the data contract itself is machine-readable, and we’re writing custom code, we can use it directly from this service, as highlighted in the following diagram:
Figure 8.7 – Using the data contract directly to implement an anonymization service
As with all the examples shown in this chapter, the code is simple. The following code from anonymize.py
shows a simple anonymization function driven by the contract...