This project is read-only.

Why are all the classes sealed?

Topics: APIs
Aug 24, 2015 at 2:28 AM
Edited Aug 24, 2015 at 2:31 AM
I'm converting a large project from CodeDom to Roslyn. The project is basically a replacement for MSDataSetGenerator and there is a huge hierarchy to pulling apart a schema and creating a compilation unit from it.

However, I ran into a brick wall with decision to seal all the major classes. My code is a hierarchy: I create a compile unit, add one or more namespaces to it, add one or more classes to my namespace, add one or more fields, methods and properties to the class, and so on. These decisions are driven by the data in the XMLSchema file. This is a structure that begs for OOP and, as primitive as it is, CodeDOM handles it very well.

So why was the design decision made to seal the Rosyln classes? This prevents me from creating a 'Namespace' class to which I can add 'Class' objects. Yes, I can encapsulate, but then reconstructing the syntax tree is a huge pain in the neck and it feels like I've spent the entire evening jumping through hoops trying to make an OOP version of a Roslyn syntax tree.
Aug 24, 2015 at 6:22 AM
This kind of discussions have moved to