
- Forum
- Testing
- Software Patterns
- Implementation of association class?
Implementation of association class?
This is a discussion on Implementation of association class? within the Software Patterns forums, part of the Testing category; Implementation of association class? I'd like some views on best practises for implementing association classes in OOPL code. Regards, // ...
-
11-25-2003, 06:23 AM #1Martin R-L Guest
Implementation of association class?
Implementation of association class?
I'd like some views on best practises for implementing association classes
in OOPL code.
Regards,
// Martin R-L
-
12-07-2003, 08:23 PM #2panu Guest
Re: Implementation of association class?
Martin R-L wrote:
>I'd like some views on best practises for implementing association classes
> in OOPL code.
Interestingly Smalltalk already has a class called Association.
This has two fields 'key' and 'value'. Associations can be
combined to form a Dictionary (a hash-table) which allows
you to access the values by the key.
If you want bi-directional associations, I would simply
add methods for creating and returning the reverse
dictionary, possibly with caching if the dictionaries
are big.
-Panu Viljamaa

Reply With Quote





