Frank Kobzik has posted comments on this change.

Change subject: engine: GraphicsInfo in entities
......................................................................


Patch Set 8:

(1 comment)

http://gerrit.ovirt.org/#/c/28569/8/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmDynamic.java
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmDynamic.java:

Line 75:     private int guestCpuCount;
Line 76:     @UnchangeableByVdsm
Line 77:     private String overridenConsoleAddress;
Line 78:     private String vdsHostName;
Line 79:     private Map<GraphicsType, GraphicsInfo> graphicsInfos;
> I used it because working with it is often easier than having something spe
Ok, so in later patches I do quite a lot of this:

vm.getGrahphicsInfos().get(GraphicsType.SPICE).getXyz()

with Set/List approach this would be complicated.

What we can do is to wrap GraphicsInfo to GraphicsInfos class (or some more 
sane name - Infos is not valid plural IMHO :) ), that'll look like this (just 
an example):

GraphicsInfos {
 private GraphicsInfo spice;
 private GraphicsInfo vnc;

 public GraphicsInfo getByType(GraphicsType type) {
  // blabla
 } 

}

also the class could also have getEntrySet(), that'd allow iterating through it 
(which is exactly what map does).

I think this looks more like java approach :) What do you think?
Line 80: 
Line 81:     public static final String APPLICATIONS_LIST_FIELD_NAME = 
"appList";
Line 82:     public static final String STATUS_FIELD_NAME = "status";
Line 83: 


-- 
To view, visit http://gerrit.ovirt.org/28569
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ib11a8b63e76031f3137f2dfd0cd6551e9c19aca0
Gerrit-PatchSet: 8
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Frank Kobzik <fkob...@redhat.com>
Gerrit-Reviewer: Arik Hadas <aha...@redhat.com>
Gerrit-Reviewer: Frank Kobzik <fkob...@redhat.com>
Gerrit-Reviewer: Omer Frenkel <ofren...@redhat.com>
Gerrit-Reviewer: Roy Golan <rgo...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to