[Logo]
Forums Register Login
Is Java pure object oriented
Hi,

Is the java a pure object oriented language. If not, please give me reasons. and what are native libraries.
Hoping quick reply...
What do you mean by "Pure Object Oriented language"? people disagree on what this term means, so no answer can be given.

if you want to find more info, just search this very forum for that phrase. it gets asked at least once a month.
People may argue about specifics about what that term means, but it is very hard to say java is. The reason is simple, there are data types that are not objects(primitives), and if you really wanted to, you never have to use objects.

native libraries are libraries that are native to a language. The java library is one, the C++ standard and template libraries are another. Something to note about them, they are not always the best solution to a specific problem, so going outside of them for things like data structures, or even writing your own in necessary. The generic nature of them makes them useful but usually at a performance cost.

It is a fairly rare occurence that you need something else, but that fact and the fact that learning how to use libraries does not a programmer make.
It gives you all the benefits of an OO language:

�Re-use of previous work: using implementation inheritance and object composition.

�Real mapping to the problem domain: Objects map to real world and represent vehicles, customers, products etc: with encapsulation.

�Modular Architecture: Objects, systems, frameworks etc are the building blocks of larger systems.

Also, you can complement it with AOP (Aspect Oriented Programming). Supports
inheritance, encapsulation and polymorphism. That is good enough for me to build build applications

with increased quality and reduced development time. If 90% of the new application consists of proven existing components then only the remaining 10% of the code have to be tested from scratch. In theory anyway.
 
Originally posted by Robert Hill:
People may argue about specifics about what that term means, but it is very hard to say java is. The reason is simple, there are data types that are not objects(primitives), and if you really wanted to, you never have to use objects.


In fact, Object is not even a type in Java.
fred said it best. Asking "Is Java Object Oriented" is a silly question that gets asked way too often, and generally doesn't help anybody learn anything about Java, about "OO" ... and one that certainly doesn't help anybody design or program any better.

Sigh...

PS:
Hopefully the question "What are native libraries?" was answered to your satisfaction. My answer would be:

"Native Libraries" are functions written in another language, and executed
outside of the JVM. Native libraries are usually written in C or C++,
and usually do something that would be inefficient - or impossible -
to do directly in Java. Native functions are invoked using "JNI"
(Java Native Interface).
[ March 01, 2006: Message edited by: Paul Santa Maria ]
It might be a useful question if it makes the original poster research and think about what "object oriented" is and is not. My personal view of "pure OO" is everything is an object and every operation is a message. In my short exposure to SmallTalk it seemed very pure and self consistent in this way, but I won't venture a percentage pure.

I think the Java/OO community lost a lot of meaning when it moved away from the "message" vocabulary. I liked reading "1 + 2" as sending the message "+ 2" to the "1" object. It seems to encourage me to think about "ask, don't tell" designs.
Stan, very well said!
 
Originally posted by Stan James:
I liked reading "1 + 2" as sending the message "+ 2" to the "1" object.

sending the message "+" to the object "1" with the data "2".
...not that I advocate the Smalltalk nonsense.
 
Originally posted by Tony Morris:
...not that I advocate the Smalltalk nonsense.[/QB]


I'd find it easier to listen to what you advocate if you wouldn't label everything else as "nonsense"...
The name of a Smalltalk method is the method and the parameters, so I think of it as the "+ 2" or "+ n" message. Not that it matters in this discussion. Smalltalk has a certain inner beauty; the fact that it was so totally backwards from what I knew before - from syntax to design - was quite challenging and exciting. I was disappointed we did not continue with it and it didn't catch on better in the industry. I think we'd all "get" this OO stuff better if we worked so backwards all the time.
There's an extremely interesting interview with Alan Kaye (the inventor of Smalltalk) - with much discussion of what he likes (and dislikes) about Java here:

http://acmqueue.com/modules.php?name=Content&pa=showpage&pid=273&page=2
Thank you for posting that, it was very interesting.

"Most software today is very much like an Egyptian pyramid with millions of bricks piled on top of each other, with no structural integrity, but just done by brute force and thousands of slaves."

Truer words have never been spoken.
Yes, very interesting article!

Some years ago, I attended a presentation on Squeak at a conference. The veterans attending nearly burst into tears that they typically had to use Java instead...
Wink, wink, nudge, nudge, say no more ... https://richsoil.com/cards



All times above are in ranch (not your local) time.
The current ranch time is
Nov 24, 2017 09:59:58.