Quantcast
Viewing all articles
Browse latest Browse all 294917

Rename entity storage/list/form/render controllers to handlers, part 2: rename controllers?

Splitting off from #1807042: Rename entity storage/list/form/render controllers to handlers, part 1: organize existing annotation keys since that's now focussed on the annotation keys.

While I disagree that we need to change the name due to a conflict with Route Controllers (there are a few different, legitimate types of controllers), I do believe our naming here doesn't make much sense.

We are going back and forth on which bad name to choose, because none of them provide any more context to the reader about what these objects actually do. If anything, it just muddles their intention more.

Instead, how about we just dont use them?

<?php
/**
* Defines a Block configuration entity class.
*
* @EntityType(
*   storage = "Drupal\block\BlockStorage",
*   access = "Drupal\block\BlockAccessController",
*   render = "Drupal\block\BlockRenderable",
*   list = "Drupal\block\BlockList",
*   form = {
*     "default" = "Drupal\block\BlockForm"
*   },
* )
*/
class Block extends ConfigEntityBase {
?>

Compared to what we have now, I think these class names convey a lot more information about what they actually are (I only kept Controller on AccessController because "access control" is a for-real thing).


Viewing all articles
Browse latest Browse all 294917

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>