Sunday, June 26, 2005

 

Partial classes and encapsulation

A few years ago, Scott Meyers published a controversial article ("How non-member functions improve encapsulation"). He had some good points but overall I didn't like the idea. If I take his theory to the extreme, a class with only getters and setters is "more encapsulated".
At the time, I thought the problem was real but the solution was bad - and that a different approach, like being able to add methods to a class without adding a subtype, could lead to a better solution.
For a long time now I've postponed any serious :-) thinking about partial classes in .NET and how they fit into the picture. Well, sooner or later I'll tinker with that :-)).

Comments: Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?