Skip to content

Conversation

@stakx
Copy link
Member

@stakx stakx commented Jan 2, 2021

DynamicProxy's internals have been stable over the past few years, and now that they are no longer public (see #505), we can view their type hierarchy as essentially frozen—at least for the time being. Marking internal classes that have no subclasses of their own as sealed formalizes this.

Being able to recognize final classes at a glance can be helpful when we want to refactor them.

(A few refactorings are included here because the C# compiler will warn about / disallow new protected or virtual members in sealed types.)

Update: Converting to draft, this PR should perhaps also devirtualize non-overridden members, and make them private where possible.

@stakx stakx force-pushed the dp/refactor/seal-internal-types branch 2 times, most recently from 88febef to 424af49 Compare January 3, 2021 20:26
@stakx stakx force-pushed the dp/refactor/seal-internal-types branch from 424af49 to d3d900e Compare January 3, 2021 20:44
@stakx stakx marked this pull request as draft January 5, 2021 00:46
@stakx
Copy link
Member Author

stakx commented Jan 12, 2021

I'll close this for the moment, this turns out to be a nice refactoring (IMO) but there probably isn't as much benefit to this as I thought.

@stakx stakx closed this Jan 12, 2021
using Castle.DynamicProxy.Generators.Emitters.SimpleAST;

internal abstract class ArgumentsUtil
internal static class ArgumentsUtil
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to at least get these static changes in. Shows how long ago these classes were first written to use abstract to prevent instantiation of the class.

@stakx stakx deleted the dp/refactor/seal-internal-types branch December 21, 2025 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants