DST (as of VW
7.3.1) allows for modules to be declared as non-standard methods of
DSTRepository with syntax like:
module
MyDomainModule
{
// key / value pair used to simulate a hashtable or properties structure struct MyProperty { string key; string value; }; typedef sequence<MyProperty> MyPropertySeq;
// user preferences defined as properties
typedef MyPropertySeq MyUserPreferences; }; // end module Here is a
corresponding class:
Smalltalk
defineClass: #MyProperty
superclass: #{MyNamespace.MyObject} indexedType: #none private: false instanceVariableNames: 'key value ' classInstanceVariableNames: '' imports: '' category: 'MyClasses' I'd like to browse
references to the class MyProperty and find the corresponding module
definitions. The enhancement might be as simple as adding a method like
this:
DSTMetaContainer>>refersToLiteral:
anObject
symbols keysAndValuesDo: [:key :value | (key refersToLiteral: anObject) ifTrue: [^true]]. ^false The next step would
be to enable the finding of references starting from the module
declaration, but this alone is a good start.
Thanks,
|
This looks like a good idea, created AR#51277: "Finding references
withing DST modules". Thanks, Paul! Martin Paul Baumann wrote: > DST (as of VW 7.3.1) allows for modules to be declared as non-standard > methods of DSTRepository with syntax like: > > module MyDomainModule > { > // key / value pair used to simulate a hashtable or properties > structure > struct MyProperty { > string key; > string value; > }; > typedef sequence<MyProperty> MyPropertySeq; > > // user preferences defined as properties > typedef MyPropertySeq MyUserPreferences; > }; // end module > > Here is a corresponding class: > > Smalltalk defineClass: #MyProperty > superclass: #{MyNamespace.MyObject} > indexedType: #none > private: false > instanceVariableNames: 'key value ' > classInstanceVariableNames: '' > imports: '' > category: 'MyClasses' > > I'd like to browse references to the class MyProperty and find the > corresponding module definitions. The enhancement might be as simple as > adding a method like this: > > DSTMetaContainer>>refersToLiteral: anObject > symbols keysAndValuesDo: [:key :value | (key refersToLiteral: anObject) > ifTrue: [^true]]. > ^false > > The next step would be to enable the finding of references starting from > the module declaration, but this alone is a good start. > > Thanks, > > Paul Baumann > IntercontinentalExchange | ICE > [hidden email] <mailto:[hidden email]> > > > > -------------------------------------------------------- > This message may contain confidential information and is intended for specific recipients unless explicitly noted otherwise. If you have reason to believe you are not an intended recipient of this message, please delete it and notify the sender. This message may not represent the opinion of IntercontinentalExchange, Inc. (ICE), its subsidiaries or affiliates, and does not constitute a contract or guarantee. Unencrypted electronic mail is not secure and the recipient of this message is expected to provide safeguards from viruses and pursue alternate means of communication where privacy or a binding message is desired. > > |
Free forum by Nabble | Edit this page |