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

feature: add first metamodel support #1378

Merged
merged 2 commits into from
Jun 12, 2017
Merged

Conversation

monperrus
Copy link
Collaborator

first step for #1183

WDYT?

@monperrus monperrus force-pushed the feat-metamodel branch 3 times, most recently from 6323bbc to 51ea825 Compare June 7, 2017 19:38
@pvojtechovsky
Copy link
Collaborator

It is on good way! May be I will have Xmas sooner? ;-)

Some ideas:

May be it might return Set instead of Collection.

The returned references have assigned different Factory instance, may be we should add new type of spoon object under Factory, called MetaModel, which would provide such information (and which would have access to the correct parent factory.)

Or return Set with qualified names of interfaces? It is faster to search in it.

result.add(factory.Type().get(spoon.reflect.reference.CtTypeReference.class));
result.add(factory.Type().get(spoon.reflect.reference.CtUnboundVariableReference.class));
result.add(factory.Type().get(spoon.reflect.reference.CtVariableReference.class));
result.add(factory.Type().get(spoon.reflect.reference.CtWildcardReference.class));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you do this by hand instead of retrieving all classes of interesting packages by reflection?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know the performance of reflection?

@monperrus
Copy link
Collaborator Author

May be it might return Set instead of Collection.

Agree, done.

The returned references have assigned different Factory instance,

Yes, but the equals contract works across factories.

may be we should add new type of spoon object under Factory, called MetaModel, which would provide such information (and which would have access to the correct parent factory.)

Let's start with a stateless design first (stateless is better), we'll modify it later if needed.

Or return Set with qualified names of interfaces? It is faster to search in it.

I would prefer domain-specific types over strings

@surli surli merged commit d0e1102 into INRIA:master Jun 12, 2017
@pvojtechovsky pvojtechovsky mentioned this pull request Jun 27, 2017
2 tasks
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

Successfully merging this pull request may close these issues.

4 participants