FSDN: · FSF Europe · FSM · DotGNU · Userlocal
[GNU-Friends] Sections: Front Page · News · Interviews · GNU-Friends · Diaries
Menu: About · Submit Story · FAQ · Donate · Search
Hosted by: Kieser.net
Object-Oriented Programming
By johnnyb, Section Diaries
Posted on Fri Aug 2nd, 2002 at 03:57:17 GMT
This is a response to an article on the dbdebunkings.com site called "Is a Circle an Ellipse"?:

First of all, let me say that I love your site. I am a much better-informed person for reading it.

Secondly, let me say that you, like most people even in the OO community, have missed what inheritance is really about. As you know, many people in the database community have missed what databases are all about, so it's shouldn't come as a surprise to you that other computer fields have the same problems.

The article focused on inheritance as a type/subtype relationship. There are two ways to define type/subtype relationships - by restriction or generalization. Neither of these are useful for object-oriented programming.

Object-oriented programming is defined by one thing - interfaces. The ability for an object to "do" something. In your circle/ellipse example, you did not list any operations for them to "do", so it is impossible to tell what kind of relationship they would have in the object-oriented programming world. For example, if they both implemented a function called "enlarge", then they would both implement the interface Enlargeable. In fact, squares and pentagons could be part of this category as well. With this in place, an application can enlarge an object independent of what type it is, or what data it carries.

My philosophy teacher always asked "how do you define a chair"? He gave possible examples - a flat board with four legs and a back. However, this did not work for three-legged chairs. Any definition along these lines would fail for some chair invented somewhere. The bean-bag chairs really threw people. However, this is because it needed an operational definition - a chair is something that you sit on. Or, in computer terms, implements the SitOn interface. Object-oriented programming gives operational definitions, and thus makes itself a very powerful tool in programming.

Interestingly, this makes object-oriented programming completely orthogonal to databases, since one deals with the operational characteristics and the other deals with the data and data dependencies of a system.

Anyway, I wrote a short paper on this in college - you can read it at

http://www.eskimo.com/~johnnyb/computers/FactoringInheritance/

 

< Brave GNU World - Issue #41 (1 comments) | Qt# 0.4 Released (0 comments) >
Login
Make a new account
Username:
Password:

View: Display: Sort:
Object-Oriented Programming | 1 comments (1 topical, editorial) | Post A Comment
[new] Good stuff (#1)
by coriordan (#377) () on Wed Nov 13th, 2002 at 03:02:52 GMT
(User Info) http://www.compsoc.com/~coriordan/

Pointful and concise, I know some people that I
wish would read this.

I've bookmarked your college paper, I'll read it
tomorro. So many people think that Object
Orietation is something a langauge does. I tell
them to read some GNOME or GIMP C code. They don't.

Ciaran O'Riordan


[ Reply to This ]


 
Object-Oriented Programming | 1 comments (1 topical, editorial) | Post A Comment
View: Display: Sort:

Verbatim copying and distribution of this article is permitted in any medium, provided this notice is preserved. Images of gnu:s in the logo are © Free Software Foundation, Inc and distributed under the GNU General Public License. Comments are copyright by thir respective owner. All other material are © 2002 .