K
KV
I'm new to OO Design, and I'm fixing to start writing my very first C#
program. Given the complexity of OO programming, I would like to run
something by this group and get general input.
My example is a program called HijackThis. I'm sure many are familiar
that it is a spyware removal tool. The program looks at over 20 places
on Windows computers to see what is starting (with options to remove the
offending software). The program can remove browser helper objects,
browser homepage settings, programs in the run key of the registry, etc.
My first question - How do you think the author structured this program?
Would dividing the program up into 20 classes, one for each problem
area, be sufficient? That seems like a lot of classes, given that each
problem isn't too complicated. Should extra classes be avoided just
because they are simple? If that's the case, and I need to consolidate,
then how would I do it? Would I lump everything into one massive class?
Why? Where do I draw the line?
Second question - in action-oriented programming, we come up with a
bunch of different functions that are reusable, such as a generic
database access function or a generic ftp function. In this example, if
we use 20 classes, each class will likely much of the same method code
to access the registry. Does that mean I need a registry class with
public methods to manipulate the registry? If I understand the thrust
of OO programming, the main goal is that the class be reusable and not
dependent (coupled) with other classes or components. Such a registry
class seems like it wouldn't violate OO principles. But documentation
on such a class seems scarce. You would think there would be many
example classes out there for such a common operation. I can't help but
wonder if something hasn't sunken into my pea-sized brain.
Third question - I want to duplicate the BHO portion of HijackThis,
which would be a basic BHO remover with backup capabilities and a simple
interface. How would you, personally, design such a program?
Shifting my thinking after several years of programming the "other" way
is proving more difficult than I imagined (but I'm getting there, albeit
slowly). Nobody in my company does object-oriented programming, so I
don't have anybody to ask. Your help would be greatly appreciated.
-KV
program. Given the complexity of OO programming, I would like to run
something by this group and get general input.
My example is a program called HijackThis. I'm sure many are familiar
that it is a spyware removal tool. The program looks at over 20 places
on Windows computers to see what is starting (with options to remove the
offending software). The program can remove browser helper objects,
browser homepage settings, programs in the run key of the registry, etc.
My first question - How do you think the author structured this program?
Would dividing the program up into 20 classes, one for each problem
area, be sufficient? That seems like a lot of classes, given that each
problem isn't too complicated. Should extra classes be avoided just
because they are simple? If that's the case, and I need to consolidate,
then how would I do it? Would I lump everything into one massive class?
Why? Where do I draw the line?
Second question - in action-oriented programming, we come up with a
bunch of different functions that are reusable, such as a generic
database access function or a generic ftp function. In this example, if
we use 20 classes, each class will likely much of the same method code
to access the registry. Does that mean I need a registry class with
public methods to manipulate the registry? If I understand the thrust
of OO programming, the main goal is that the class be reusable and not
dependent (coupled) with other classes or components. Such a registry
class seems like it wouldn't violate OO principles. But documentation
on such a class seems scarce. You would think there would be many
example classes out there for such a common operation. I can't help but
wonder if something hasn't sunken into my pea-sized brain.
Third question - I want to duplicate the BHO portion of HijackThis,
which would be a basic BHO remover with backup capabilities and a simple
interface. How would you, personally, design such a program?
Shifting my thinking after several years of programming the "other" way
is proving more difficult than I imagined (but I'm getting there, albeit
slowly). Nobody in my company does object-oriented programming, so I
don't have anybody to ask. Your help would be greatly appreciated.
-KV