lundi 5 décembre 2016

Design Pattern - Fat adapter

We've implemented the adapter design pattern whose job is the following:

  1. Act as a liaison between service and data access layers.
  2. Convert raw data (from data source, internal or external) to domain specific data. Do necessary validation and massaging.
  3. Sometimes, making the DAO calls may depend on data not readily available from input parameters or additional service calls may need to be made based on input data. In other words, the adapter can't always do a 1:1 mapping between the service and the DAO. It may map the same call from service to different DAO calls based on the input parameters.

Item #3 is starting to worry me as the adapters are becoming more complicated than I'd originally imagined. I'm not aware of a design pattern to trim down an adapter. Is there one? Suggestions?

Aucun commentaire:

Enregistrer un commentaire