going class crazy, is this the right way?

  • Thread starter Thread starter Zack
  • Start date Start date
Z

Zack

I am writing an app using FileSystemWatcher and just went a little class
crazy.

I have the following classes
Server
MasterServer inherits server
SlaveServer inherits server
SiblingServer inherits server

I also have the following collections
ServerCollection
MasterServerCollection
SlaveServerCollection
SiblingServerCollection

As an experienced .Net programmer who understands classes would you design
it the same way?

The classes are real light as far as code goes.
Server just has a ServerPath property for the Path to monitor This should
probably be an array for multiple paths

MasterServer inherits Server and just has a SlaveServer property that is
supposed to be a collection of SlaveServer objects

Am I on the right track?

Thanks
zack
 
There often is no "right" way to design a set of classes. imho, you should
derive new classes from your base classes when you expect the functionality
to diverge as development progresses. However, I often create new classes
from collections just so I can avoid having to cast the objects to know
types when I use them. Consequently, I do have rather a lot of classes with
not much code in my program.
 
Back
Top