S
Sebastian Galkin
I wonder if the community has any interest in a library a la
boost::multi_index for Ruby.
For those who don't know the library, it implements containers indexed
by several fields. For instance you can have a container of Person
objects indexed uniquely by SSN and non uniquely by birth date. You can
also specify if the indexes are ordered or unordered. The mechanism
used to extract the key from the object, is configurable.
"The Boost Multi-index Containers Library provides a class template
named multi_index_container which enables the construction of
containers maintaining one or more indices with different sorting and
access semantics."
"The concept of multi-indexing over the same collection of elements
is borrowed from relational database terminology and allows for the
specification of complex data structures in the spirit of multiply
indexed relational tables where simple sets and maps are not enough."
This kind of container is helpfull and I'm sure some of you have
implemented something similar at some point. It allows you to have the
data consistent and centralized while giving several views (the
indices) according to different criteria. Of course these views are
editable, and thats where much of their power comes from.
Maybe there is already an implementation of this available in ruby,
but I couldn't find any.
boost::multi_index for Ruby.
For those who don't know the library, it implements containers indexed
by several fields. For instance you can have a container of Person
objects indexed uniquely by SSN and non uniquely by birth date. You can
also specify if the indexes are ordered or unordered. The mechanism
used to extract the key from the object, is configurable.
From boost web page:
"The Boost Multi-index Containers Library provides a class template
named multi_index_container which enables the construction of
containers maintaining one or more indices with different sorting and
access semantics."
"The concept of multi-indexing over the same collection of elements
is borrowed from relational database terminology and allows for the
specification of complex data structures in the spirit of multiply
indexed relational tables where simple sets and maps are not enough."
This kind of container is helpfull and I'm sure some of you have
implemented something similar at some point. It allows you to have the
data consistent and centralized while giving several views (the
indices) according to different criteria. Of course these views are
editable, and thats where much of their power comes from.
Maybe there is already an implementation of this available in ruby,
but I couldn't find any.