Get rid of reflection for parsing
- Dominant language
- C#
- Stars
- 5
- Forks
- 0
- Avg merge
- 6m
- Merged PRs (30d)
- 4
Description
The [ScalarBuilder](https://github.com/atmoos/Quantities/blob/main/source/Atmoos.Quantities/Core/Construction/ScalarBuilder.cs) relies heavily on reflection. This is really ugly and ought to be improved.
Consider letting units implement an interface that looks something like this:
```csharp
public interface IUnitFactory where TSelf : IUnit, IDimension
{
static abstract Creator GetCreator(/* ISystems ?? */);
}
```
Relates to #72
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with source/Atmoos.Quantities/Core/Construction/ScalarBuilder.cs to map where reflection is used during parsing, then review the related discussion in issue #72. Compare that flow with the proposed IUnitFactory interface and determine the required creator and systems contracts. Done means parsing no longer depends on the current reflection-heavy approach while preserving the library's typesafe quantity behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100