Proposal for a usage of presenter pattern to solve a problem with one view per ComputeResource
all over the code base.
Motivation:
We have found an N+1 queries issue in Compute Resource vm listings [1]. @Marek_Hulan has created a simple solution tested on vmware [2]. In the process of reviews we found out that the solution will work just for some ComputeResource
s though.
Solution:
We need a better control over the similarities and differences in ComputeResource
s UI (presenting) and we can do so by introducing presenter pattern and encapsulate ComputeResource
UI differences in OOP fashion.
I have a little POC solving the issue described in motivation: github.com/ezr-ondrej/foreman/vmware_listing_performance
[1] Bug #26567: n+1 when listing VMs on VMware - Foreman
[2] https://github.com/theforeman/foreman/pull/6666