Highlight composite identifier value for use in business logic?

Separating the logic of business logic and the logic of data access into two different assemblies, I want to divert the concept of identity so that business logic deals with one consecutive identification type without the need to understand its actual representation in the data source.

I call this a complex abstraction of identity for lack of a better term.

The data sources in this project can be interchangeable, different, and business logic does not have to care about which data source is currently used. Identification is the most difficult part, because its implementation can change the data source in the form of one kind, while other fields, such as name, address, etc., are sequentially scalar values.

What I'm looking for is a good way to distract the concept of identity, be it an existing library, a software pattern, or just a solid good idea, any provided in the answer.

The proposed value of the connection identifier should be comparable and suitable for use in business logic (for example, tied to a computation as a tracked value) and transferred back to the data source to indicate the records, entities and / or documents that influence, therefore, the data source should be able to analyze the details of their own composite identifiers.

Examples of data sources:

This serves to represent what I mean by different data sources having different implementations of identity.

  • A , . .

       content_id  language  Other Columns expressing details of content
                 1  en_us
                 1  fr_ca
    

    : 1 + en_us

  • NoSQL dataโ€‹โ€‹strong > - GUID 936DA01F-9ABD-4d9d-80C7-02AF85C822A8 ,

  • .

, .., .

+3
2

, โ€‹โ€‹ (, IEquatable<T>) - .

, , , : NoSQL , GUID, ..

+2

dynamic ?

, , /-. .

+1

All Articles