Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there such a thing as object overkill?

Status
Not open for further replies.

RotorTorque

Programmer
Apr 29, 2007
100
US
Hi all,
I currently started a new job and was assigned a project that according to my new boss was near completion. I am having a hard time deciphering the code because in my opinion the developer that started the project used way too many objects. I want to know, is there such a thing as object overkill in object oriented development?

Looking forward to your opinion,
Rotortoque :)
 
RT,

I believe the short answer is yes. But it really depends on the programming task. For example I do quite a bit of programming with Windows CE and when I started out with the heavy object approach, it turned out to be very costly in terms of speed and memory usage. So I dropped back down to simpler schemes like structures and byte streams (file IO) and yes even the API. I did have to write more code but the overall performance gains were significant.

While objects are very flexible, many times there is a negative impact on speed and memory usage. Objects can be grown to complex unwieldy creatures that become hard to manage. For most my programming tasks I simply choose to make it less complex - I tend to use the kiss principle over complex schemes.

There is a lot of bloat in the programming architecture from MS and IMHO they need to focus more resources into tuning functions for speed and efficiency.

Just My 2c,
TLN1
 

If the project is well designed, no, but that's not usually the case. We've all added classes and forms on the fly, but some take it to the extreme and use a class where a hashtable or enumeration would work.

I don't know what your project looks like, but I'll trade with you. I inherited a project where the original "programmer" was allowed to run unchecked. All his creation does is pull online surveys, insert them into a local database and provide a reporting and editing GUI.
To accomplish this there are 3 console applications, and 2 class libraries, with a grand total of 167 classes. There are classes that do nothing but hard code a parameter setting and create an instance of another class to pass it to. Others that do nothing but add column lables to datatable. None of the forms have any code behind them, the event handlers are all called from a class called by another class, with the original form passed through the chain by reference. It's kind of tough to follow when half the comments were written in Russian by interns and the rest don't really say anything useful.

Pat

 
That's the main reason Relational Databases won out over Object Oriented databases in the business arena: there was just too much overhead with all the object stuff which slowed the database way down -- and with business speed is very important. What's more is they are much more complicated to design for and use. (however they are still used in science and engineering)

The object oriented design was meant to simplify things and make things easier. But when it is over done it actually has the opposite effect. All the superfluous code only makes for slower-running and harder to maintain apps.

The answer is to use moderation. Use it when it makes sense and don't overuse a good thing.

It's like healthy nutritious food: a little is good for you, too much of it can kill you.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top