Alon Bar-Lev has posted comments on this change. Change subject: utils: pki-resource: cleanup: levarage enum methods for content type ......................................................................
Patch Set 6: > With the toString on the format I can write > Format.X509_PEM(PKIResource.ENGINE_CERTIFICATE) which reads better than > PKIResource.ENGINE_CERTIFICATE.getAsString(Format.X509_PEM) well, /me/ primitive prefer verb on object and not verb on the noun... it like you used UTF8.toString(buffer) instead of new String(buffer, "UTF8-") > I do not understand how codifying the interface in an enum is worse than > codifying the interface in a constant string. They are both constant, and > they are both hard coded. There is protocol between the servlet and the external world, this protocol is written in the servlet spec, and is part of the servlet. > The enum is part of utils, it serve the servlet and other implementations. It > can be modified, removed, moved, refactored, but servlet interface must stay > intact. There should be no dependency between the public interface and the design assumption of internal objects. > As for 1. The difference is that the static initialization is in the enum, > not in the servlet. Also if you notice there is no longer a need to do > getInstance() to get some reference to a singleton (no more serialization > issues). I added this getInstance() especially per your request of not to do that in static context. I do not understand the difference between having static context in servlet or any other object, can you please explain? -- To view, visit http://gerrit.ovirt.org/21073 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I24da0ff174599ffdeabbf5846eab429bf0d6510d Gerrit-PatchSet: 6 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Alon Bar-Lev <[email protected]> Gerrit-Reviewer: Alexander Wels <[email protected]> Gerrit-Reviewer: Alon Bar-Lev <[email protected]> Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
