Changes between Initial Version and Version 1 of Ticket #29750, comment 2


Ignore:
Timestamp:
Sep 12, 2018, 9:01:37 AM (6 years ago)
Author:
Carlton Gibson

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #29750, comment 2

    initial v1  
    1717The example is intentionally simplified to illustrate the ordering problem in a short amount of code. Would a more complete example help?
    1818
    19 > If such repetition did become overwhelming, if can be factored to a helper that is a single line to call, that remains part of the view logic. In the example, sometimes the "Cannot make decisions based on self.access_a nor self.access_long" exists in yet another mixin, as the pattern is repeated across a large number of views.
     19> If such repetition did become overwhelming, if can be factored to a helper that is a single line to call, that remains part of the view logic.
     20
     21In the example, sometimes the "Cannot make decisions based on self.access_a nor self.access_long" exists in yet another mixin, as the pattern is repeated across a large number of views.
    2022
    2123We find the duplication ''increases'' the maintenance burden as when writing a new new views, the developer must remember to include these repetitive calls. This can be easy to forget for new developers first learning the system. If ''x'' views inherit the mixin, then the "single line" must be repeated ''x'' times (or 2''x'' times if for both `post()` and `get()`). As these mixins are often used for authorization, forgetting to repeat oneself could result in accidental leak of private data.
Back to Top