Martin Peřina has posted comments on this change.

Change subject: tools: Support for POSIX and GNU long params in 
engine-manage-domains
......................................................................


Patch Set 2:

Yair, we are in this situation:
 1) Java application needs to params from command line. It knows everything 
about params (names, format, types, requirements, ...)
 2) The only way how to pass cmd line params to client Java app is pass them as 
cmd line params to JRE, which transforms them into String array

What I'm trying to do is to implement every params related processing in Java. 
Shell script only needs to start JRE with correct Java application and pass cmd 
line params to it. ArgumentParser instance in Java is configured to know 
everything about cmd line params application need. So it reads String array, 
check params correctness, handle all possible errors in params and converts 
String value to required Java type.

If we split cmd line parsing into Java part and Python/Shell part we will be in 
this situation:
1) Java app will need to know exact index of each param value in String array 
create by JRE and will convert this String value to required type
2) In Python/Shell you will need to implement all other logic (parsing params 
and their values, test params correctness, test param value correctness, place 
param value to correct position in Java app parameters)
So once this is implemented for current parameters it may work fine, but the 
problem arise with some parameter change. Every change will have to be 
implemented on both parts, but there's very weak link between them. For example 
if you change possible value for LDAP provider, there's no easy way how to warn 
the developer that Python/Shell side needs to be updated.
If all cmd line params logic are only in Java, it's much more maintainable 
solution. That's why I wrote the patch like this.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I9c70ace879ad17121c2ed11fce0ffc06612b79fe
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Martin Peřina <[email protected]>
Gerrit-Reviewer: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Barak Azulay <[email protected]>
Gerrit-Reviewer: Juan Hernandez <[email protected]>
Gerrit-Reviewer: Martin Peřina <[email protected]>
Gerrit-Reviewer: Roy Golan <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to