Hi Stef

2016-10-19 17:29 GMT-03:00 stepharo <stepharo@free.fr>:

Hernan

What is the input you take to generate magritte?

Something like this:

������ CGStMagritte uniqueInstance
������ ������ inputClass: ModelClass1;
������ ������ targetClass: ModelClass1;
������ ������ setBooleanAttributes: 'instVar1' ������ ������ label: 'label iVar1' priority: 10;
������ ������ setDateAndTimeAttributes: 'instVar2' label: 'label Date and Time' priority: 20;
������ ������ setDateAttributes: 'instVar3' ������ ������ ������ label: 'label Date' priority: 30;
������ ������ setFileAttributes: 'iVarFile' ������ ������ ������ label: 'label File' priority: 40;
������ ������ setMemoAttributes: 'iVarMemo' ������ ������ ������ label: 'label Memo' priority: 50;
������ ������ setMultiOptionAttributes: 'iVarMultiOption' label: 'label Multi Option' priority: 60;
������ ������ setNumberAttributes: 'iVarInteger' ������ label: 'label Integer' priority: 70;
������ ������ generateMethods.
������ Smalltalk tools browser openOnClass: ModelClass1.������ ������
������ self inform: 'Done'.

��which generates

ModelClass1>>descriptionInstVar1
������ <magitteDescription>
������ | tmp2 |
������ tmp2 := MABooleanDescription new.
������ tmp2
������ ������ accessor: #instVar1;
������ ������ label: 'label iVar1';
������ ������ priority: 10.
������ ^ tmp2 yourself

ModelClass1>>descriptionInstVar2
������ <magitteDescription>
������ | tmp2 |
������ tmp2 := MADateAndTimeDescription new.
������ tmp2
������ ������ accessor: #instVar2;
������ ������ label: 'label Date and Time';
������ ������ priority: 20.
������ ^ tmp2 yourself

and so on.

Lionel would like to have a kind of Crud on top of Pharo and it would be good for business.


Cool, hope he finds useful the code generator

��

Stef


Le 18/10/16 �� 18:07, Hern��n Morales Durand a ��crit��:

2016-10-18 9:35 GMT-03:00 Lionel Akue <lionelakue@gmail.com>:
Great!

We had the same idea :)


Let me know if we can join forces to speed uo things.
��
The first requirements I wrote was ��to generate Spec UI directly. But I rather chose to make Magritte compatible with Spec.

So from the Magritte description, we could generate Spec, Seaside ...


The CodeGenerator I wrote already generates Magritte code. If you load it in Pharo 5

Gofer it
������ smalltalkhubUser: 'hernan' project: 'CodeGenerator';
������ configuration;
������ loadDevelopment.

Have a look at the usage examples:

#exampleMagritteDescriptionCreation1
#exampleMagritteDescriptionCreation2
#exampleMagritteDescriptionCreation3

If you have suggestions I would like to read.

Hern��n
��
Lionel

2016-10-18 14:20 GMT+02:00 Peter Uhnak <i.uhnak@gmail.com>:
Hi Hernan,

I wrote some time ago two basic code generators (both in Pharo) from UML-ified FAMIX for a particular user (so there are some domain-specific patterns),
one for Pharo syntax ( https://github.com/OpenPonk/class-editor/blob/master/docs/code-generation/uml-to-code.md )
and one for VW syntax ( https://github.com/OpenPonk/class-editor/blob/master/docs/vw-code-generation/pim-psm.md )

(the code is here https://github.com/OpenPonk/class-editor/tree/master/repository/DynaCASE-Generator.package and here�� https://github.com/OpenPonk/class-editor/tree/master/repository/UML-CodeGenerator.package )

The most pain I had was with expressing templateable code to which I could just plug specific data, I wanted to look at QVT but didn't have the time yet.
But it would be interesting to see if your generator could address such issues; plus soon I want to iterate on my generators to have more live interaction (so the code is generated on the fly as the model is created, although I am using Pharo Refactoring engine for now, which is also quite powerful.)

Addionally, Lionel (in cc) is working on some meta system generating classes with magritte descriptions.

So it would be cool if we could have some really cool generator that could do many cool things. :)

Peter

On Tue, Oct 18, 2016 at 02:24:28AM -0300, Hern��n Morales Durand wrote:
> Hi guys,
>
> I am writing a code generator, doing a few iterations right now.
> I want your opinion, which most useful thing would you like to be generated
> automatically? It could be a pattern, an idiom, another language...
>
> For example my own wish (roadmap) list:
>
> - A "settings framework" settings class generator.
> - A state machine generator (based in the excellent paper of Trevor P.
> Hopkins)
> - A Spec UI generator.
>
> Let me know your thoughts.
>
> Cheers,
>
> Hern��n