Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 136,100 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,677 people online right now. Registration is fast and FREE... Join Now!




The Key idea of the OOP

 
Reply to this topicStart new topic

The Key idea of the OOP

everspring79
14 Oct, 2007 - 01:38 AM
Post #1

New D.I.C Head
*

Joined: 9 Oct, 2007
Posts: 3


My Contributions
In the C++ Primer 4edition, chapter 15.1, it mentions that "The key idea behind OOP is polymorphism".

Actually, i don't agree with at all.
When we firstly stepped into the OOP world, the most popular character of the OO language is the inheritance. The so-called polymorphism is based on the concepts of the base type and the derived type. However, when many design petterns are learned from the real develpment of the OOP, i found that the composition is also another very useful method to use the OO language, sometimes more useful than the endless inheritance.

In my opinion, the key idea behind the OOP is the assignment, management and the collabration of the responsiblities of the different classes. It make the programming more like a social activity with the natural understanding.

Do you agree with my point?
Thanks.
User is offlineProfile CardPM
+Quote Post

William_Wilson
RE: The Key Idea Of The OOP
14 Oct, 2007 - 06:34 AM
Post #2

lost in compilation
Group Icon

Joined: 23 Dec, 2005
Posts: 3,984



Thanked: 16 times
Dream Kudos: 3275
Expert In: Java, C, Javascript

My Contributions
while you are correct that these items are important to programming, I will have to disagree in part. This is because you can have those characteristics in non OO languages.
Inheritance is a great (and necessary) feature, and you wouldn't have proper polymorphism without it. Essentially what your textbook is trying to get across is that the reason OO programming was created, is to allow objects to share traits and inherit traits (methods), while still having each object handle each difference independently. A simple example would be a line such as:
animal.speak();
animal is an object with subclasses, dog, cat, etc who knows, but something exists to give a more defined meaning, but we are able to generalize the speak command due to polymorphism. All animals can speak, but they all do it differently, thus allowing a general method call, perhaps running code like "open mouth" for all animal types, but the specific class still separates the actions.
User is offlineProfile CardPM
+Quote Post

NickDMax
RE: The Key Idea Of The OOP
14 Oct, 2007 - 06:51 AM
Post #3

2B||!2B
Group Icon

Joined: 18 Feb, 2007
Posts: 2,858



Thanked: 49 times
Dream Kudos: 550
My Contributions
To be honest I too do not strictly agree with the book either. To me the key idea behind OOP was code and data modularity -- I was stuck on this idea of a class allowing me to expand the idea of modular programming to encompass both code and data. Then again I learned C++ in another era where procedural languages ruled the earth.

I think that your statement about design patterns shows that you might be a little new to them. When we are first introduced to design patterns in OOP they seem wondrous and often open our eyes to some of the flaws and or uses of OOP. I am beginning to see how they may (especially in java) lead to the next generation of programming languages -- but they are an application of OOP and not the ivory tower of OOP design. -- therefore they offer an aspect OOP they do not define it.
User is offlineProfile CardPM
+Quote Post

Dark_Nexus
RE: The Key Idea Of The OOP
14 Oct, 2007 - 08:20 PM
Post #4

or something bad...real bad.
Group Icon

Joined: 2 May, 2004
Posts: 1,309



Thanked: 3 times
Dream Kudos: 625
My Contributions
java makes a lot of violations in both OOP and just language design in general. ruby and smalltalk are about as close as you can get to pure OOP right now.
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/1/08 08:55PM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month