Alex Rivera | Logout

Is it possible to over OO?

Asked 2008-09-10T15:01:48.407
9

My question is simple; is it possible to over object-orient your code?

How much is too much? At what point are you giving up readability and maintainability for the sake of OO?

I am a huge OO person but sometimes I wonder if I am over-complicating my code....

Thoughts?

oop
Edit
Report

3 Answers

29

is it possible to over object-orient your code

Yes

answered 2008-09-10T15:03:17.030
0

I think there are times when OO design can be taken to an extreme and even in very large projects make the code less readable and maintainable. For instance, there can be use in a footware base class, and child classes of sneaker, dress shoe, etc. But I have read/reviewed people's code where it seemed as though they were going to the extreme of creating classes beneath that for NikeSneakers and ReebokSneakers. Certainly there are differences between the two, but to have readable, maintainable code, I believe its important, at times, to expand a class to adapt to differences rather than creating new child classes to handle the differences.

answered 2008-09-10T15:12:08.850
0

I think anything can be "overdone". This is true with nearly every best practice I can think of. I've seen inheritance chains so complex, the code was virtually unmanageable.

answered 2008-09-10T15:54:18.187

Your Answer