Differences between version 6 and predecessor to the previous major change of ObjectOrientedProgramming.
Other diffs: Previous Revision, Previous Author, or view the Annotated Edit History
Newer page: | version 6 | Last edited on Saturday, October 25, 2003 5:38:51 pm | by StuartYeates | Revert |
Older page: | version 3 | Last edited on Friday, May 30, 2003 11:27:04 am | by DavidHallett | Revert |
@@ -1,7 +1,7 @@
A style of programming, usually supported by special programming languages.
-[C++], [Java], [Python] and [Ocaml] support object oriented programming. As, indeed, do many others. SmallTalk is often attributed to being the first truly object oriented language.
+[C++], [Java], [Python], [Oberon
] and [Ocaml] support object oriented programming. As, indeed, do many others. SmallTalk is often attributed to being the first truly object oriented language.
For some reason, there has been a large amount of people talking about how great object oriented programming is. This fad started in the last 1990's and continues today. Programmers are finding, though, that such a methodology is not quite up to all it is supposed to be.
The idea behind object oriented programming is that every component you make has the ability to be ''extended''and ''reused''. You can make some generic component that provides some basic functionality and then ''derive'' another component from this, ''inherit''ing all the existing functionality, with the ability to ''override'' this functionality when needed or merely ''extend'' whatever the component is doing.
@@ -18,9 +18,9 @@
System.out.println("Hi, I am an animal.");
}
}
-What a boring class
. Let us ''extend'' this class a little by ''inherit''ing from it.
+What a boring [Class]
. Let us ''extend'' this class a little by ''inherit''ing from it.
public class Dog extends Animal {
public String getName() { return "Dog"; }
public void talk() {
@@ -66,6 +66,16 @@
There is a lot of theory involved in ObjectOrientedProgramming. A lot of processes have been invented in attempts to make designing systems easier: people who have studied it may remember CRC cards and class diagrams. Object oriented design purists will talk about class responsibilities and communications between classes and such.
Done well, object oriented programming is great. Given a good design, doing it well is not all that hard. Getting a good design is often near impossible.
+
+----
+
+Now, you do not have to go all out when using ideas that form parts of ObjectOrientedProgramming. PerryLorier pointed out after reading this article that ObjectOrientedProgramming has bought some very useful ideas into programming languages that can be used for general purpose programming.
+
+Encapsulation - everything in a class is __encapsulated__ in that class. A class is its own [NameSpace]. This is an idea you often do not understand too well when you are new to programming but makes a lot of sense as you get a bit more experienced at writing somewhat larger applications. Now, the idea of full encapsulation of data and functions is quite a powerful one. It allows us to instantiate an object of some class and know it only works on its own data. It even easily allows us to instantiate more than on instance and know each will work separately. There is a little more to it than this, but that is the basic idea: functionality and data __encapsulated__.
+
+Increased type checking is helpful in many cases, the use of some object oriented techniques can help find type errors in some languages earlier. Not all languages need stronger type checking, though, and not all programmers want this. In general it is fair to say it helps lower programmer errors, though, making it a useful feature of object oriented techniques.
+
+The last two points are just trying to get across the fact that some of the ideas of ObjectOrientedProgramming can be used in general programming without "going the full hog" and using all the design patterns and implementing things in a purely object oriented way.
(Feedback to SamJansen if you like)