14 Advanced data manipulation

 

Whatever is well-conceived is clearly said

This chapter covers

  • Manipulating nested data
  • Writing clear and concise code for business logic
  • Separating business logic and generic data manipulation
  • Building custom data manipulation tools
  • Using the best tool for the job

When our business logic involves advanced data processing, the generic data manipulation functions provided by the language run time and by third-party libraries might not be sufficient. Instead of mixing the details of data manipulation with business logic, we can write our own generic data manipulation functions and implement our custom business logic using them. Separating business logic from the internal details of data manipulation makes the business logic code concise and easy to read for other developers.

14.1 Updating a value in a map with eloquence

Dave is more and more autonomous on the Klafim project. He can implement most features on his own, typically turning to Theo only for code reviews. Dave’s code quality standards are quite high. Even when his code is functionally solid, he tends to be unsatisfied with its readability. Today, he asks for Theo’s help in improving the readability of the code that fixes a bug Theo introduced a long time ago.

  DAVE I think I have a found a bug in the code that returns book information from the Open Library API.

  THEO What bug?

  DAVE Sometimes, the API returns duplicate author names, and we pass the duplicates through to the client.

14.2 Manipulating nested data

14.3 Using the best tool for the job

14.4 Unwinding at ease

Summary

sitemap