[ROOT] / doc / toc / ARCCore / Enum / ARConcepts / Indexing

In-memory indexing of data is done 'behind-the-scenes' by some classes implementing IP.

One such class included in ARCCore is PCollection
which uses Indexing for all keys ending with 'Id' (keys assumed to be foreign keys).

This class is useful as container for a collection of entities (a table in RBDMS-terms).

Methods in IP which should be used if indexing is assumed to be necessary, is:
TrySetPP: SetPP = set property of property. Sets property of entity contained within this class
GetKeysEqualToValue: Returns properties which themselves again have key and value equal to the given key and value.
Note that these are default interface methods, that is, the default implementation does not support indexing.

TryStore will look for classes called '{EntityType}Collection' to instantiate as containers for collections of entities (classes with such names are assumed to be suitable for that purpose).
Example: If the application has a type 'Order', then a class called 'OrderCollection' (if found) will be used as storage container for the collection of 'Order' objects (if not the 'ordinary' PRich will be used).

Such a class can be created just by the following code:
public class OrderCollection : PCollection {

In this manner, indexing will be ensured for foreign keys like CustomerId, EmployeeId, ShipperId and so on.

Note that other ApplicationSpecificCode implementations does not necessarily have to inherit PCollection but they should implemented interfaces like IGetKeysEqualToValue in order to clearly state that they support indexing.

Indexing will use more memory but is often necessary for big collections when querying across collections of entities (querying across tables).

See also MemoryConsumption.


Generated 2024-05-20 19:38:49.463 UTC