-
-
Notifications
You must be signed in to change notification settings - Fork 352
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
refactor: improve meta-metamodel classes about Spoon types and roles #1894
Conversation
@monperrus I guess it is not correct that CI requires javadoc on methods of PRIVATE interface. See 6c251e4 |
Implemenetation of this PR based on code generated by test meta model (SpoonMetaModel) has some problems:
So the solution, which I would probably like the most would be to move SpoonMetaModel from the test to main (runtime) + adapt that API so it is more nice ... WDYT? By the way, do you agree that having a well understandable, fast and precise facade around spoon metamodel (something like SpoonMetaModel) would be helpful for clients and for us, because it allows to implement great new Spoon features? |
I agree that having access to the metamodel at runtime is useful.
I prefer option 2 because:
What would you like to do that is not possible with the shadow CtType of |
Super so we are on the same side ;-)
I agree with all these reasons, but there is one problem: Spoon's CtType is very hard to use for that purpose. For example, the primitive feature, which I need to finish #1686, So I suggest
Do you understand problem? Do you agree to move code from SpoonMetaModel (test only) to Metamodel (runtime)? |
I agree to have one single version of the metamodel both from runtime and test purposes. But it's probably not the current SpoonMetaModel, because its naming, its design and its public methods have to be improved first (it was not designed and reviewed for being part of the public API).
Yes, of course :-)
Yes, this can come later in a subsequent API, once we get the basic API right
Here, instead of delegating, I would propose to extend CtType (and the other appropriate classes), so that it is still metacircular: a metamodel type is a CtType plus some additional metamodel-specific methods such as |
yes, I am aware of that. I agree to refactor it as needed. I also understand current SpoonMetaModel more like a prototype/experimental.... but already quite useful ;-)
I do not understand why. We probably speak about different metamodels. My mental image of Spoon metamodel consists of entities like
Such high level meta model doesn't extend java meta model, because it is language independent. So it makes no sense to ... and on all the places where SpoonMetaModel is already used in testing and generation, there was needed such high level metamodel. So may be you think about something else? What would be And I wonder about one think. How that meta model type which extends CtTypeImpl/CtClassImpl/CtInterfaceImpl would be created? |
Now I see what you mean. Those two concepts/definitions make sense. Maybe we could first agree on names for those concepts, and refactor them in src/test to start with.
|
e9a497f
to
a250692
Compare
Super! So
What next? May be some parts of test model are experimental ... but these are needed:
Concerning MMMethod and MMMethodKind, they are actually used
|
What next?
To go over the public methods and see whether we are OK with the design and documentation to make
them really public in src/main
I would propose to merge this one first to have baby PRs. WDYT?
|
I agree, with merge of this one.
I guess it is task for you. I can refactor it then when you found something. |
This PR