| | |
what is object oriented????
![]() |
>what is actually meant by object oriented
Put simply, the problem is solved by thinking with objects. Then you ask what an object is and we say that it's a self-contained unit of data and code that operates on that data such that a single problem can be addressed using the object. As an example, rather than creating a socket variable and calling functions with it, you create a socket object and call methods provided by the socket class.
>people always say that C++ is an object oriented and VB is not really an object oriented
C++ is multi-paradigm. It directly supports the features necessary for several different methodologies, including object-oriented. VB is probably more object-oriented that you would expect because of the form editor, and VB.NET is leaning heavily in the direction of OO.
Put simply, the problem is solved by thinking with objects. Then you ask what an object is and we say that it's a self-contained unit of data and code that operates on that data such that a single problem can be addressed using the object. As an example, rather than creating a socket variable and calling functions with it, you create a socket object and call methods provided by the socket class.
>people always say that C++ is an object oriented and VB is not really an object oriented
C++ is multi-paradigm. It directly supports the features necessary for several different methodologies, including object-oriented. VB is probably more object-oriented that you would expect because of the form editor, and VB.NET is leaning heavily in the direction of OO.
I'm here to prove you wrong.
Hmm big subject, there are whole books written purely to address this one question. Find one on Amazon or InformIT.com and read it, it will be worth every penny if your interested/studying or working computer programming.
Of the ones I've read these were some of the best :
Object Thinking, by David West Publisher: Microsoft Press Pub Date: February 11, 2004 ISBN: 0-7356-1965-4,
Sams Teach Yourself C++ in 24 Hours, Third Edition by Jesse Liberty Publisher: Sams Pub Date: August 24, 2001 ISBN: 0-672-32224-2
Pragmatic Programmer, The: From Journeyman to Master by Andrew Hunt, David Thomas Publisher: Addison Wesley Professional Pub Date: October 20, 1999 ISBN: 0-201-61622-X
Most languages since the late 90's support OO concepts to various degrees of depth and with various degrees of success. There is hot debate over what TRUE OO Programming is. To describe OO is beyond the scope of a topic in a forum, and to appreciate what the OO fuss is all about you need to know a bit about the history of computers and the programming of them.
At its most basic it is a method to design and implement computer software, that makes parts of it re-usable in many different software solutions, to make software easier to maintain and extend in the future.
Consider this logging errors in your program. There are many ways to do that and a psuedo program might be
Now everytime you start a new programming project if you want to implement some form of logging, you have to write similar statements again and again and again....zzzzzzzzzzzzz
so instead, you hide all this implementation in a class called ...I don't know ErrorLog
I compile this as a self contained library (a type of program) and whenever I need logging in a futur programming solution I just remember to include a reference to my class library with my ErrorLog class in it and use it for logging. And to log an error I just call :
I don't care how ErrorLog does it, the public function in the errorlog class tells me "Give me a string and I'll log it as an error"
In the futire I might extend the class and make it do funky things like send errors as emails to administrative staff or a database. It's all hidden within the class so all my previous programs still work as before, or I make a new class that "inherits" from ErrorLog so I get all the functionality of ErrorLog (without having to write all that agin) and just add the new stuff.
Anyway I digress, I could go on for hours.
Of the ones I've read these were some of the best :
Object Thinking, by David West Publisher: Microsoft Press Pub Date: February 11, 2004 ISBN: 0-7356-1965-4,
Sams Teach Yourself C++ in 24 Hours, Third Edition by Jesse Liberty Publisher: Sams Pub Date: August 24, 2001 ISBN: 0-672-32224-2
Pragmatic Programmer, The: From Journeyman to Master by Andrew Hunt, David Thomas Publisher: Addison Wesley Professional Pub Date: October 20, 1999 ISBN: 0-201-61622-X
Most languages since the late 90's support OO concepts to various degrees of depth and with various degrees of success. There is hot debate over what TRUE OO Programming is. To describe OO is beyond the scope of a topic in a forum, and to appreciate what the OO fuss is all about you need to know a bit about the history of computers and the programming of them.
At its most basic it is a method to design and implement computer software, that makes parts of it re-usable in many different software solutions, to make software easier to maintain and extend in the future.
Consider this logging errors in your program. There are many ways to do that and a psuedo program might be
string theError = "An error ocured";
File = OpenFile("c:\somefile");
writefile(file, theError);Now everytime you start a new programming project if you want to implement some form of logging, you have to write similar statements again and again and again....zzzzzzzzzzzzz
so instead, you hide all this implementation in a class called ...I don't know ErrorLog
class ErrorLog
{
private:
File m_Logfile;
public:
static void LogError(string theError){writefile(m_LogFile, theError)};
};ErrorLog.LogError("my error");In the futire I might extend the class and make it do funky things like send errors as emails to administrative staff or a database. It's all hidden within the class so all my previous programs still work as before, or I make a new class that "inherits" from ErrorLog so I get all the functionality of ErrorLog (without having to write all that agin) and just add the new stuff.
Anyway I digress, I could go on for hours.
1. It is a way of thinking, especially organizationally. Different tasks are the responsibilities of different objects. For example, in C++, it's the responsibility of the vector to reallocate its own memory as needed, not some that of some procedure that uses the vector.
2. It's a way to create a dynamic typing system. This means I can have and use a Shape object and have it be an Ellipse, a Rectangle, or generalised Polygon without knowing what's underneath. Relative to C, this is C++'s biggest advantage.
3. It's a way of shortening code size and treating data consistently. Instead of needing to se different names, as in vector_get(v,i) and string_get(s,i) and map_get(m,i), you can write v.get(i) and s.get(i) and m.get(i). (Or, depending on the programming language and library, v[i], s[i], and m[i].)
It's not really about hiding implementation, since you can do that in any language with subroutines.
2. It's a way to create a dynamic typing system. This means I can have and use a Shape object and have it be an Ellipse, a Rectangle, or generalised Polygon without knowing what's underneath. Relative to C, this is C++'s biggest advantage.
3. It's a way of shortening code size and treating data consistently. Instead of needing to se different names, as in vector_get(v,i) and string_get(s,i) and map_get(m,i), you can write v.get(i) and s.get(i) and m.get(i). (Or, depending on the programming language and library, v[i], s[i], and m[i].)
It's not really about hiding implementation, since you can do that in any language with subroutines.
All my posts may be redistributed under the GNU Free Documentation License.
•
•
•
•
Originally Posted by hadi_82
when is a programming language is considered as object oriented language?
VB6 for example supports classes, it doesn't properly support inheritance though, and without the first two polymorphism is out. So VB6 is not 100% OO but there is some OO in there.
C++ is both an OO language AND not an OO language C++ supports all three pillars of OO, BUT it doesn't force you to use them you can still create structured programs in C++ without using any of it's OO capability.
JAVA is an OO language everything is an object, even the main starting point of the program is a class, you cannot (to the best of my knowlwedge) write a JAVA program without classes.
![]() |
Similar Threads
- Trying to create a C++ object oriented game (Game Development)
- procedure and object-oriented ! (C)
- Object-Oriented Programming (C++)
- JAVA: Need help w/constructors object oriented programming (Java)
Other Threads in the IT Professionals' Lounge Forum
- Previous Thread: please help!!!
- Next Thread: Why You Should Switch to Linux
| Thread Tools | Search this Thread |
1gbit advertising advice amazon archive british broadband business businessprocesses career censorship cern china cio collectiveintelligence connectivity consumer consumers corporateearnings datatransfer debtcollectors dictionary digg digital ebay ecommerce email employment environment facebook food government grid high-definition hottub infodelivery infotech intel internet interview ipod isp japan kindle lhc library malware marketing mit moonfruit news onlineshopping piracy piratebay pope porn program r&d religion remoteworking research retail security sex shopping simple skype smallbusiness smb socialmedia socialnetworking software softwareengineer spam speed spending startrek statistics stocks study stumbleupon survey tabletpc technology touch-screen touchscreen twitter uk videoinprint voips web webdeveloper windows words






