#Xojo newline code#
When this is the case, no code is shared. This task involves defining the interface itself and then modifying to classes to indicate that they both implement this common interface. If two class share a common set of methods, it is possible to link these two classes together by saying they share a common interface. At the same time, it's convenient to formally establish this relationship so that the different objects can be used in similar contexts. There are some cases when you have two objects (or classes) that are related and that perform the same tasks, but they both do it in such a fundamentally different way that establishing the class/subclass relationship doesn't really buy you anything. Simply put, you don't have to write any new methods for the subclass to get the functionality resident in the superclass. The benefit to this, so the story goes, is that it enables code reuse. Although the subclass may optionally reimplement or override a method from the parent class, it doesn't have to reimplement any method unless it wants to modify what that method does. Nevertheless, when one class is a subclass of another, it shares all the same members with the parent class. Other languages, such as Objective-C, refer to a similar concept as a protocol.
![xojo newline xojo newline](http://cullytechnologies.com/portfolio/full/AtlXojo.png)
In REALbasic, an interface is used much in the same way that the term is used with Java. This is also one of those areas where the term is used differently in different programming languages. Interfaces are another means by which you encapsulate your program. When talking about Interfaces, you say that a class implements a particular Interface. With subclassing, one class can be a subclass of another. Interfaces are an alternative to subclassing.
![xojo newline xojo newline](https://www.mbs-plugins.de/images/xojoplugin.png)
Interfaces and Component-Oriented Programming In this section I will review some relatively more advanced programming techniques you can use to extend the functionality of your REALbasic classes. REALbasic Cross-Platform Application Development