codeconsole commented on PR #15266:
URL: https://github.com/apache/grails-core/pull/15266#issuecomment-3597918323

   > Looks useful!
   > 
   > I find the `DisplayType` values a bit unintuitive. Suggestion:
   > 
   > ```
   > DisplayType.ALL -> DisplayType.ALWAYS
   > DisplayType.NONE -> DisplayType.NEVER
   > DisplayType.INPUT_ONLY -> DisplayType.WRITE_ONLY
   > DisplayType.OUTPUT_ONLY -> DisplayType.READ_ONLY
   > ```
   
   There already is an editable constraint that controls whether a field is 
read-only in forms. `READ_ONLY` as a display type might be confused with that 
concept.
   
   "input" and "output" directly correspond to the view types:
     - Input views = create/edit forms (where users input data)
     - Output views = show/index pages (where data is output to users)
   
   Using `WRITE_ONLY` and `READ_ONLY` introduces a different mental model 
(database operations) that doesn't quite match what's  happening. The 
scaffolding is about display in views, not about read/write permissions to the 
database. A property marked `OUTPUT_ONLY` can still be written to 
programmatically - it's just not shown in input forms.
   
   I chose NONE because it is similar to display: 'none' is a css rule which is 
pretty common.
   
   `ALL` or `ALWAYS` I am indifferent on and I guess if we went with `ALWAYS`,` 
NEVER` would make more sense.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to