warriordog / ActivityPubSharp

Modular implementation of ActivityPub in C#
https://warriordog.github.io/ActivityPubSharp/
Mozilla Public License 2.0
45 stars 9 forks source link

Prototype lazy type graphs #153

Closed warriordog closed 8 months ago

warriordog commented 8 months ago

This is an idea for an improvement + optimization for the type graph system. It introduces some complexity, but has some key benefits:

  1. This finally clears the way to #134.
  2. Performance improvement - we only convert entities that are actually used.
  3. Removes dependency on ASTypeInfoCache

There may also be an opportunity to reduce the use of pivots by developing an EntityFactory or similar. That could be injected into TypeGraphReader and used to construct the appropriate entity types in a more-efficient way.

Proposed design (WIP):

warriordog commented 8 months ago

Updated design to account for ASP.NET Core - Dependency Injection is not available in middleware. TypeMapConverter must have a no-args constructor.