Skip to content

How to deal with "fat" CrudCrontrollers? #304

Closed Answered by tabacitu
centerdevs asked this question in Q&A (Help)
Discussion options

You must be logged in to vote

Personally, whenever a Controller gets to big, this is what I ask myself and do:

1) Can some of the logic be shortened? Aka is it too verbose?
=> rewrite the addField() statements to Fluent Fields
=> rewrite addColumn() to Fluent Columns
=> rewrite addFilter to Fluent Filters
(usually this makes the controller 3-4x shorter)

2) Can some of the logic be reused somewhere else? Aka is there duplication?
=> Custom Operations / Custom Traits

3) Do I have custom operations? Methods that do not overwrite Create/Update/List, but do something else?
=> Custom Operation, even if it's only used on one CRUD, because it's ridiculously easy to create one;

4) Are there bits of logic that are not that used…

Replies: 0 comments 5 replies

Comment options

You must be logged in to vote
1 reply
@centerdevs
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@centerdevs
Comment options

Answer selected by tabacitu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants