Skip to content
This repository has been archived by the owner on Jun 30, 2023. It is now read-only.

Provide simple property to opt out of static proxies #48

Closed
kzu opened this issue Dec 12, 2020 · 3 comments · Fixed by #50 or #54
Closed

Provide simple property to opt out of static proxies #48

kzu opened this issue Dec 12, 2020 · 3 comments · Fixed by #50 or #54
Labels
enhancement New feature or request

Comments

@kzu
Copy link
Member

kzu commented Dec 12, 2020

Dynamic proxies based on Castle.Core are super stable, well supported and have stood the test of time.

Static proxies based on source generators are brand-new and therefore lack the broad testing in the wild, so it should be very easy (and with a documented property) to turn them off if things don't quite work for particular scenarios.

Proposed property: EnableCompiledAvatars. Not mentioning "source generator" in the property since that's an implementation detail people may not easily recognize, and "compiled" conveys that these are things that happen at compile-time, rather than run-time like the dynamic proxies (which are better known).

The property should be true by default whenever the project supports source generators (C#9+).

@kzu kzu added the enhancement New feature or request label Dec 12, 2020
kzu added a commit that referenced this issue Dec 12, 2020
These are easier to remember and more intuitive.

Fixes #48
kzu added a commit that referenced this issue Dec 13, 2020
These are easier to remember and more intuitive.

Fixes #48
@kzu kzu closed this as completed in #50 Dec 14, 2020
kzu added a commit that referenced this issue Dec 14, 2020
These are easier to remember and more intuitive.

Fixes #48
@stakx
Copy link
Contributor

stakx commented Dec 14, 2020

Proposed property: EnableCompiledAvatars. Not mentioning "source generator" in the property since that's an implementation detail people may not easily recognize, and "compiled" conveys that these are things that happen at compile-time, rather than run-time

Agreed, esp. with the first part; however, Compiled by itself may not necessarily equate "compile-time". For example, Regexes can be "compiled", but that's a process that (AFAIK) happens at run-time.

If you don't mind long names, how about EnableCompileTime[Generated]Avatars?

@kzu
Copy link
Member Author

kzu commented Dec 15, 2020

Well, AFAIK, that regex situation is very likely to change too to use source generators to speed up run-time, yet the option in the API will still be called RegexOptions.Compiled 🤔. I wanted to keep the property short-ish, but EnableCompileTimeAvatars isn't too bad. Then the Castle.Core-based ones would be EnableRunTimeAvatars?

@stakx
Copy link
Contributor

stakx commented Dec 15, 2020

yet the option in the API will still be called RegexOptions.Compiled

Good point.

If you prefer short names, the ones you've already got now seem fine, as do the ones you suggested above.

kzu added a commit that referenced this issue Dec 17, 2020
This makes them more explicit.

Addresses feedback from #48.
Fixes #48.
kzu added a commit that referenced this issue Dec 17, 2020
This makes them more explicit.

Addresses feedback from #48.
Fixes #48.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
2 participants