Spike: Should TableEntity and its decedents specify Map<String,EntityProperty> instead of HashMap<String,EntityProperty>
Dev estimate: 5 Test estimate: 0
Defining method and constructors in terms of the appropriate Interfaces (Map) instead of the implementation (HashMap) is pretty standard in Java. Specifying HashMap limits the use of the Interface and also inhibits changing the underlying implementation in the future.
Changing this now will make things more usable now and increase maintainability in the future.
FWIW, Bill
Do u have specific scenario of Map is superior than HashMap ? Just want to get better clarity of the use case.
+1 for Bill. Always 'Program to the interface'
gcheng - This is an Architectural/Design distinction. Map is not superior to HashMap. They are closely related (HashMap implements Map) but of entirely different ... natures? Gamma explains it better than I can (about halfway down the page). Basically, by defining a method in term of the (very) specific object, instead of the much more general interface, you restrict the method's callers to the specific object, and impede your ability to later pick a better, internal implementation should you discover the need. A classic case is discovering that your implementation is not thread-safe, and you'd like it to be. If you're locked into HashMap you'll need to add some explicit locking or (shudder) sychronize. If you'd defined the method in terms of Map, you could potentially use an implementation of ConcurrentMap internally instead.
One note on Gamma's comments about abstract classes; while it's true that changing them can break client code, you can extend them, adding changes in the extension w/o breaking the base interface. The pattern is the same as using an abstract class w/o (again) locking yourself into an implementation.
apologies for the novel
We will spend some time to go through the public APIs to see what are the other places we can improve to use base class or interfaces. After we get the list, we will see what we can improve.
Here is a stackoverflow post about why interface is beneficial for OO. http://stackoverflow.com/questions/2026054/why-do-we-use-interface-is-it-only-for-standardization
This part of the code actually belong to storage team, move to backlog, assign to appropriate personals.
storage team now has their own repo, move to storage repo