Exforsys
+ Reply to Thread
Results 1 to 2 of 2

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, // ...

  1. #1
    Martin 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



  2. #2
    panu 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





Latest Article

Network Security Risk Assessment and Measurement

Read More...