Home > Coding Helpers > Code Providers – Seal Class

Code Providers – Seal Class

January 16th, 2011

This is one of the simplest code provider operations which simply marks the active class as ‘sealed’ (CSharp) or ‘NotInheritable‘ (Visual Basic). The sealed modifier is used to prevent inheriting from a class. For example, this can be useful when creating ‘helper’ classes containing utility methods that should never be extended by overriding the existing functionality. Another benefit of this code provider is that it enables a hypothetical run-time optimization, because having a sealed class known to never have any derivations; it is possible for the compiler to transform virtual function member invocations into non-virtual which take less time to perform.

CSharp preview:

CodeRush Seal Class code provider preview in CSharp

Visual Basic preview:

CodeRush Seal Class code provider preview in Visual Basic

—–
Products: CodeRush Pro
Versions: 10.2 and up
VS IDEs: any
Updated: Jan/26/2011
ID: C046

Similar Posts:

  1. Scott Slack
    May 21st, 2013 at 16:04 | #1

    Fatal error: Uncaught Error: Call to undefined function eregi_replace() in H:\root\home\megazoid-001\www\skorkincom\wp-content\plugins\bbcomments\BBComments.php:41 Stack trace: #0 H:\root\home\megazoid-001\www\skorkincom\wp-includes\class-wp-hook.php(289): render_comment() #1 H:\root\home\megazoid-001\www\skorkincom\wp-includes\plugin.php(212): WP_Hook->apply_filters() #2 H:\root\home\megazoid-001\www\skorkincom\wp-includes\comment-template.php(1028): apply_filters() #3 H:\root\home\megazoid-001\www\skorkincom\wp-content\themes\inove\functions.php(1163): comment_text() #4 H:\root\home\megazoid-001\www\skorkincom\wp-includes\class-walker-comment.php(179): custom_comments() #5 H:\root\home\megazoid-001\www\skorkincom\wp-includes\class-wp-walker.php(144): Walker_Comment->start_el() #6 H:\root\home\megazoid-001\www\skorkincom\wp-includes\class-walker-comment.php(139): Walker->display_element() #7 H:\root\home\megazoid-001\www\skorkincom\wp-includes\class-wp-walker.php(332): Walker_Comment->display_element() #8 H:\root\home\me in H:\root\home\megazoid-001\www\skorkincom\wp-content\plugins\bbcomments\BBComments.php on line 41
    WordPress › Error

    There has been a critical error on this website.

    Learn more about debugging in WordPress.