get the instance of the Main AcceleoGenerator class from query invoke [message #1841980] |
Sat, 05 June 2021 13:21  |
Eclipse User |
|
|
|
Hi,
I want to access the instance of the Main class (extends AbstractAcceleoGenerator) with which a model is generated from a java method which is invoked by an acceleo query.
How to do so?
For now I use static members but this certainly dirty and unstable.
[Updated on: Sat, 05 June 2021 13:22] by Moderator
|
|
|
|
|
Re: get the instance of the Main AcceleoGenerator class from query invoke [message #1841988 is a reply to message #1841984] |
Sun, 06 June 2021 02:49   |
Eclipse User |
|
|
|
Hi
If you are enthusiastic about Acceleo and want to make it available in a different context, I recommend that you establish a close relationship with the Acceleo team so that your work can enhance rather than fork Acceleo.
I fear that you may find that your users have different metamodel resolution requirements and so you may find that the current URI fudge, that only works for simple models, has to be revisited. You may find that other pain points also justify your time.
wrt an Acceleo tooling model, consider a similar Eclipse tooling model, which already exists as workbench.xmi which instantiates many metamodels such as http://www.eclipse.org/ui/2010/UIModel/application. You could write a Java invoke to get at the Workbench root and from there, an Acceleo M2T could locate many other things. But again I ask why bother? If a user really wants so much insight at the Java level, much better to program in Java or Xtend. I really doubt such users exist.
In a web application, providing an ability for users to browse the underlying application will of course aggravate security challenges,
Truly static in a multi-use application could well be a serious problem. The easiest solution is to ensure that each use runs a new copy of the Acceleo application. Else each use creates a new worker thread and you use ThreadLocals. New copies have the major advantage that it is really hard for one usage to crash the overall application and so mess up other usages. New threads allow test harnesses to simulate multiple concurrent usages. Maybe new runs and worker threads.
Regards
Ed Willink
[Updated on: Sun, 06 June 2021 03:03] by Moderator
|
|
|
|
Re: get the instance of the Main AcceleoGenerator class from query invoke [message #1842021 is a reply to message #1841991] |
Mon, 07 June 2021 09:24   |
Eclipse User |
|
|
|
Hi
Good luck making money from modeling. Few are succeeding. Most users expect it all to be free, particularly those of use who provide free software.
You will be be close to a trained Java developer by the time things work. You may find it helpful to have 100% (not 99,99%) Open Source plugins and distinct proprietary plugins. Stay well clear of fragment plugins.
I cannot really imagine what your textual output does, but if you want to tease your users adequately then provide the full safety and requirements modeling for free, restrict your charging to full functionality rather than stub functionality safety and requirements M2T.
Remember also that today, while working on your PhD, your work may seem like the most important thing in the world. Tomorrow when you are faced with the realities of earning money in the jobs market, your wonderful service may evolve into a millstone.
I write from bitter experience. OCL and QVT could be wonderful if they worked well, but with tiny support teams and almost zero funding, tool quality is very disappointing and really struggling to chase the mainstream.. The reality is that large parts of industry are seriously uninterested, and increasingly uninterested, in modeling. As for UML, for many it is just a joke.
Regards
Ed Willink
|
|
|
Re: get the instance of the Main AcceleoGenerator class from query invoke [message #1842031 is a reply to message #1842021] |
Mon, 07 June 2021 16:36   |
Eclipse User |
|
|
|
Hi Ed,
Thank you a lot for sharing your experience. I can imagine that it was/is bitter to see a brilliant idea not reaching its full potential.
I personally want to thank you for the effort you put into Eclipse, OCL etc. as it helped me to implement the concept of my thesis with reasonable effort while learning a lot about bigger scale open source software projects and Java.
I released some open source software projects and know how demanding and ungrateful that can be, so also thank you for your support in this forum.
You are definitely right with your warning!
I mainly focus on automotive and machinery where model based software development is widespread (e.g. AUTOSAR, Simulink etc.) and even becoming more popular due to the increasing complexity of hardware and functionality but also due to the fact that safety software development needs to be documented for certification and M2T partially brings that automatically.
In the first years of the thesis I felt like you said, that this is the most important thing in the world but over the years I realized that though there is a demand for what I do, its hard to get into the market and to compete with existing solutions.
There are many things that need to be right for a project to succeed. A brilliant idea and implementation even with a demand on the market might be not enough and I am aware of that.
The idea to get startet (for now) would be not to sell the tool (which would require ex(t/p)ensive documentation, qualification, certification) but to use it as part of general consultancy in the area of embedded systems (for safety critical applications).
Maybe that doesn't work out but its worth a try because I have seen that it adds value for the customer in the projects it is used in.
The project a nutshell:
It allows you to model dataflows and software behavior (with an own graphical notation based on UML and SySML) as well as underlying hardware, logical functionality and (safety)requirements.
Which piece of software is executed when and on which piece of hardware and which data is exchanged between all the pieces of software in your system.
The textual output is C or C++ code implementing an runtime environment (in accordance with safety standards and with tractability to all related elements in the model) where all the user has to do is to add logic within the blocks he defined in the model without the need to fiddle with the complexity of a state of the art (muliticore)microcontroller with RTOS or certain safety requirements stated by the standards, which can be pretty challenging if implemented by hand.
Moreover a a safety report shall be generated, on which Im currently working and which is the last practical part of the project which started around 5 years ago.
[Updated on: Mon, 07 June 2021 18:04] by Moderator
|
|
|
|
|
Re: get the instance of the Main AcceleoGenerator class from query invoke [message #1842069 is a reply to message #1842055] |
Tue, 08 June 2021 08:50  |
Eclipse User |
|
|
|
Hi
It seems like your 'transformation' is clever, so I cannot recommend too strongly, do not use an M2T. M2T is great for simple text serialization but gets really klunky when you need strategic planning. For strategic planning you need at least one an intermediate model and an M2M to generate it. If you try to make an M2T do the job for you you will find it gets more and more cumbersome as you try to shoehorn the strategic planning into helpers. An early implementation of the OCL2Java code generator started as an Acceleo M2T and the strategic planning to weave invalid etc forced me to move on.
Regards
Ed Willink
|
|
|
Powered by
FUDForum. Page generated in 0.05206 seconds