vendredi 16 septembre 2016

Is there any matching design pattern for that

I built 5 services, which are doing validation and returning null (if validation successfull) or an error-object, if validation failed. So, this 5 service-classes must be executed in rotation, but if one of these returns an error-object, then the "master-service" should return the consumed error-object.

therefore, I wondered if there is already any design-pattern I could use for my problem to get a clean solution. Further, should I build a master-service,which calls the services in rotation or how should the validation-services be called?

any help would be greatly appreciated !

(btw. I'm using java ee 7)

Aucun commentaire:

Enregistrer un commentaire