Mar 21st, 2012, 11:50 AM
When is Lines and methods too much? Classes responsibility?
So, I've got this class that retrieves a list of values from remote computers via WMI for an inventory program I'm developing.
My Question is: When is lines too much? The class's got currently 800 lines and I've got another with 1200.
Do you think thess methods fall in the same responsibility? (To Obtain Hardware Info about remote computers)
If these methods are too much, should I inherit another class and keep going from there?
Last edited by pukisoft; Mar 29th, 2012 at 10:05 AM.
Mar 21st, 2012, 12:48 PM
Re: When is Lines and methods too much? Classes responsability?
Those are some pretty large classes. However, the problem is one of organization. If the ideal organization really requires that many lines, then so be it, but that is rarely the case. One thing I would say about it is that the one place where I can see a class having a large number of lines is one that is used as some kind of utility to acdess something, and that pretty well describes your situation.
You might be able to break it into a series of classes, where one class handles one kind of information while other classes handle other parts of the information. Alternatively, you could break the class into a series of partial class files. This does nothing for simplifying the actual class, but structures the organization better.
My usual boring signature: Nothing
Click Here to Expand Forum to Full Width
Survey posted by VBForums.