We have used a homegrown version of object oriented coldfusion for a while and I'm just starting to experiment with cfc's and how it "should" be done...
If I understand correctly, cfinterface defines the signature of functions, and any class that implements that interface must have their own functions to do whats defined in the interface.
I'm kind of trying to do the opposite - the interface doesn't just define the function's signature, but also defines the logic of the function and anything that implements that interface can use its functions without having to define it itself. Does that exist besides creating subclasses?
For example, say you have classes A,B,C,D that all belong to the Animal class
- A & B can walk
- A & C can talk
- B & D can sleep
- Suppose the logic of walk, talk & sleep (if the object can do it) is the same regardless of the class doing it
- Ideally, if A & B both implement the walking interface, they can walk without defining a separate walk method in each class.
Or borrowing a better example from this java multiple inheritance question
- A Pegasus is a mix of a Horse and a Bird because it runs like a horse but flies like a bird
Is that possible? (I think this is multiple inheritance?)