Alexander Wels has posted comments on this change.

Change subject: utils: pki-resource: cleanup: levarage enum methods for content 
type
......................................................................


Patch Set 6:

>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 guess it is a matter of preference, but like you said it is easy to change.

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

There is no such assumption. We have provided an interface to the servlet to 
look up an internal object based on some values passed in from the outside 
world (the servlet to world interface). Now the internal implementation of the 
enum to servlet interface just happens to try and match the string directly 
with the name of the enums, but there is nothing forcing that, the enum 
implementation is free to modify that in any way it wants, but the result will 
be the same. you pass me a string, I return you an enum object.

> 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?

The difference is when the initialization happens, and how the object is stored.

-- 
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 <alo...@redhat.com>
Gerrit-Reviewer: Alexander Wels <aw...@redhat.com>
Gerrit-Reviewer: Alon Bar-Lev <alo...@redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: No
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to