dimanche 11 mars 2018

How to create Hibernate Entities based on open-close principle without reflection

Based on spring-boot app we have controller which receive hash-map.

We want to create based on the input type (getting typeId inside the hashmap input) it's corresponding hibernate entity.

we want to avoid using IF statements so enhancements wont touch existed code while adding new entities will be allowed.

We also need to think about validators without violating the open-close principle as well.

any suggestions?

thank you.

Aucun commentaire:

Enregistrer un commentaire