mercredi 30 janvier 2019

passing a new value through multiple layers in legacy code

I have a monolith backend application. I have a client layer (to call a second service) which lies after several layers of business logic, lets say 3-4 layers of services and other classes. Its in java 6. I have a new requirement to forward a string value to that layer from my controller layer with minimal modification to the middle tier layers.

What can be possible good ways?

  1. I know of one -ThreadLocal. Is ThreadLocal safe to use in java 6 if i use it.
  2. Are there other design patterns that I can use in this scenario.

I certainly can't change contracts for all middle layers now.

Aucun commentaire:

Enregistrer un commentaire