Presenter pattern to abstract Compute Resources UI



Proposal for a usage of presenter pattern to solve a problem with one view per ComputeResource all over the code base.

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 ComputeResources though.

We need a better control over the similarities and differences in ComputeResources 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:

[1] Bug #26567: n+1 when listing VMs on VMware - Foreman


Awesome! I think we should use the same pattern on more places. :+1: from me


Yeah, if we decide to roll with it, I would like to see most of the Resource specific views removed (moved to presenters) :blush: