evomimic / map-holons

3 stars 1 forks source link

Revise and rename and re-implement the HolonFieldGettable Trait #106

Closed evomimic closed 3 months ago

evomimic commented 3 months ago

This enhancement renames the HolonFieldGettable Trait to HolonGettable and changes both the signature and implementation of this trait to push the need for mutable references deeper by leveraging interior mutability. Specifically, this enhancement:

Dependencies

Current State

Currently, the methods in HolonFieldGettable support a couple of "read" operations on Holons and the objects that reference them. But despite being "read-only" operations, they take a &mut self parameter because some Memory Layer changes take place as a result of invoking these methods.

Proposal

Enhance the CacheManager to support interior mutability, then change the HolonFieldGettable trait and implementation to take advantage of this change.

Enhance CacheManager to support interior mutability

In the cache_manager.rs file

Change name, definition and implementation of HolonFieldGettable Trait

In the holon.rs file

_In the holonreference.rs file

_In the stagedreference.rs file

In the holon.rs file

Testing

Since this is just a re-factoring of existing functionality, no new tests are required.

Definition of Done