Silverlight & Sealed classes

Silverlight & Sealed classes

Old forum URL: forums.lhotka.net/forums/t/7264.aspx


rfcdejong posted on Monday, July 13, 2009

Why o why are so many classes sealed?

There are only 2 reasons i could find on google / bing / etc.
A discussion: http://silverlight.net/forums/p/101760/242503.aspx

- Improved performance;
- To save time for testing in the silverlight team.

Does anyone know's why?

Some guy named "Karl Seguin" gave silverlight up for this reason.
http://codebetter.com/blogs/karlseguin/archive/2009/05/23/2-years-ago-i-gave-up-on-silverlight.aspx

ajj3085 replied on Monday, July 13, 2009

Allowing others to subclass makes maintence much harder. Basically, when you allow a subclass, you are providing an API that you can't change easily in the future, and your work is harder because you must consider what 3rd party developers MIGHT do when they override something. So allowing subclasses isn't something that should be done lightly.

rfcdejong replied on Monday, July 13, 2009

indeed, that is why i thought it as well... but the main reason seems to be performance
not having virtuals makes it 5 to 20 times faster (500% to 2000%)

Copyright (c) Marimer LLC