agrestio / agrest

Server-side Java REST Framework for easy access to data graphs from various backends
https://agrest.io
Apache License 2.0
82 stars 34 forks source link

Look up converters by type, not by entity or attribute; value Encoders based on known converters #533

Closed andrus closed 2 years ago

andrus commented 2 years ago

The IStringConverterFactory implements methods to look up converters either by AgEntity, or by AgEntity and attribute name. This barely makes sense in the current Agrest. The former always returns a generic converter, and the latter simply does a lookup by attribute type, only with (inefficient) extra steps (concatenating Strings to build cache keys, creating a secondary cache).

So going to remove IStringConverterFactory, and replace it by ValueStringConverters that does lookups by value type.

Additionally ValueEncoders will be refactored to create encoders based on known "value-string" converters instead of duplicating the same converter algorithms in Encoders.

andrus commented 2 years ago

Additional commits related to this issue, but not tagged properly: