@everett-toews I understand what you mean, and agree that it would be ideal to 
fail in the builder rather than waiting for the API call to be made. However, I 
think failing in the API call is understandable and developers may expect the 
code to fail there (as they may also expect some server side validations not 
directly controlled in the builders), so I think it is not a big deal to fail 
in the API call.

There is also a limitation when keeping the validation in the domain objects. 
If I am not wrong, Marconi is a generic API that can be implemented by several 
providers, each one with their own values. What if someone wants to write 
portable code using different providers that use different values (that is, 
creating two context objects one for each provider)? The `System.setProperty` 
approach will set a per-JVM value, so the domain object won't be able to 
properly perform the validations for both providers.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/46#issuecomment-28467803

Reply via email to