mercredi 28 septembre 2022

Add the Admin pattern to an existing software

My question is about design, Let's say that I built a parking system. This system has classes for entries, cars, slots, tickets ... and everything you can imaging in a parking lot, Obviously this system need's someone to control it, or maybe multiple people will work on it. I need a class diagram for User, Admin ext, I prefer if i have the ability to easily create new types of users that has different privileges. I tried the strategy pattern where every privilege has an allowed and not allowed strategy, and when I want to create a new type of user, I give it the appropriate strategies. I'm not sure if this is a good solution, can someone make a class diagram for the user, maybe using the strategy pattern, but feel free to use the solution that you think is more suitable for this problem. For the rest of the app use an abstraction, I don't think that it's important. I just need the user part.

also I want it to be like linux, You log in with your password as an admin or something else.

Aucun commentaire:

Enregistrer un commentaire