google-nomulus/java/google/registry
cgoldfeder 5098b03af4 DeReference the codebase
This change replaces all Ref objects in the code with Key objects. These are
stored in datastore as the same object (raw datastore keys), so this is not
a model change.

Our best practices doc says to use Keys not Refs because:
 * The .get() method obscures what's actually going on
   - Much harder to visually audit the code for datastore loads
   - Hard to distinguish Ref<T> get()'s from Optional get()'s and Supplier get()'s
 * Implicit ofy().load() offers much less control
   - Antipattern for ultimate goal of making Ofy injectable
   - Can't control cache use or batch loading without making ofy() explicit anyway
 * Serialization behavior is surprising and could be quite dangerous/incorrect
   - Can lead to serialization errors. If it actually worked "as intended",
     it would lead to a Ref<> on a serialized object being replaced upon
     deserialization with a stale copy of the old value, which could potentially
     break all kinds of transactional expectations
 * Having both Ref<T> and Key<T> introduces extra boilerplate everywhere
   - E.g. helper methods all need to have Ref and Key overloads, or you need to
     call .key() to get the Key<T> for every Ref<T> you want to pass in
   - Creating a Ref<T> is more cumbersome, since it doesn't have all the create()
     overloads that Key<T> has, only create(Key<T>) and create(Entity) - no way to
     create directly from kind+ID/name, raw Key, websafe key string, etc.

(Note that Refs are treated specially by Objectify's @Load method and Keys are not;
we don't use that feature, but it is the one advantage Refs have over Keys.)

The direct impetus for this change is that I am trying to audit our use of memcache,
and the implicit .get() calls to datastore were making that very hard.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=131965491
2016-09-02 13:50:20 -04:00
..
backup MOE strip compatible_with 2016-08-02 19:14:28 -04:00
bigquery Narrowly scope privileges for API service objects 2016-08-02 19:18:09 -04:00
billing MOE strip compatible_with 2016-08-02 19:14:28 -04:00
braintree MOE strip compatible_with 2016-08-02 19:14:28 -04:00
builddefs Use zip_rule() for EAR/WAR deploy archives 2016-08-02 21:00:39 -04:00
config Remove an unused import and change @link to @code 2016-08-22 14:35:57 -04:00
cron MOE strip compatible_with 2016-08-02 19:14:28 -04:00
dns Add metrics to PublishDnsUpdatesAction 2016-08-26 09:43:30 -04:00
eclipse Integrate: Eclipse file generation script 2016-05-16 18:39:45 -04:00
env Small fixes for orphan glue cleanup [] 2016-08-22 14:04:44 -04:00
export Narrowly scope privileges for API service objects 2016-08-02 19:18:09 -04:00
flows DeReference the codebase 2016-09-02 13:50:20 -04:00
gcs Add escrow file import validation logic 2016-08-02 19:22:30 -04:00
groups Narrowly scope privileges for API service objects 2016-08-02 19:18:09 -04:00
idn Rename Java packages to use the .google TLD 2016-05-13 20:04:42 -04:00
keyring/api MOE strip compatible_with 2016-08-02 19:14:28 -04:00
loadtest MOE strip compatible_with 2016-08-02 19:14:28 -04:00
mapreduce DeReference the codebase 2016-09-02 13:50:20 -04:00
model DeReference the codebase 2016-09-02 13:50:20 -04:00
module Add metrics to PublishDnsUpdatesAction 2016-08-26 09:43:30 -04:00
monitoring DeReference the codebase 2016-09-02 13:50:20 -04:00
pricing Add valid TLD check to LrpToken validation 2016-08-30 14:10:54 -04:00
rdap DeReference the codebase 2016-09-02 13:50:20 -04:00
rde DeReference the codebase 2016-09-02 13:50:20 -04:00
request Copy two more fields when building delegated admin GoogleCredential 2016-09-02 13:45:52 -04:00
security MOE strip compatible_with 2016-08-02 19:14:28 -04:00
storage/drive MOE strip compatible_with 2016-08-02 19:14:28 -04:00
tldconfig/idn MOE strip compatible_with 2016-08-02 19:14:28 -04:00
tmch MOE strip compatible_with 2016-08-02 19:14:28 -04:00
tools DeReference the codebase 2016-09-02 13:50:20 -04:00
ui Remove unused redirectIfNotLoggedIn() method 2016-08-22 14:41:41 -04:00
util MOE strip compatible_with 2016-08-02 19:14:28 -04:00
whois DeReference the codebase 2016-09-02 13:50:20 -04:00
xjc Clean up some genrule() script code 2016-08-05 20:40:39 -04:00
xml MOE strip compatible_with 2016-08-02 19:14:28 -04:00
BUILD Mark rest of Domain Registry for App Engine compatibility 2016-08-26 09:48:37 -04:00
repositories.bzl Add StackDriver implementation, in monitoring/metrics package 2016-08-15 17:12:35 -04:00