WORM Modifier and Temporality #63103
-
Basic ConceptThe BackgroundDealing with temporality is increasingly becoming an issue in software. Complicating this a move towards "null-less programming". This C# scenario is a typical case that I imagine other .NET languages share. In C# there are several places where you encounter a "requires a parameterless constructor" error. At the same time, C# has "not-nullable" checking. The effect is that this is a "conditionally valid" class:
Field The thing is, The A conceptual implementation associates a state value with any variable that has the A WORM variable helps with, "This field is required when I use the class. I don't know it's value at construction, or the language requires a parameterless constructor, so I can't provide one. But the language requires that I define it here!". Operationally, At a deeper level, this capability can give object languages a capability they have never had - Associations. Or more specifically, This is one of the most basic constructs in OO modeling. It shows two classes with a bi-directional composition dependency -> A cannot exist without a B being provided at construction (composition), and B cannot exist without A being provided at construction. Circular. This very basic OO concept cannot be implemented in C#, or directly in the framework (AFAIK). Using Conceptual:
This leads to something like: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
First, this belongs to https://github.com/dotnet/csharplang/discussions
Have you checked role/extensions at dotnet/csharplang#5496 ? |
Beta Was this translation helpful? Give feedback.
First, this belongs to https://github.com/dotnet/csharplang/discussions
Have you checked role/extensions at dotnet/csharplang#5496 ?