Autodesk / Autodesk/AutomaticComponentToolkit

Component Injection should not create global variables

Open
#130 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
53
Forks
26
PR merge metrics
No merged PRs in 30d

Description

Currently, component injection on the implementation side introduces static global variables - which are not a good idea in my opinion to introduce.

My suggestion would be, that we refactor component injection on the global level, and rather make it a feature of specific objects themselves. All classes that are created as return or out value of a method of an object would automatically "inherit" the injected component.

This would make a pattern very straight-forward, where people create a global context (like an "App" object) - and then use this as starting point for all further operations.

Contributor guide

Open the contributing guide

Research direction

Start by tracing the implementation-side component injection and the object creation paths for method return and out values. Define how injected components should be inherited from a context object, then verify that the refactor removes static global variables while preserving injection for returned objects.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
tooling
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.