Hi
I wanted to import a model from a stream
I did the following:
m := SCG.Moose.MooseModel new. loader SCG.Moose.MooseImporter withActiveMetamodel. loader importSTream: NameMatchingTest lanModel readStream.
Now I do not know how I can specify in which model the resulting entities should be added.
When I use an SmalltalkImporter I usually do it that way:
m := SCG.Moose.MooseModel new. PundleImporter new model: m ; addPundleNamed: 'xxx' ; run and m is populated.
So Importer is not following the same pattern or I'm stupid and in both cases this is annoying.
stef
Hi Stef,
In its current form, the MooseImporter just returns the top level entity from MSE, and the convention is that an MSE file is enclosed with (Moose.Model (entity ...) ). This means that the top level entity is Moose.Model and everything inside is put in the entities.
To add this model to the root model you should do: loader := SCG.Moose.MooseImporter withActiveMetamodel. m := loader importSTream: NameMatchingTest lanModel readStream. MooseModel root add: m.
This will probably change slightly in FAMIX 3.0 and in the Fame based descriptions and format.
Doru
On Apr 22, 2008, at 11:46 AM, stéphane ducasse wrote:
Hi
I wanted to import a model from a stream
I did the following:
m := SCG.Moose.MooseModel new. loader SCG.Moose.MooseImporter withActiveMetamodel. loader importSTream: NameMatchingTest lanModel readStream.
Now I do not know how I can specify in which model the resulting entities should be added.
When I use an SmalltalkImporter I usually do it that way:
m := SCG.Moose.MooseModel new. PundleImporter new model: m ; addPundleNamed: 'xxx' ; run and m is populated.
So Importer is not following the same pattern or I'm stupid and in both cases this is annoying.
stef _______________________________________________ Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- www.tudorgirba.com www.tudorgirba.com/blog
"Not knowing how to do something is not an argument for how it cannot be done."
My main concern is that we have two design for importing things in moose. One is functional and you have to know that you get a model back and the other is by side effect. Too bad that we are not consistent.
Stef
On Apr 22, 2008, at 3:23 PM, Tudor Girba wrote:
Hi Stef,
In its current form, the MooseImporter just returns the top level entity from MSE, and the convention is that an MSE file is enclosed with (Moose.Model (entity ...) ). This means that the top level entity is Moose.Model and everything inside is put in the entities.
To add this model to the root model you should do: loader := SCG.Moose.MooseImporter withActiveMetamodel. m := loader importSTream: NameMatchingTest lanModel readStream. MooseModel root add: m.
This will probably change slightly in FAMIX 3.0 and in the Fame based descriptions and format.
Doru
On Apr 22, 2008, at 11:46 AM, stéphane ducasse wrote:
Hi
I wanted to import a model from a stream
I did the following:
m := SCG.Moose.MooseModel new. loader SCG.Moose.MooseImporter withActiveMetamodel. loader importSTream: NameMatchingTest lanModel readStream.
Now I do not know how I can specify in which model the resulting entities should be added.
When I use an SmalltalkImporter I usually do it that way:
m := SCG.Moose.MooseModel new. PundleImporter new model: m ; addPundleNamed: 'xxx' ; run and m is populated.
So Importer is not following the same pattern or I'm stupid and in both cases this is annoying.
stef _______________________________________________ Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- www.tudorgirba.com www.tudorgirba.com/blog
"Not knowing how to do something is not an argument for how it cannot be done."
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
You are right, and that should change once we move to the new infrastructure.
Cheers, Doru
On Apr 22, 2008, at 4:13 PM, Stéphane Ducasse wrote:
My main concern is that we have two design for importing things in moose. One is functional and you have to know that you get a model back and the other is by side effect. Too bad that we are not consistent.
Stef
On Apr 22, 2008, at 3:23 PM, Tudor Girba wrote:
Hi Stef,
In its current form, the MooseImporter just returns the top level entity from MSE, and the convention is that an MSE file is enclosed with (Moose.Model (entity ...) ). This means that the top level entity is Moose.Model and everything inside is put in the entities.
To add this model to the root model you should do: loader := SCG.Moose.MooseImporter withActiveMetamodel. m := loader importSTream: NameMatchingTest lanModel readStream. MooseModel root add: m.
This will probably change slightly in FAMIX 3.0 and in the Fame based descriptions and format.
Doru
On Apr 22, 2008, at 11:46 AM, stéphane ducasse wrote:
Hi
I wanted to import a model from a stream
I did the following:
m := SCG.Moose.MooseModel new. loader SCG.Moose.MooseImporter withActiveMetamodel. loader importSTream: NameMatchingTest lanModel readStream.
Now I do not know how I can specify in which model the resulting entities should be added.
When I use an SmalltalkImporter I usually do it that way:
m := SCG.Moose.MooseModel new. PundleImporter new model: m ; addPundleNamed: 'xxx' ; run and m is populated.
So Importer is not following the same pattern or I'm stupid and in both cases this is annoying.
stef _______________________________________________ Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- www.tudorgirba.com www.tudorgirba.com/blog
"Not knowing how to do something is not an argument for how it cannot be done."
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- www.tudorgirba.com www.tudorgirba.com/blog
"Problem solving should be concentrated on describing the problem in a way that is relevant for the solution."
Hi Doru,
You are right, and that should change once we move to the new infrastructure.
What is the new infrastructure? Are you thinking in changing some core classes in FAMIX? We should know in advance, because I am programming with the actual FAMIX and I would like to minimize the impact of changes in my application.
Cheers,
Gabi
The new infrastructure refers to: - Fame is a simpler engine to replace Meta. This should have almost no impact on a client code. - FAMIX 3.0 is an improvement over the current FAMIX (a bit cleaner names and some refactoring of the class hierarchy). The changes are not that large and if you do not depend on some implementation issues, the impact should again be small. However, the new FAMIX resides in a namespace of its own, which means that the old FAMIX will be able to coexist with the new FAMIX and the transition can be made smooth.
Cheers, Doru
On Apr 23, 2008, at 4:18 PM, Gabriela Arevalo wrote:
Hi Doru,
You are right, and that should change once we move to the new infrastructure.
What is the new infrastructure? Are you thinking in changing some core classes in FAMIX? We should know in advance, because I am programming with the actual FAMIX and I would like to minimize the impact of changes in my application.
Cheers,
Gabi _______________________________________________ Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- www.tudorgirba.com www.tudorgirba.com/blog
"The coherence of a trip is given by the clearness of the goal."