Thomas Izzo said:
What happens if the “data” does not belong to a single entity?
Again, depends. If the data is something referenced by the entity, then I don't see any reason to not put it into a component. This requires the data to be at least somehow non-unique, for example if youre in a tree like structure where nodes are entities pointing to other nodes, 1 > N relation.
If you have true unique static data, you might either want to have it in the classic way stored in a static variable somewhere in your code or use a static/singleton entity. The entity might be useful if you have static data which is composed on demand, for example a Player entity which has optional name, gender and a premium code property.
Like @valakor said, you can't use ECS for everything and don't get confused about data used by a system and data provided by an entity. A system may require static data like a reference to the underlaying renderer in order to function properly doesn't mean that an entity needs to provide that data if it isn't required for the entity to be properly used! Systems still require a cetrtain set of components and this is how it is determined if an entity can be processed by a certain system. For example if you have the mesh component and the UI component, this doesn't mean that they have to provide a static reference to the renderer used to put them on screen, it just means that there are 2 different systems which work on the mesh component, providing mesh rendering into the 3D world and UI component, providing 2D rendering on top of the render buffer.
You should think of entities as dynamic objects who's properties are defined at runtime and use compile time known behavior based on their properties.
An example: I wrote a data driven build tool for our Game Engine SDK project, which can be found on GitHub for reference. Since we removed the need to maintain a complicated project definition and configuration file in favor for a more flexible approach, our tool needs to now the sub projects aka build modules in order to for example compile the code properly or create IDE files to provide access to an editor. So what we have is somehow related to ECS; an actor pipeline. The main difference between that pipeline and an entity component system is the system part. Instead of working on a batch of componentns every frame, the pipeline works on single instances pushed to it. Except for that difference, we also have entities aka templates with components aka properties.
Our tool first takes a collection of paths entered via command line and creates an entity for each of those paths. Each entity gets a module component and is then pushed to the pipeline. Each module will be handled by an actor depending on the components attached to it. There is for example an actor to determine if a module has C# or C++ files included and creates the corresponding SharpProject or CppProject property. Those components are then also puhsed to the pipeline and handled from another actor which determines the relationship between those projects. Another actor then may call the compiler for all components in the right order or the IDE project generator is triggered.
We have static data too, for example the SDK root directory, an overall config (which defines important paths to the compiler among others) or cached .NET Framework Assemblies which have to be referenc resolved as well. This data is held at points in our code which are static too in order to enable actors to use that data. We also have non-unique data, the NPM package config which is unique per module for example