Drupal has some (entity) relationship issues
With entities Drupal took a huge step forward in providing conceptual clarity in how it deals with things like users, comments, taxonomy terms and nodes.
I believe there is one more step to take to bring even more clarity that will hopefully be possible in Drupal 8 (or 9!). This is the content of my Core Developer Summit lightning talk- hopefully it is not completely off the mark.
It goes something like this:
Entities have abstracted (at least conceptually if not completely at the code level) the task of dealing (loading, reading, querying) with things that you can attach fields to. Drupal is now a composition of these Entities into an architecture that creates a content management system with users, nodes for content, comment, tags, etc. This architecture describes the relationships between entities and their implications.
However this architecture is not transparent. It is spread all over the code. It is Drupal. You cannot change it in an architecturally clean way.
I think we are a step away of being able to not just have one Drupal but many Drupals. What is takes is to make explicit the relationships between entities.
What are relationships?
Entity A is a comment to Entity B
A comment relationship is when a Main Entity is discussed by a Secondary Entity and it is displayed either below or in an associated page to the Main Entity
Entity A is a taxonomy term to Entity B
A taxonomy term relationship is when a Main entity is annotated by a Secondary entity and is (typically) displayed below the Main entity
Entity A is following Entity B
following is when one Entity is notified of activities performed by/to another Entity
Entity A is a friend with Entity B
Friend relationships are when both Entities are notified of activities performed by each one
So relationships are just what meaning we decide to give a certain word like comment, taxonomy term, follows, friends together with some logic about what to do when the relationship exists and how to represent it.
If we actually represent this in code by having an explicit Relationship concept with it's associate type and logic building Drupal website then becomes:
1. Define entities
2. Define relationships between entities
3. Build views
This is much better than the situation today where we have content types with some fixed relationships to things like comments and terms but then we also have nodereference and userreference in order to build out other relationships to users and / or other nodes.
It all comes under one conceptual roof and changes the nature of what Drupal is. Drupal is the system that manages all of this and can re-create Drupal as we know it today with nodes, terms, etc but it can also do other Drupals. It makes the architecture of the CMS clear and separate from the other stuff and this means that we can then manipulate it.
A note: this is not about what the end user sees. They don't need to know anything about this. This may not even be about what your everyday developer / site builder sees either as they may well only ever be at the level of a specific entity + relationships architecture.
This is for the people that really get into the bowels of what makes Drupal Drupal and should give them a change to change that.
Another note: This is here so that it is discussed - it is not fully thought out yet. The main point is - should we make the relationships between entities explicit? And if we do that would that provide us with significant expressive power to do more?