[Haskell-cafe] Re: I just don't get it (data structures and OO)

Phlex Phlex at telenet.be
Tue Jun 5 05:33:04 EDT 2007



Christopher Lane Hinson wrote:
>
> Where "InsidenessMap a b c" represents a relationship where b's are 
> inside a's, and b's have a state of c.  Then, you need to declare a 
> separate InsidenessMap for each possible relationship, but this 
> ensures that you'll never put a galaxy inside a solar system.  Or you 
> can make 'a' be a reference to any type of object; there are options.
>
>
Ketil Malde wrote:
> Identity can be emulated by relatively straightforward means: store all
> planets in a Map indexed by something that is useful as an identifier
> (i.e. stays constant and is unique), and have a Galaxy keep a list of
> identifiers.
>   

So basically you guys are saying I should rethink the data structure 
into a relational model instead of sticking to the OO model... I think i 
could do this pretty easily. a table would be a map of id to instance 
...then another map for foreign keys, or maybe just as a member of each data

Is the relational model a better fit than the object model for 
functional programming ?

Sacha


More information about the Haskell-Cafe mailing list