You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have one main/meaningful entity provided by bootsrapi - USER. All the rest entities are either auxiliary for user operations (e.g. *_tokens, roles, rights, roles_to_rights) or system maintenance (e.g. migrations, seeds, ,logs). This is nice as a starting point at the very beginning. However, this is not enough even for a decent scaffolding.
PROPOSITION
Let's introduce additional general-purpose entity, reasonably called ENTITY :) and some auxiliary/boilerplate entities in order to provide complex relations between entities and users. Proposed entities are:
ENITITY
--------
id BIGINT
type INT
status INT
owner_id BIGINT foreign key -> users.id
connector_id BIGINT foreign key -> connectors.id
attributes JSON
Entity represents arbitrary entity, owned by a USER (via owner_id) and having arbitrary set of attributes.
CONNECTOR
--------------
id BIGINT
type INT
owner_type INT
Connector represents 'connection point' designed to provide relations between custom entities in the system (like entity <-> entity or user <-> entity, etc). Each entity in the system who intends to establish relations provides its 'connection point' - connector in order to receive or to establish relations.
RELATION or may be called CONNECTION - named relatively to CONNECTOR above
-----------
id BIGINT
connector_id_a BIGINT foreign key -> connectors.id
connector_id_b BIGINT foreign key -> connectors.id
type INT
status INT
attributes JSON
Intended to setup a relation between two entities via their CONNECTORs
Possible relation/connection types:
b is owned by a
b is member of a
b is assigned to a
b is child of a
... etc ...
Also new attribute in USER entity would be needed - connector
USER
====
... all known fields
connector_id BIGINT foreign key -> connectors.id
Proposed structure would allow to build custom relations between all entity types in the system, opening direct way to construction of entity hierarchies owned by users, attach entities to another entities or users, etc
Imagine the following structure:
entity of type 'event'
entity of type 'collection'
multiple entities of type 'note'
relation 'event'-'collection' of type 'owned'
relation 'note'-'collection' of type 'assigned to'
And as a result, we'll have 'event' with a 'collection' of 'notes' build on custom entity base.
PS. I can implement proposed update
The text was updated successfully, but these errors were encountered:
SUPPOSITION
We have one main/meaningful entity provided by bootsrapi - USER. All the rest entities are either auxiliary for user operations (e.g. *_tokens, roles, rights, roles_to_rights) or system maintenance (e.g. migrations, seeds, ,logs). This is nice as a starting point at the very beginning. However, this is not enough even for a decent scaffolding.
PROPOSITION
Let's introduce additional general-purpose entity, reasonably called
ENTITY
:) and some auxiliary/boilerplate entities in order to provide complex relations between entities and users. Proposed entities are:Entity represents arbitrary entity, owned by a USER (via
owner_id
) and having arbitrary set of attributes.Connector represents 'connection point' designed to provide relations between custom entities in the system (like
entity
<->entity
oruser
<->entity
, etc). Each entity in the system who intends to establish relations provides its 'connection point' -connector
in order to receive or to establish relations.Intended to setup a relation between two entities via their
CONNECTOR
sPossible relation/connection types:
b
is owned bya
b
is member ofa
b
is assigned toa
b
is child ofa
Also new attribute in USER entity would be needed - connector
Proposed structure would allow to build custom relations between all entity types in the system, opening direct way to construction of entity hierarchies owned by users, attach entities to another entities or users, etc
Imagine the following structure:
And as a result, we'll have 'event' with a 'collection' of 'notes' build on custom entity base.
PS. I can implement proposed update
The text was updated successfully, but these errors were encountered: