Object Mappers
In this chapter, we explore object mapping. As we saw in the previous chapter, working with layers often leads to copying models from one layer to another. Object mappers solve that problem.
We first look at manually implementing an object mapper, because understanding the basics is very important to progress further. Then, we improve our design by regrouping the mappers under a mapper service, exploring the Aggregate Services pattern, and creating a mapping façade along the way, reusing the Façade pattern once more.
Finally, we replace that manual work with two open-source tools that help us generate business value instead of writing mapping code.
In this chapter, we cover the following topics:
- The Object Mapper pattern
- Code smell – too many dependencies
- Overview of the Aggregate Services pattern
- Implementing a mapping façade
- Implementing a mapping service
- Exploring AutoMapper
- Exploring...