You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@isis.apache.org by "Dan Haywood (JIRA)" <ji...@apache.org> on 2018/02/17 18:26:00 UTC

[jira] [Updated] (ISIS-804) Make (entity) properties read-only by default.

     [ https://issues.apache.org/jira/browse/ISIS-804?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dan Haywood updated ISIS-804:
-----------------------------
    Fix Version/s:     (was: 3.0.0)
                   1.16.1

> Make (entity) properties read-only by default.
> ----------------------------------------------
>
>                 Key: ISIS-804
>                 URL: https://issues.apache.org/jira/browse/ISIS-804
>             Project: Isis
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: core-1.5.0
>            Reporter: Dan Haywood
>            Priority: Major
>             Fix For: 1.16.1
>
>
> Currently properties are read/write by default; the programmer has to annotate with @Disabled (or equivalent) to make read-only.
> While this "subtractive programming" approach is nice for demo's, the truth is that with larger applications, if not rigorously and completely tested, the end-user may get the opportunity to change something that they ought not; potentially corrupting data.
> It would be better (and safer) for properties to be read-only by default.
> The presence of the modifyXxx(...)/clearXxx() supporting methods would then indicate that they are read-write.
> Another possible benefit is that - if we implement ISIS-273 (to read from fields) then the amount of boilerplate would substantially be reduced if a tool like Lombok was used.  That is, read-only properties would consist solely of a private field; read-write properties would be the field plus the modify/clear.
> It might also make sense for the clearXxx() method to be optional; that is, to allow modifyXxx(..) to be called with null.
> NB: for view models, properties could (perhaps) remain as read-write; there are no side-effects.
> This change requires discussion on the mailing list.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)