Github user alopresto commented on the pull request:
https://github.com/apache/nifi/pull/452#issuecomment-220227038
@bbende thanks for the explanation. I suppose I am more familiar with, and
conditioned to assume, the models used in many database-backed frameworks where
the user and group models are canonical -- while there may be many `User`
objects instantiated that describe "Andy LoPresto", they all refer to the same
record in persistent storage, and modifying one (and saving it) updates the
record that all point to. In addition, it would not be necessary to clone a
retrieved record in order to modify it.
Example (using Rails/Grails-esque syntax, but easily replaceable with
`authorizer.getUser(id)`):
```
User andy = User.getByUsername("alopresto")
logger.info(andy.getFirstName()) // "Andrew"
andy.setFirstName("Andy")
andy.update()
```
In addition, while updating the relationship can be done from either end
(i.e. adding a user to _n_ groups is easier by modifying the one user instead
of retrieving and modifying _n_ groups, while removing all users from a
specific group would use the opposite operation), it seems like the model
proposed above duplicates a lot of data during each operation. Is there a
reason for this? It seems likely there is a tradeoff I am missing.
I also have questions about resolving uniqueness constraints, ID
mutability, locks, merge conflicts, etc. on updates, but it seems that these
details are delegated to the `authorizer` implementation?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---