You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The solution:
The text was updated successfully, but these errors were encountered:
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.
The solution:
The text was updated successfully, but these errors were encountered: