-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HollowTypeAPI implements HollowRecordDelegate. #408
base: master
Are you sure you want to change the base?
Conversation
this.typeDataAccess = typeDataAccess; | ||
} | ||
|
||
public HollowAPI getAPI() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing this method is a breaking change. Did you remove to simplify or was it required for all type API implementations to implement their corresponding delegate?
I have a general concern on the change and removal of public API artifacts before they have been marked as deprecated, rather than just focusing on not generating a client API artifact that is an implementation detail. |
To answer my own question. I believe the changes to the protected constructor of For example, the test @SuppressWarnings("all")
public class ActorTypeAPI extends HollowObjectTypeAPI {
private final ActorDelegateLookupImpl delegateLookupImpl;
public ActorTypeAPI(PrimitiveTypeTestAPI api, HollowObjectTypeDataAccess typeDataAccess) {
super(api, typeDataAccess, new String[] {
"name",
"role"
});
this.delegateLookupImpl = new ActorDelegateLookupImpl(this);
}
... It relies on the constructor of |
@@ -108,6 +108,12 @@ public int getPosition(String fieldName) { | |||
return index.intValue(); | |||
} | |||
|
|||
public String[] getFieldNames() { | |||
String[] copyFieldNames = new String[fieldNames.length]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use return fieldNames.clone();
builder.append(" private final ").append(delegateLookupClassname(schema)).append(" delegateLookupImpl;\n\n"); | ||
|
||
builder.append(" public ").append(className).append("(").append(apiClassname).append(" api, HollowListTypeDataAccess dataAccess) {\n"); | ||
builder.append(" public ").append(className).append("(").append(apiClassname). append(" api, HollowListTypeDataAccess dataAccess) {\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: rogue space apiClassname). append
9150365
to
ae3c3aa
Compare
…on and reducing the number of generated classes
…rts in all factory classes
… add the generic lookup impls for all the generic delegate objects, accordingly modify the type API generation
…n HollowObjectSchema
…ld extend this class
Hollow has two implementations for
HollowRecordDelegate
interface. An implementation of this interface is used by theHollowFactory
when instantiating aHollowRecord
. All the implementations ofHollowRecord
use the delegate instances to read data from the correspondingHollowTypeDataAccess
. The flavors of the delegate interfaces areCachedImpl
andLookupImpl
.LookupImpl
delegates all the reads toHollowTypeAPI
. In order to reduce code generation and simplify the code generation,HollowTypeAPI
now directly implementsHollowRecordDelegate
and the factory usesHollowTypeAPI
as a delegate.