The Artima Developer Community
Sponsored Link

Java Answers Forum
OOPS

11 replies on 1 page. Most recent reply: Apr 4, 2007 6:17 AM by suresh kumar

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 11 replies on 1 page
Kalpana

Posts: 3
Nickname: kalps
Registered: May, 2004

OOPS Posted: May 14, 2004 9:13 PM
Reply to this message Reply
Advertisement
Hi All,
Some authors say that JAVA is purely Object Oriented Programming where as others say that its not based on 100%
OOPs concept.which one is actually correct?


Dhrubo

Posts: 32
Nickname: dhrubo
Registered: Mar, 2003

Re: OOPS Posted: May 15, 2004 12:03 AM
Reply to this message Reply
Java is a purely OO Language is the correct one.
C++ for example u can write programs with or without a class so its a hybrid OO language
C for example u have to write programs(forget OBJECT C ) without class hence its a pure non OO language.
Hope that clears yr doubts
Dhrubo
dhrubo@indiainfo.com

Shashank D. Jha

Posts: 68
Nickname: shashankd
Registered: May, 2004

Re: OOPS Posted: May 15, 2004 1:40 AM
Reply to this message Reply
Well,

First let someone put the definition of "Pure Object Oriented" ??



regards,
Shashank

Shashank D. Jha

Posts: 68
Nickname: shashankd
Registered: May, 2004

Re: OOPS Posted: May 15, 2004 2:36 AM
Reply to this message Reply
And also the source of that definition?

Basically, whenever such controversy arises, find out who is writing specification of object? Who is defining What is an Object? and Object Oriented language? Cause everything is relative but to have common, uniform understanding of some concept there are standards.

Lets first find out, or if someone knows and help us by telling the source and then definition of Object and pure object oriented language. Then only we can say if Java is pure or C++ is not?

Cause one literal mening of object oriented may mean, object oriented means a language that helps you to create objects (with specified behaviour) it doesnt means that it should help to create only objects, not components not funcitons etc..so that way C++ is pure object oriented as Java or Smalltalk etc.

Dhrubo

Posts: 32
Nickname: dhrubo
Registered: Mar, 2003

Re: OOPS Posted: May 16, 2004 10:46 PM
Reply to this message Reply
if that be the case why we write programs without a class in c++

Matthias Neumair

Posts: 660
Nickname: neumi
Registered: Sep, 2003

Re: OOPS Posted: May 17, 2004 1:57 AM
Reply to this message Reply
There is no pure object oriented language. The definitions can't be matched.

Smalltalk matches the definitions closer than every other language, on the 2nd place I see Java.

(example from the real world: In Smalltalk you can's hunt the elephant, the elephant must bring the hunt method with it, so you can call it).
In a pure OOP you can't modify objects in any way.
You must tell them to modify themself. In Java you can modify Objects (example: public variables).
This is only one example of what Java does wrong.
Java implements MOST definitions of a OOP, but not all.
C++ supports templates, Java not. Extending 2 classes with one Object is also not possible.
I heard they want to implement templates or multi-extension (don't know if that term is correct, I only know the german term) in the next version, but I'm not absolutely sure about that.

Shashank D. Jha

Posts: 68
Nickname: shashankd
Registered: May, 2004

Re: OOPS Posted: May 17, 2004 2:37 AM
Reply to this message Reply
Apart from things summarized above, also think that
Interface, abstract methods, Implementing an interface, Run Time Type detection capabilities and few more are not object oriented concepts. But are part of Java. Does that makes Java less pure object oriented??

Moreover the messages (as concept) are not treated as Objects in Java environment.

But in small talk.

There BlockClosure is a class, that inherits from class Object. Now this sounds a severe design flaw with Smalltalk, wherein a class (though we dont write class in smalltalk am not very sure about this but if ??) inherits from a Object?

Then again, you have some native types used in Java (like int) they are not treated as Objects though you may use Integer class for that purpose.


By the way does any specification document for Object Oriented langauges exist?

Matt Gerrans

Posts: 1153
Nickname: matt
Registered: Feb, 2002

Re: OOPS Posted: May 17, 2004 12:45 PM
Reply to this message Reply
Why does it matter?

Kishori Sharan

Posts: 211
Nickname: kishori
Registered: Feb, 2002

Re: OOPS Posted: May 17, 2004 3:43 PM
Reply to this message Reply
Object-orientedness is a paradigm. It is not a programming technique. There is no programming language (and there can't be any), which can be (or should be) called object-oriented. Programming languages can only have more or less faetures that can help us implement the object-oriented paradigm. Your code is not object-oriented just because you have written it in a particular language such as Java. C++ or SmallTalk. You can write object-oriented code even in FORTRAN and C. Your code can be object-oriented only if you perceive the problem domain in object-oriented fashion. The object-orientedness must be introduced at the ealiest stage of analysis/design. If you have perceived your problem domain in procedural fashion then no matter which programming language you use, your resulting code will be procedural.

Object-orientedness totally depends on your ability to think. A programming language doens't give you ability to think in a particular fashion. It only contains features that helps you implement your particular way of thinking. If you can think in terms of objects then pick your language (you are free to pick even COBOL) and start wrtiing object-oriented code.

It is would be naive to discuss which one, Java or C++, is more object-oriented!

Shashank D. Jha

Posts: 68
Nickname: shashankd
Registered: May, 2004

Re: OOPS Posted: May 17, 2004 11:09 PM
Reply to this message Reply
I agree whatever you say that object oriented is a paradigm as today is Component!.

But then there is a standard for components existing that describes what all a component can do and what it cannot. What are its surface features, structure, deployment envionment etc.

Looks like there is no such standard specification for Objects, different/ other then theoretical books/ documents etc. , that can describe what all an object is allowed to do.

It is fine that this behaviour can be achived using any non object oriented language like C, Fortran etc. Here issue I wanna know is that Is there any standard document existing that can tell, elaborate and mandate what an object is supposed to do, look like etc?

Then only it makes contructive sense to think and discuss about which one is more object oriented language, else its academic discussion without having reference to some standard reference document on Objects.

Shashank D. Jha

Posts: 68
Nickname: shashankd
Registered: May, 2004

Re: OOPS Posted: May 17, 2004 11:10 PM
Reply to this message Reply
Which thing?

suresh kumar

Posts: 1
Nickname: sureshbk
Registered: Apr, 2007

Re: OOPS Posted: Apr 4, 2007 6:17 AM
Reply to this message Reply
There are various reasons for which Java is not purely an oop magic bullet.
One obvious reason is that all users who used languages like c or or other such programming languages, would be able to use this language.
But a deeper reason is the calculation of primitive datatypes across platforms such as int, double or byte, whereby the usage of such datatypes would take more than the specified space.
Again, as per specification, java must be invoked in a 32 bit OS, but it does not specify if that OS must be OOP or not. So, another way by which java had to allow control during an execution is through the use of static keywords, and hence the main method gets control during execution of class.
And lastly we have the support for native calls, too in a rather non standard oop manner.
well thats all I can think of for the time being.

Flat View: This topic has 11 replies on 1 page
Topic: OOPS Previous Topic   Next Topic Topic: Sorting Multidimensional Array

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use