About inheritance

(Alberto González Ramírez) #1

I am studying Omnifocus dictionary.
In that dictionary there is a class, FLATTENED PROJECT, that inherits from PROJECT.
Both classes share the SAME properties, elements and commands.
¿Which is the reason to create another class?

(Ed Stockly) #2

I don’t have that app, but it sounds like a project class includes flattened projects and, presumably, other kinds of projects. With that distinction you should be able to:

tell flattened project 1
  --do some stuff
end tell


tell project 1
  --do some other stuff

(Mark Alldritt) #3

When applications present collections of objects, known as elements, they can only organize the elements by object type, not object meaning. This means that an application can only offer collections of classes of objects (window, document, etc.).

If objects of a particular class can be organized by meaning (e.g. flattened vs normal projects) applications must resort to defining different classes of objects. I’m no expert in OmniFocus, but I suspect that is what is happening here. By creating the flattened project subclass of project, the Omni folks have made it possible to have a collection of projects organized hierarchically and a collection of projects organized into a flattened list.