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

Improve the Inheritance Hierarchy of Generated Domain Models #162

Open
sgarfinkel opened this issue May 6, 2020 · 1 comment
Open

Improve the Inheritance Hierarchy of Generated Domain Models #162

sgarfinkel opened this issue May 6, 2020 · 1 comment
Assignees

Comments

@sgarfinkel
Copy link

sgarfinkel commented May 6, 2020

Given a ResourceShape Foo, the following are generated:

public class Foo extends AbstractResource implements IFoo {
...
}

public interface IFoo {
...
}

This inverts the standard Java pattern where the interface should define all contracts that must be implemented by the underlying concrete classes (including other interfaces) so that you can use the interface interchangeably with the underlying datatype when possible.

Instead, the generated interface should also extend IExtendedResourceShape:

public interface IFoo extends IExtendedResourceShape {
...
}
@jadelkhoury jadelkhoury self-assigned this May 7, 2020
@jadelkhoury
Copy link
Contributor

Sound reasonable. The main reason I introduced interfaces was to implement multiple inheritance, which was needed for very specific use cases in Lyo Designer.
So we need to test this suggestion in those scenarios when FOO extends ResourceA, but also implement IResourceB and IResourceC

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

2 participants