Page 1 of 1

implement supports interface

Posted: 5 Jun 2015 7:58
by Peter Muraya
Hi,
It is clear to me that an interface SUPPORTS another interface and that an implement INHERITS from a class. I note that in Visual Prolog it is valid for an implement to SUPPORT some interface, but I'm not quite clear when this would be useful. Can you show me a problem that is neatly solved by this Visual Prolog construct?

Posted: 5 Jun 2015 8:27
by Thomas Linder Puls
You will support an interface in the implementation if you privately need to be such an object, but don't want/need to expose it publicly.

The Support pattern shows such an example: the target supports the targetSite in the implementation. The targetSite is used to provide functionality from the target to the targetSupport. But this is not important for the external appearance of the target, and therefore the support is kept private in the implementation.