di icon indicating copy to clipboard operation
di copied to clipboard

Add ability to set classes when resolving which an exception should be thrown

Open vjik opened this issue 2 years ago • 5 comments

Goal: DTO and entities should not be resolved by container.

It can be implemented by using a callable. Will be good add option to disable this check.

vjik avatar Jan 29 '23 17:01 vjik

Could be done with:

  1. Using annotations to mark each individual class.
  2. Using annotations to mark parent interface.
  3. Using a configuration to mark a namespace and its sub-namespaces.

samdark avatar Jan 30 '23 08:01 samdark

Performance may drop because of these additional checks so:

  1. Benchmark is needed.
  2. If performace drop is significant, there should be an option to turn it off. It will likely be used in production.

samdark avatar Jan 30 '23 08:01 samdark

Overall the idea looks like https://github.com/qossmic/deptrac but different.

samdark avatar Jan 30 '23 08:01 samdark

It's better to have it as a static analyser extension imho

xepozz avatar Jan 30 '23 11:01 xepozz

Yes, maybe.

samdark avatar Jan 30 '23 14:01 samdark