lundi 6 mai 2019

What is convention for interface declaration?

In the past I noticed following interface declarations:

interface Searchable{
   fun search()
}

I am not sure, but I remember *able interfaces allow only 1 callback-function?

For instance if I would have multiple callback-search-functions:

interface Searchable{
   fun searchDepthFirst(val tree: Tree)
   fun searchBreadthFirst(val tree: Tree)
}

1. First of all, is there a name for this convention of *able interfaces?

2. Is this allowed as convention to call it Searchable with multiple callbacks?

3. If 2. is YES, is it allowed as convention to call the callbacks with the "on" prefix like: onSearchBreadthFirst() and onSearchDepthFirst() ?

Aucun commentaire:

Enregistrer un commentaire