Skip to content

Improve code readability and maintainability in FlaskMVC class and Hook class #52

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 17, 2023

Conversation

marcuxyz
Copy link
Owner

@marcuxyz marcuxyz commented Nov 17, 2023

In the FlaskMVC class:

  • Change the variable name view_func to instance_of_controller to better reflect its purpose.
  • Instead of calling view_func() multiple times, create an instance of the controller class and register it with the hook.
  • Use the instance of the controller to retrieve the view function for each resource.

In the Hook class:

  • Change the parameter name ctrl to instance_of_controller to better reflect its purpose.
  • Use the instance of the controller to retrieve the hook methods.

These changes improve the readability and maintainability of the code by using more descriptive variable names and reducing code duplication.

Close #50

…n FlaskMVC class and Hook class

In the FlaskMVC class:
- Change the variable name `view_func` to `instance_of_controller` to better reflect its purpose.
- Instead of calling `view_func()` multiple times, create an instance of the controller class and register it with the hook.
- Use the instance of the controller to retrieve the view function for each resource.

In the Hook class:
- Change the parameter name `ctrl` to `instance_of_controller` to better reflect its purpose.
- Use the instance of the controller to retrieve the hook methods.

These changes improve the readability and maintainability of the code by using more descriptive variable names and reducing code duplication.
@marcuxyz marcuxyz self-assigned this Nov 17, 2023
@marcuxyz marcuxyz merged commit f79e5b3 into main Nov 17, 2023
@marcuxyz marcuxyz deleted the feature/create_a_uniq_instance_of_controllers branch November 17, 2023 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make work the variable of instance
1 participant