I create a new property in a MooseEntity.
isFlag <MSEProperty: #isFlag type: #Boolean> <MSEComment: 'An exemplary flag'>
^ isFlag I do MooseModel resetMeta. I export the model with the entity containing the flag to an MSE.
isFlag property is absent in the mse file. Is this a known bug/feature or do I need to update something? Usman _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
It worked for me Usman, no problem. As a test do: isFlag <MSEProperty: #isFlag type: #Boolean> <MSEComment: 'my flag'>
^ true Then, MooseModel resetMeta. It will export ok:
======= (FAMIX.Method (id: 147) (name 'clearReplacements')
(cyclomaticComplexity 1) (isFlag true) (modifiers 'public')
(numberOfComments true) (numberOfConditionals 0) ======= Most probably your #isFlag property is nil, then it is not exported in the MSE file
On Thu, Nov 21, 2013 at 7:01 PM, Usman Bhatti <[hidden email]> wrote:
Andre Hora _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
I believe there is some sort of cache that is maintained somewhere because it works for me in the new image but if a property is added after exporting a model to a MSE file, it doesn't work.
Tx André for looking into it. Usman On Thu, Nov 21, 2013 at 8:58 PM, Andre Hora <[hidden email]> wrote:
_______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
In reply to this post by Andre Hora
If you want to see the state of the meta-descriptions, look in the Meta Browser. That will tell you whether the property is defined or not. Cheers, Doru On Thu, Nov 21, 2013 at 8:58 PM, Andre Hora <[hidden email]> wrote:
"Every thing has its own flow"
_______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
In reply to this post by Usman Bhatti
I tried to reproduce it through various ways but couldn't, may be it was my image. I'll try to be more vigilant next time. In the meantime, I tried to reproduce the anomaly with this script, may be we can create a test (with a dummy class?)?
|model propertyName| propertyName := 'isFlag'. FAMIXMethod addInstVarNamed: propertyName. FAMIXMethod compile: propertyName, '<MSEProperty: #', propertyName,' type: #Boolean>
<MSEComment: ''A test flag''> ^', propertyName.
MooseModel resetMeta. model := MooseModel new. MoosePharoImporterTask new
importerClass: SmalltalkImporter; doNotRunCandidateOperator; importingContext: (MooseImportingContext new importClass; importMethod; importPackage; yourself);
model: model; addFromPackageNamed: #'Moose-TestResources-LAN'; run;
yourself. model allMethods do: [ :each | each instVarNamed: propertyName put: true ]. model exportToMSEStream:(StandardFileStream forceNewFileNamed: 'aTestFile.mse').
MooseModel new importFromMSEStream:(StandardFileStream readOnlyFileNamed: 'aTestFile.mse') "should give an error because the propertyName: selector is absent"
On Thu, Nov 21, 2013 at 9:31 PM, Usman Bhatti <[hidden email]> wrote:
_______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Hi, You get the error because you do not have a setter to set the value of the isFlag property when importing the model. How is this an indication of a problem?
Doru On Thu, Nov 21, 2013 at 10:48 PM, Usman Bhatti <[hidden email]> wrote:
"Every thing has its own flow"
_______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
On 22 Nov 2013, at 08:24, Tudor Girba <[hidden email]> wrote:
Why do you need a setter? We can you reflection. Uko
_______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
The setter is the default behavior. It can be possible to use reflection, but you do not always have an instance variable for a property. Every MooseEntity has an EntityState that offers a dictionary. This dictionary can be extended by meta-model extensions, and you can end up with properties that are actually stored in this dictionary. For the future we should rework this part and use the slots available in Pharo 3 instead of the dictionary. For that we need to have the slots be extensible by external packages, which is not yet happening. This will simplify the Moose code.
Cheers, Doru On Fri, Nov 22, 2013 at 9:10 AM, Yuriy Tymchuk <[hidden email]> wrote:
"Every thing has its own flow"
_______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
In reply to this post by Tudor Girba-2
On Fri, Nov 22, 2013 at 8:24 AM, Tudor Girba <[hidden email]> wrote:
I explicitly omitted the setter of the property so that the import of the property fails to show that the property is exported but cannot be imported. If the import doesn't fail then the property is not exported. I think this test can be handy in Moose.
_______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
In reply to this post by Tudor Girba-2
On 22 Nov 2013, at 09:59, Tudor Girba <[hidden email]> wrote:
Buy the way, do you think we can use Slots to replace MultivalueLinks?
_______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Definitely. Slots should eventually replace both EntityState from Moose and the ValueLinks from Fame. It would be great if someone could give this a try.
Cheers, Doru On Fri, Nov 22, 2013 at 10:12 AM, Yuriy Tymchuk <[hidden email]> wrote:
"Every thing has its own flow"
_______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Free forum by Nabble | Edit this page |