I have two ifs that control the request type (form requested or data requested), these two types have the same options or methods, but different behavior.
Example: form requested: option to generate report, this generates the form to capture the data. data requested: option generate report, this manages the data of the form questioned and returns the report.
Basically one builds the forms and the other processes them.
I'm temporarily handling it with if conditions, however I find myself a bit trapped by the following:
If the option generate report of requested data finds a problem in the data or if it already exists in the system, he should be able to return to the form requested option to generate report to show him the form again.
Based on what I saw the one for the adapter pattern, I would like to implement a bit of what it does but without going through the pattern as such.
Example: I separate the requested form and requested data into two different classes and create a requested handled class, through a method that guides the request to the corresponding class.
What do you recommend? I would like to have another perspective
Aucun commentaire:
Enregistrer un commentaire