Ontology Oriented Programming

I will soon start to write about Ontology Oriented Programming, that is to say a Knowledge based approach to programming, to distinguish from Object Oriented Programming whose only purpose is to write software.

With ObjectOP, a software extract and analyze data to give informations. For knowledge to be created it require a human being to read this information. ObjectOP is a data processing approach, perfect to be used in a workflow or expert system.

In OntologyOP, the main purpose is to store, manage and create new information and knowledges using reasoning. Ontology is an information reasoning approach, appropriate for Knowledge Management Systems and Artificial Intelligence.

Objective-C Class Initializer

This post is the first in a series of posts about Objective-c / Cocoa programming tips.
As you should already known, a basic initializer for an objective-c class looks like this:

- (id)init {
    if (self = [super init]) {
        /* Put your code here */
    return self;

But what does it mean?
Firstly, the minus sign tell us it is an instance method. It can only be called on an already allocated object.
Secondly, your initializer returns an id object. An id object is more flexible to use than a pointer, it can refer to any kind of object. It also allows to call method that aren't on the interface declaration, without getting a warning from the compiler.
Thirdly, we put the result of the call to the super initializer in our self pointer. This pointer represents the object we are currently initializing. As a matter of fact, in most cases we don't need to to change the self value. It is only a security in case the super initializer would return something else than the object to be initialized. I don't know any class where it can happen, but it's better to be careful.
Finally, if the call to the super initializer fail, that is to say if it returns a nil pointer value, the initialization code isn't executed and nil is returned by this method.