what is the pattern to add a custom importer performing action after default import?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

what is the pattern to add a custom importer performing action after default import?

Stéphane Ducasse
Doru

long time ago :) there were importer post action plugin that we could register to Moose.
I reread my comment on Tasks and friends (I hate hate all the classes with not a single comment - so I will take some time
when I can to see what I can write but this is really terrible) - this were the comments I wrote when I wanted to build the new importer.
Now they do not describe the API and how to plug a new Task.

So how do we declare to an importer that a task should be run automatically after a model is created?
May be by creating a compositeTask but I want it to run after the main model is created.

Stef
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: what is the pattern to add a custom importer performing action after default import?

Tudor Girba-2
Hi,

This is not the cleanest part of Moose :).

If I understand correctly, you would like to specify a new Operator to be run at the end of the default ImportingTask. There is no mechanism for that, because we never had the use case.

The closest thing for is the way to run the CandidateOperator. Take a look at MooseCompositeImporterTask. At the end of basicRun, the candidateOperator is run if it is present.

It would probably be interesting to have some more extensibility here. But, what is your use case?

Cheers,
Doru


On 7 Nov 2011, at 23:35, Stéphane Ducasse wrote:

> Doru
>
> long time ago :) there were importer post action plugin that we could register to Moose.
> I reread my comment on Tasks and friends (I hate hate all the classes with not a single comment - so I will take some time
> when I can to see what I can write but this is really terrible) - this were the comments I wrote when I wanted to build the new importer.
> Now they do not describe the API and how to plug a new Task.
>
> So how do we declare to an importer that a task should be run automatically after a model is created?
> May be by creating a compositeTask but I want it to run after the main model is created.
>
> Stef
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
www.tudorgirba.com

"What is more important: To be happy, or to make happy?"


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: what is the pattern to add a custom importer performing action after default import?

Stéphane Ducasse

On Nov 7, 2011, at 11:46 PM, Tudor Girba wrote:

> Hi,
>
> This is not the cleanest part of Moose :).

the code quality is nice but the comment ratio is zero and this is the problem. As we learn and understand we will comment.

>
> If I understand correctly, you would like to specify a new Operator to be run at the end of the default ImportingTask. There is no mechanism for that, because we never had the use case.
>
> The closest thing for is the way to run the CandidateOperator. Take a look at MooseCompositeImporterTask. At the end of basicRun, the candidateOperator is run if it is present.

Yes I will do that and improve the comments.
And may be add a importer to be run after importing.

> It would probably be interesting to have some more extensibility here. But, what is your use case?


Two simple cases
        - I want to attach author information that I collect from Smalltalk but the sister importer will be that I get an author DB in Java and that I want to connect it to a model.
        The idea is to have a reusable class that I can plug or not in the importer phase.

        - I want to build a map showing the number of committed version in a pharo repository.
        Again I want to automatically run it when I want it.



_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev