Skip to content
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

Default implementations in EntityServerService need to be removed #164

Open
ljacomet opened this issue Oct 20, 2016 · 2 comments
Open

Default implementations in EntityServerService need to be removed #164

ljacomet opened this issue Oct 20, 2016 · 2 comments
Assignees

Comments

@ljacomet
Copy link
Member

ljacomet commented Oct 20, 2016

The implementation provided, while easing the transition into the API change, are really bad because they assume a number of things on the way the Entity works which cannot be generalised.

It would be much better, especially at this beta stage of the API, to force users to implement them correctly for their own use case.

@ljacomet ljacomet added the bug label Oct 20, 2016
@ljacomet
Copy link
Member Author

Thinking about it more - the implementation for EntityServerService.getExecutionStrategy() is valid as sending a message to both active and passive is the default replication mechanism.
Other one should still be removed though.

@myronkscott
Copy link
Member

In this case I feel they are justified for both backward compatibility and ease of transition. What we are assuming is that any user of the API fits into one of three categories for reconfigure

  1. Existing entity using reconfigure under the old implementation - valid because the default implementation mimics old behavior
  2. Entity reconfigure will not be used - valid. Never executed.
  3. Entity reconfigure will be used in a new implementation - valid. Reconfigure will be implemented in the API and invoked in a manner that is has intimate knowledge of how the implementation affects the entity

In the ExecutionStrategy case, what really needs to happen is the replication flag should be removed from the InvocationBuilder and this default implementation moved to default BOTH strategy. Again, we are trying to ease transition so replication flag stays for now and default implemention uses IGNORE.

I understand that in most circles default implementations are considered a bad idea. In this case, the API is acting more like an SPI, almost part of the platform implementation. The developer that implements the API is likely the end user of that implementation. The interface defaults help smooth interactions at the API boundary.

The default implementations also help us internally. It allows us to carve up commits in the implementations of the API so that we do not have to do a release at each method addition or squash commits implementing the addition of separate concepts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants