CSC/ECE 517 Fall 2011/ch4 4c ap: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
Line 17: Line 17:


==Simulating Multiple Inheritance==
==Simulating Multiple Inheritance==
Multiple Inheritance has several disadvantages that can lead to ambiguous code behavior either during compile time or run time. Ruby does not support direct Multiple Inheritance. But, Mutiple Inheritance can be achieved in Ruby through Modules. Modules simulate multiple inheritance in Ruby.
  Example - Taggable string


==Advantages of Multiple Inheritance==
==Advantages of Multiple Inheritance==

Revision as of 16:54, 16 October 2011

Modules and Mixins

Regular Expressions

Modules and Mixins

Mixins

Comparable

Composing Modules

Simulating Multiple Inheritance

Multiple Inheritance has several disadvantages that can lead to ambiguous code behavior either during compile time or run time. Ruby does not support direct Multiple Inheritance. But, Mutiple Inheritance can be achieved in Ruby through Modules. Modules simulate multiple inheritance in Ruby.

 Example - Taggable string

Advantages of Multiple Inheritance

Disadvantages of Multiple Inheritance

Extending Specific Objects

See Also

References

External Links