-
Notifications
You must be signed in to change notification settings - Fork 773
Description
The class app/helpers/moments_form_helper.rb currently handles multiple responsibilities including constructing the form input properties and handling business logic. Currently, this violates Single Responsibility Principle, which states that a class must only have one responsibility and only have one reason to change.
The introduction of a new class that would encapsulate the logic for input properties, thus separating the responsibilities between two classes, would fix this violation. Attached is an idea of what this would look like if the change is made. Additionally, tests that relate to this class will need to be updated to reflect this change as well as adding more tests to test the new class.
This would be a stepping stone in ensuring that this codebase adheres to the SOLID principles, which would improve the overall architecture of this codebase. In the long run, this change as small as it may seem, allows these classes to be easier to maintain and test as these two responsibilities can be tested individually.
Please comment with any feedback!