-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Chain of Responsabilty Pattern.
The main reason to use this pattern is that in the EventManagementSystem class the two methods clientLogin and AdmiLogin have a peculiar way of behaving and if we realize they must make a chain of validations, therefore, we should apply the design pattern “ chian of responsibility”, in order to optimize the process and instead of using methods for each type of login, we will use classes that generalize the process.
Strategy Pattern.
Analyzing the behavior of this code, we can notice that it has several nested ifs, with this in each condition we notice that it is a different way of doing the operation. Taking this as background, we can notice that we can divide it into strategies to make these calculations and thus avoiding the nested if statement.