View Full Version : Parameter/property inheritance

03-29-2009, 11:47 AM
If I had an object {lets call it Fred} that is of type BigObject, but BigObject uses another object {FullDuplexSerial} how can I make the Start/stop/etc parameters of FullDuplexSerial inherited by bigObject?

Rather than have my own 'start' procedure in BigObject (that just calls the start parameter of FullDuplexSerial and directly passes the inputs), I could then just call "Fred.Start (12,13,0,9600)" for example.

Thanks in advance


Mike Green
03-29-2009, 12:09 PM
You can't. Spin is not a complete object oriented language. In fact, its object orientation is quite limited. Only method names and named constants are inherited and inheritance only goes out one level.

Phil Pilgrim (PhiPi)
03-29-2009, 12:10 PM
Inheritance as you describe it is not implemented in Spin. Your object's start method will have to call the one in FullDuplexSerial explicitly.