We've seen a lot of discussion around Static Entities lately, for example, this idea.
While Static Entities provide some value for enumeration use cases, they fall short in a lot of ways:
- They are stored in the database.
- They are expensive compute wise (more than they should be) to retrieve.
- They cost AOs.
- To use them on client side (other than the ID), they need to be manually synced.
- Developers need to understand the aforementioned details to use them correctly.
Traditional Enums in high code languages are much better. They are directly in the code, making them available at no cost to the caller.
Since OutSystems is a giant compiler, Enums should be a first-class construct that:
- Are compiled into constants rather than stored in the database.
- Are accessible both server-side and client-side without requiring manual synchronization.
- Do not consume AOs.
- Can be used in Service Studio like a variable.
- Maintain type safety like a Static Entity ID.
Static Entities are an old primitive of the platform. I don't believe changing them at this stage is a good move, so I propose creating a new primitive—Enums—that align with modern best practices while keeping the low-code philosophy.