Don't split for the sake of splitting. You are only making the interface awkward - instead of architecture.Foo()
you'll have to write architecture.Process.Foo()
- it's not natural to stuff the Process
identifier there...
If you have too many methods, maybe your class is trying to represent an whole hierarchy by itself? Assuming Architecture
is about buildings, maybe it also tries to represent the floors of the building, so you have methods like RoomCountInFloor(int floorNumber)
. In that case, you should have a Floor
class, and Architecture
should contain a collection of floors, so you can write architecture.Floors[5].RoomCount
- much better than architecture.Process.RoomCountInFloor(5)
, right?
Another possibility is that you are using too much service methods - and in that case you might want to put those service methods into service classes. In a Java project I did once, I had to use many service methods to manage all the temp files that one of my classes was using. Instead of adding those service methods to that class, I created a TempFileManager
class to do that. That splitting forced me to add some more methods(encapsulation and all), but it's much more organized that way, and now if I ever need a similar temp file management in another project I can simply copy that class.
It is also possible that you do need 50 methods to handle whatever Architecture
represents directly, but having all those methods in one big file is too messy. In that case, you should consider using C#'s partial class feature.