I am working on a project where I need to add users to multiple systems (active directory, a database, & Sisense) based on data received from a spreadsheet. I've coded can get the data input correctly into each system, but I am struggling to figure out how to organize my code, in terms of what design pattern to use.
I have a model class for each component that contains the field each system needs:
- ActiveDirectoryUser
- SisenseUser
- DatabaseUser
Then, I have what I call the worker class for each of these that actually does creates the user in the system. ActiveDirectoryWorker SisenseWorker DatabaseWorker
The basic flow of my code is
- Read in each line from the spreadsheet
- Validate the input is valid.
- Create a instance of each model class that contains the appropriate fields.
- Call the individual worker classes that control how the user get added to the respective system. The model instance will be passed into this class.
I've read up on some of the various design patterns, but none of the explanations are in "plain" English. Still learning the ropes here a bit, so I'd appreciate someone suggesting a model that fits my scenario.
Aucun commentaire:
Enregistrer un commentaire