Aspect orientated programming in MPS
Hello
I would like to create language in MPS which can patch existing Type.
What I would like to do is to have composite system where I can alter class in
separate addon.
For example I would have main class which would look like this
declare business object Project
declare property String Name size 50;
declare property String Description size 400;
declare many Task Tasks;
end;
and then in separate project something like this:
alter business object Project
alter property Name size 100;
drop property Description;
declare property Account Account after Description;
end;
Actually I would like to override add or drop any part of alredy existing type.
Marek
Please sign in to leave a comment.
Hi Marek,
is this an announcement or a question somewhere hidden?
regards, jens
Currently it is question. My knowledge of MPS is still very shallow. But my dream is data orienteded compositable language which could be easily extended.
MPS seems to be really cool thing to achieve it.
Hi Marek,
what is the question?
the above explained thing you want do you can do with MPS...
Regards,
Mirko
Any tips how to do this ?
I think I understand how to define typesystem if I have reference for some concept in main type (like in extends or implements case). E.g. ClassConcept of Base Language has getMemebers behaviour which gathers all members.
But how can I gather references which are not included in my concept definition but are included in separate concepts. Can I find concepts which have same name or are referenced to me ?
Or maybe I can put references from extension to main concept ?
Hi Marek
it seems to me you are designing a DSL for a model-to-model transformation: you have the source solution, want to apply your "script", and get a target solution.
Maybe a "Plugin Aspect" is the thing you are looking for: there you can create a menu point and run an execute method which manipulates the solution AST.
Best regards,
jens
It is not exactly applying the script. I would like to have real aspect orientetated behaviour. e.g. I want to add new method or field in separate project and have it visible in editors(i do not want only to generate models but use them in another DSL). Where this Plugin Aspect is available and is it suitable for this ?
**** OK I have it. It is "node substitution action"