Flatten dictionary description

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

Flatten dictionary description

Esteban A. Maringolo
Hi,

I'm trying to flatten an accessor, but I can't find how.

What I have is ClassA which has a dictionary with ClassB  as its
association values, and each ClassB has a value too.

What I want to accomplish, is to flatten all this structure, so
everytime I want to edit an instance of ClassA, I have direct access
to ClassB's value.

ClassA has a dictionary, but its access is encapsulated trough
ClassA>>atXXX: and ClassA>>atXXX:put:, I could change it to standard
#at:put: pair, in order to user MADictionaryAccesor or use a
MAPlugabbleAccessor, but I'm doing something wrong, because I don't
know how to flatten ClassA descriptions.

Any pointer or example to look at?

Thanks in advance,

--
Esteban A. Maringolo
_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Flatten dictionary description

John McKeon
Hello Esteban,

On Sun, Jul 19, 2009 at 8:24 PM, Esteban A. Maringolo <[hidden email]> wrote:
Hi,

I'm trying to flatten an accessor, but I can't find how.

What I have is ClassA which has a dictionary with ClassB  as its
association values, and each ClassB has a value too.

What I want to accomplish, is to flatten all this structure, so
everytime I want to edit an instance of ClassA, I have direct access
to ClassB's value.

ClassA has a dictionary, but its access is encapsulated trough
ClassA>>atXXX: and ClassA>>atXXX:put:, I could change it to standard
#at:put: pair, in order to user MADictionaryAccesor or use a
MAPlugabbleAccessor, but I'm doing something wrong, because I don't
know how to flatten ClassA descriptions.

Any pointer or example to look at?

MADescription>>propertyAccessor:  is a good example of chaining accessors.  It sounds like that is what you need to do.


Thanks in advance,
 
If it helps then you are welcome in advance ;)
John

--
Esteban A. Maringolo
_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki



--
http://jmck.seasidehosting.st

_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Flatten dictionary description

keith1y
In Magritte-RDB there is an MAFlatteningVisitor which traverses a nested
structure and returns a flatted version using chained accessors.

This in turn is used for mapping a single flat table returned from a
database into a real object structure.

Keith
_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki