The Rise of Class Hierarchy Because of psychological push for purity, in Java there are no longer plain subroutines. Everything is a method of some class. Standard functions like opening a file, square root a number, for loop thru a list, if else branching statements, or simple arithmetic operations... must now somehow become a method of some class. In this way, coupled with the all-important need to manage data with inheritance, the OOP Class Hierarchy is born.
Basic data types such as now the various classes of numbers, are now grouped into a Number class hierarchy, each class having their own set of methods. The characters, string or other data types, are lumped into one hierarchy class of data types. Many types of lists (variously known as arrays, vectors, lists, hashes...), are lumped into a one hierarchy, with each Classe node having its own set methods as appropriate. Math functions, are lumped into some math class hierarchy. Now suppose the plus operation +, where does it go? Should it become methods of the various classes under Number headings, or should it be methods of the Math class set? Each language deals with these issues differently. As a example, see this page for the hierarchy of Java's core language classes: http://java.sun.com/j2se/1.4.2/docs/api/java/lang/package-tree.html (local copy) OOP being inherently complex exacerbated by marketing propaganda, and the inheritance and hierarchy concept is so entangled in OOP, sometimes OOP is erroneously thought of as languages with a hierarchy. (there are now also so-called Object-Oriented databases that ride the fad of “all data are trees” ...) Normally in a program, when we want to do some operation we just call the subroutine on some data. Such as open(this_file) square(4) But now with the pure OOP style, there can no longer be just a number or this_file path, because everything now must be a Object. So, the "this_file", usually being just a string representing the path to a file on the disk, is now some "file object". Initiated by something like this_file = new File("path to file"); where this file class has a bunch of methods such as reading or writing to it. see this page for the complexity of the IO tree http://java.sun.com/j2se/1.4.2/docs/api/java/io/package-tree.html (local copy) see this page for the documentation of the File class itself, along with its 40 or so methods and other things. http://java.sun.com/j2se/1.4.2/docs/api/java/io/File.html (local copy) ------- to be continued... This is part of an installment of the article “What are OOP's Jargons and Complexities” by Xah Lee, 20050128. The full text is at http://xahlee.org/Periodic_dosage_dir/t2/oop.html © Copyright 2005 by Xah Lee. Verbatim duplication of the complete article for non-profit purposes is granted. The article is published in the following newsgroups: comp.lang.c,comp.lang.c++,comp.lang.lisp,comp.unix.programmer comp.lang.python,comp.lang.perl.misc,comp.lang.scheme,comp.lang.java.programmer comp.lang.functional,comp.object,comp.software-eng,comp.software.patterns Xah [EMAIL PROTECTED] ∑ http://xahlee.org/ -- http://mail.python.org/mailman/listinfo/python-list