dhii/data-object-abstract

Abstract common functionality for data objects

v0.1-alpha1 2018-03-15 12:29 UTC

This package is auto-updated.

Last update: 2024-12-07 03:46:27 UTC


README

Build Status Code Climate Test Coverage Latest Stable Version This package complies with Dhii standards

Details

This package contains abstract functionality for data objects. Data objects are objects that can contain, and optionally manipulate, some internal data. The implementations in this package are based on containers, which means that anything returned by _normalizeContainer can have a data object based on it. Another advantage of this implementation is that a data key can be anything that passes normalization by normalizeString(). All this makes this package an excellent base for flexible, extensible data objects.

Important Notice: While the traits that access the internal store can work with any container, the _getDataStore() method used by them MUST return an object for the methods that write to the store to have an effect. This is to avoid having to use references, which would complicate the code and make it more error-prone, and less optimized.

Traits