Rbtree #6

Closed
wants to merge 19 commits into
from

Projects

None yet

2 participants

@kouno
Contributor
kouno commented Aug 19, 2012

Alright, so this one contains a few updates not only on InstanceIndex but also on Rake.

Some refactoring in Rakefile could be done, but I think it's good to have a review done first.

kouno added some commits Aug 3, 2012
@kouno kouno Fix pending spec (clone across constellation). 26aca98
@kouno kouno Remove pending spec, and fix simplecov coverage. 8f6f8f5
@kouno kouno Use RBTree instead of Hash. fc5dcec
@kouno kouno Add class to compare instance index key.
Instance index key can be an array of value which could contain nil values. To compare two
hash containing nil values (using <=>), it was necessary to dropback to a comparison of strings.

Example: ['a'] <=> [nil] would be converted to a comparison with "['a']" <=> "[nil]"
0baf69c
@kouno kouno Fix hash eql?, ==, hash(). 4039081
@kouno kouno Fix issue with 1.8.
Method :<=> does not exist on nil values, and using :<=> on arrays will
call :<=> recursively on its children.
43ace9a
@kouno kouno Add Rake task to test against all rubies. 63f4e43
@kouno kouno Add tests for coverage. 7150045
@kouno kouno Remove unused code.
Entities stored in @created_instances have all been through assertion. There
is no need to check if they implement retract.
66f4a50
@kouno kouno Remove Travis CI for Rubinius. 3cd2dee
@kouno kouno Add comments and fix namespace.
InstanceIndexKey was in global scope.
8ab0484
@cjheath
Owner
cjheath commented Aug 20, 2012

The RoleValues needs to use RBTree - if anything this is more important than InstanceIndex.

It's also complicated for multi-part identifiers too. For example if I have class Person identified_by :family_name, given_name, then the Name.all_person_as_given_name should be ordered by family_name only, and the Name.all_person_by_family_name should be ordered by given_name only. That is, an identifying role should be omitted from the identifying_role_values in its RoleValues for that relationship.

kouno added some commits Aug 24, 2012
@kouno kouno Modify RoleValues to have the same mechanism as Instance Index.
RoleValues was basically a wrapper for an array, and is now similar to an ordered
hash. The basic functionnality of RoleValues have not been modified, and it should still
be considered as an array on multiple points, but this array will be ordered by its values
automatically.

Refactoring to InstanceIndexKey has been done also to be used by RoleValues. Therefore, its
name has been modified to be ComparableHashKey instead.
e530e87
@kouno kouno Change file names a53891e
@kouno
Contributor
kouno commented Aug 24, 2012

Alright, as you stated in another conversation, it should be good to have the default order in RoleValues. So here you go.

@cjheath
Owner
cjheath commented Aug 27, 2012

On 24/08/2012, at 12:22 PM, Vincent Bonmalais wrote:

Alright, as you stated in another conversation, it should be good to have the default order in RoleValues. So here you go.

Problems remain in switching from an Array-like RoleValues to Hash-like,
because key AND value gets passed to map, detect, etc. Activefacts-api has
no tests for the arity of the blocks passed to iterators, nor for the number of
parameters yielded. Perhaps I can discover these by monkey-patching yield
to raise if more than one parameter is passed... Hmmm.

kouno added some commits Sep 5, 2012
@kouno kouno Implements flat hash class.
Makes hash traversing function such as #each work with a single argument
instead of 2.
ab679d4
@kouno kouno Merge branch 'master' into rbtree cb4bf3a
@kouno kouno Merge branch 'master' into rbtree d751d26
@kouno kouno Fix tests for multipart_identification_spec.
Adds information into related_entities. It should contain a RoleValue
object when the role is pointing to many entities (see unique attribute
for roles).

It also adds a way to query entities in a two-way fashion. Which means
you can now search for entities which references the current one, but
also entities which are referenced by the current one.
d5c29e2
@kouno kouno Refactor assignment process. 8056c45
@kouno kouno Add residual key support. d734f22
@cjheath cjheath closed this Dec 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment