[
https://issues.apache.org/jira/browse/ARIA-333?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16107281#comment-16107281
]
Tal Liron commented on ARIA-333:
--------------------------------
It seems to me that events are the "right" way to do it in SQLAlchemy. Yes,
it's complicated (everything in SQLAlchemy is complicated), but it's how even
the SQLAlchemy docs suggest solving such situations.
Our code is already hard to follow, and instrumentation has ripple effects
throughout other parts of the code due to classes being replaced with proxies.
Perhaps we can do a quick POC of using events instead instrumentation just to
compare the code and its side-effects.
> Remove model instrumentation code
> ---------------------------------
>
> Key: ARIA-333
> URL: https://issues.apache.org/jira/browse/ARIA-333
> Project: AriaTosca
> Issue Type: Story
> Reporter: Tal Liron
>
> Our model instrumentation code is some of the most complex part of our
> codebase. It is difficult to understand and maintain.
> Why do we have this complex mechanism? Because we want it to be easier to
> access values in parameters dicts without having to add {{.value}}.
> In the case of the ctx proxy, there is a much simpler solution. We could just
> check if the final value is a {{models.Parameter}}, and if so unpack the
> value from it.
> For uses of ctx within Python there indeed is no simple solution. However, in
> my opinion the solution we chose is far too complex, and the cons far
> outweigh the pros.
> In the end, it's really seems not too much to expect a Python programmer to
> add {{.value}} where necessary.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)