Is there a way or design pattern to add supporting information to the existing java object?
Example I have a model class Parent and it has child models. Its nothing but hibernate entities with parent-child hierarchy. The parent class object is being pass through multiple Java business rules class. I would like to add supporting information (might be DTO/VO) to the parent object which will be used in all business rules and also if any business validation errors during business logic it can be added to supporting information object.
Is there a better design to achieve this? Is it good to have a Context object which will be shared across? or better to add non persistent DTO/VO object to parent persistent object?
Aucun commentaire:
Enregistrer un commentaire