dimanche 28 février 2021

What Java design pattern fits the scenario of adding a user to multiple systems based on csv values?

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:

  1. ActiveDirectoryUser
  2. SisenseUser
  3. 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

  1. Read in each line from the spreadsheet
  2. Validate the input is valid.
  3. Create a instance of each model class that contains the appropriate fields.
  4. 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