BHoM / admin

Repository for raising central issues and questions; Regarding governance, process and multi-repo and framework compliance
GNU Lesser General Public License v3.0
0 stars 0 forks source link

Diffing_Engine: review the structure/organisation of the identifiers #8

Open alelom opened 4 years ago

alelom commented 4 years ago
Category
Persistent The id is a GUID generated upon object creation. If the object is modified, this id is transferred to the new instance of the object.
Instance if any property of the object changes, the id changes.
Name Type (Persistent or instance) Example Description
External Id (or "Adapter Id") (Depends on software) A number The id assigned to the object by the external software. This may or may not be unique per se (e.g. could be unique within a certain category, but not in absolute sense). Example: in robot, a bar is assigned a progressive number starting from 1; nodes too.
Instance External Id Instance a guid or hash An id assigned to the object by the external software that is unique for that object and its defining properties. The object, if modified, will get a different id of this type. Example: in Robot, this can be obtained by the combination of the object Type (e.g. Robot.Bar) with its External Id (e.g. `1).
Persistent External Id Persistent a guid An id assigned to the object by the external software that is unique for that object. Persistent = remains the same if the object is modified; it is generated only once upon object creation. Example: in Revit, the UniqueId.
BHoM Guid Persistent a guid The BHoM Guid is generated once upon object instantiation. If the object is modified, the Guid is transferred to the new object.
BHoM Hash Instance a hash An id that uniquely identifies an object with all its properties set to a certain value. If any property is modified, this id changes.
alelom commented 4 years ago

@al-fisher

al-fisher commented 4 years ago

Thanks @alelom - looks like a good summary - and consistent with current expected use of BHoM Guid and Hash.

From descriptions - new external IDs are clear except I think your example for Robot.Bar (where combining Type and Number is I believe a Persistent ID not an Instance ID i.e. if you change the cross-section is Robot - the example ID given above would not change (would need to be a hash encompassing Section itself)

Would also be good to include notes on implementation of each of the above. That is External IDs being Fragments I presume. BHoM Persistent Guid naturally being a Property on the parent defining object And BHoM Instance ID or Hash being a lazily computed Query Method.

alelom commented 4 years ago