ddf-project / DDF

Distributed DataFrame: Productivity = Power x Simplicity For Scientists & Engineers, on any Data Engine
http://ddf.io
Apache License 2.0
167 stars 42 forks source link

add default implementation for IGloballyAddressable #341

Closed Huandao0812 closed 8 years ago

Huandao0812 commented 8 years ago

Description and related tickets, documents

Reviewers: @phvu @hai-adatao

Breaking changes & backward compatible issues

Is this PR a breaking change or has backward compatible issue (e.g: changes in API names, interfaces, signature / remove something...)? If yes, please state out what and tag, and if it can possibly affect BA, please tag aht, tuananh, khangpham and baonguyen

How to test

Describe how this PR is tested. In case manual testing is required, describe how to do so.

PR Progress

Make sure all checkboxes below are checked before merged

phvu commented 8 years ago

I feel this will increase the complexity of the inheritance hierarchy (if we are gonna make other classes inherit GloballyAddressable). Maybe we should add those new functions into AGloballyAddressable instead?

I think one "cleaner" way is to use default methods (http://www.programcreek.com/2014/12/default-methods-in-java-8-and-multiple-inheritance/) to implement getGlobalObjectType and getUri directly in IGloballyAddressable, and other things like UUID, name and namespace will be handled in AGloballyAddressable.

Huandao0812 commented 8 years ago

@phvu fixed

phvu commented 8 years ago

lgtm

PangZhi commented 8 years ago

@Huandao0812 lgtm