Juan Hernandez has posted comments on this change.

Change subject: restapi: Move Assigned Tag remove from collection to entity
......................................................................


Patch Set 1:

(1 comment)

https://gerrit.ovirt.org/#/c/41982/1/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/AbstractBackendAssignedTagsResource.java
File 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/AbstractBackendAssignedTagsResource.java:

Line 78
Line 79
Line 80
Line 81
Line 82
> Why did you choose to move this to the inheriting classes?
The main reason is that I had to move the "remove" tests from the collection 
test class to the entity test class, and it was really difficult to do it in a 
generic way, as there are many small differences, so I decided to have a new 
test class for each kind of entity: BackendTagResourceTest, 
BackendUserTagResourceTest, etc. This is easier if there is also a different 
resource class for each kind of entity, so I decided to create a new resource 
class for each kind of entity. In this situation the instance can't be created 
here, as "BackendAssignedTagResource" becomes abstract (and renamed to 
"AbstractAssiginedTagResource". We cloud have an abstract 
"createAssignedTagResource" method to be overriden by the subclasses, but I 
think that is overcomplicated, it is better to move this method.

In general I think like classes like this aren't that good. They save some 
lines of boilerplate code at the price of complicating the design and making 
changes (like this one) more complicated to do and understand.


-- 
To view, visit https://gerrit.ovirt.org/41982
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ib725ccb39a7fdcf6c418e3187b21d8e4521dfabc
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Juan Hernandez <juan.hernan...@redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Juan Hernandez <juan.hernan...@redhat.com>
Gerrit-Reviewer: Ori Liel <ol...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to