Bug 30796 - Standardize CRUD HTML forms to use 1 controller
Summary: Standardize CRUD HTML forms to use 1 controller
Status: RESOLVED WISHLIST
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-05-17 23:28 UTC by David Cook
Modified: 2022-12-06 06:16 UTC (History)
0 users

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Cook 2022-05-17 23:28:11 UTC
I would love it if we only had 1 controller for handling the input from CRUD HTML forms. 

At the moment, we have hundreds of different Perl scripts for CRUD operations where the logic is embedded in the Perl controller scripts and not the underlying Perl model modules. 

Having so many controller scripts means it's difficult to make system-wide changes. Whether changes are made manually or automatically it, it also increases the chance of errors, since you're having to make so many changes (to Perl code or HTML templates).

When you have the 1 standard controller, you can use the same base template, the same base error handling, etc. You take advantage of the DRY principle to make old code easier to maintain and you make it easier to add new code. You can put your base code in a base Perl module, subclass it, and then only make the modifications you need to make for special cases.

--

I work on other PHP and Perl projects that use this model and it's so much nicer. 

Of course, a similar alternative is something along the lines of Bug 30225. I'd be happy for there to be a standard Vue3 based form that used the APIs to handle CRUD.
Comment 1 David Cook 2022-05-17 23:30:37 UTC
Note though that this isn't a priority for me. I figured I'd add it here as it's an idea that has been in my head for years, and it's better to share it with all of you than keep it to myself.

I think with Koha we are often working harder rather than working smarter, and I think this would help us work smarter.
Comment 2 David Cook 2022-12-06 06:16:52 UTC
This would be nice but it's broad and probably not going to happen