---
title: 🔤 Concepts
order: 0
outline: [2,2]

prev: using fennecs;
description: 'Overview of ECS concepts in fennecs: Entities, Components, Queries, and Streams, plus unique features like Relations, Object Links, and Aspects.'

head:
  - - meta
    - property: og:title
      content: Concepts of the fennecs Entity-Component System
    - property: og:description
      content: 'Overview of ECS concepts in fennecs: Entities, Components, Queries, and Streams, plus unique features like Relations, Object Links, and Aspects.'
---

#  :neofox_heart: ... the little ECS that loves you back!
The Entity-Component System (ECS) is an architectural pattern that champions composition over inheritance. **Entities** are small, unique identifiers, and **Components** are data attached to them. The term **Systems** often refers to the logic that operates on this data. 

## Typical ECS Concepts 

::: tip *(these are what makes many ECS architectures tick)*
### [Entities](/docs/Basic/Entities/) exist in a [World](/docs/Intermediate/Worlds/index.md). 
Entities can be spawned solo, or in bulk with pre-configured components.

### [Components](/docs/Basic/Components/) can be added to / removed from Entities.
Components can be backed by any type; Value or Reference, even empty `structs`.

### [Queries](/docs/Basic/Queries/) filter Entities using [Match Expressions](/docs/Basic/Queries/Matching.md).
This matching is done by Component types and targets (presence or absence).

### Code [Acts](/docs/Basic/Streams/Stream.For.md) on Component data in tight, optimized loops.
You provide logic in [Runner Delegates](/docs/Basic/Streams/Delegates.md) which are executed on a [single](/docs/Basic/Streams/Stream.For.md) or [multiple](/docs/Basic/Streams/Stream.Job.md) threads.

### Component data is always kept contiguous* in Memory.
Structurally similar Entities are packed into [Archetypes](/docs/Basic/Components/index.md#archetypes) for improved [cache locality](https://en.wikipedia.org/wiki/Locality_of_reference).

<sub>\* *per Archetype*</sub>

:::

## Unique fennecs Concepts 

::: warning *(~~weird~~ cool stuff that gets us all wide-eyed and bushy tailed)*
### [Streams](/docs/Basic/Streams/) expose *fast* Iteration and SIMD Operations 
Quickly & safely [iterate entities](/docs/Basic/Streams/Stream.For.md), or [modify](/docs/Advanced/SIMD/index.md#streamblitc) Components in bulk, or process entire [memory blocks](/docs/Basic/Streams/Stream.Raw.md).

### [Relations](/docs/Intermediate/Keys/Relation.md) are Components with an [Entity Target](/docs/Basic/Queries/Matching.md#match-targets).
These add expressive, powerful grouping semantics. Relations can be backed by any type.

### [Links](/docs/Intermediate/Keys/Link.md) are Components backed by an [Object Target](/docs/Basic/Queries/Matching.md#match-targets).
Group Entities logically and in memory by linking them to shared data, like a physics world.

### [Aspects](/docs/Advanced/Aspects/index.md) split a World into contiguous storage universes.
Group hot Components into their own memory neighborhood to fight fragmentation. *(new in 0.7.0)*

### Queries expose Structural Changes (just as Entities do)
Efficiently and safely [add](/docs/Basic/Queries/CRUD.md), [remove](/docs/Basic/Queries/CRUD.md) from individual Entities or entire matched Queries.

### Runners let you pass [uniform](/docs/Basic/Streams/Stream.For.md#uniforms-shmuniforms) data to your Workloads.
A tiny tidbit that streamlines the process of passing data into a job or run.

### Worlds, Queries, and Streams implement `IEnumerable<>`.
It's amazing to be able to every now and then just LINQ it up and <u>*be done*</u> somewhere.

### There are no formalized Systems.
You have a higher degree of freedom when and how to interact with Queries and Stream Views.

### There is no formalized Scheduler.
Parallel Jobs execute synchronously, as fast as possible. Runners are invokable anytime, anywhere.  

### Structural Changes may be submitted\* *at any time.*
Worlds process them at the end of a Query Runner's scope, otherwise immediately.  
<sub>\* *never type* [`EndInitializationEntityCommandBufferSystem`](https://docs.unity3d.com/Packages/com.unity.entities@1.0/api/Unity.Entities.EndInitializationEntityCommandBufferSystem.html) *nor* [`AddJobHandleForProducer(JobHandle)`](https://docs.unity.cn/Packages/com.unity.entities@1.0/api/Unity.Entities.EntityCommandBufferSystem.AddJobHandleForProducer.html) *again!* 🦊</sub>

:::

## :neofox_boop_happy: Boop the fox, and you're all done with the first page!
!["using fennecs;"](/img/fennecs-rule.png)
