Skip to main content

Methods

Earlier, we mentioned in passing that, in addition to properties, classes can also contain code. Each collection of code within a class is called a method, which corresponds (roughly) to a function or subroutine in other programming contexts.

Now, as you probably noticed, we haven't written any code, so you might think that our Film class does not have any methods. But, this is not the case.

When the Film class was compiled, Caché created several dozen methods for us. We can see a few examples here in the Inspector window. Place the cursor in the Inspector window and right click and then check Show Inherited Members in the context menu. Next, select Method from the drop down list at the top of the window. The Inspector now displays all of the methods that Film inherits from its superclasses. For example, Film inherits %Save generated description: little1.gif, which stores a Film object in the database, from %PersistentOpens in a new tab.

generated description: inspectormethods 20111

FeedbackOpens in a new tab