CSC/ECE 517 Fall 2011/ch4 4a ga: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
==Introduction==
==Introduction==
This article discusses the extend concept as illustrated by Ruby's extend method. We provide a definition of extend, compare it to the include method, and go over the differences between extending a class and extending an object. We then consider two practical examples of Ruby's extend method.
From there, we go on to discuss how other languages provide functionality similar to that of Ruby's extend method. We also compare these implementations to the Ruby implementation as to whether they are more or less powerful than Ruby's. Finally, we also consider prototype-based languages such as Self, which don't even provide classes.
==Extend in Ruby==
==Extend in Ruby==
===What is Extend?===
===What is Extend?===

Revision as of 22:00, 16 October 2011

Introduction

This article discusses the extend concept as illustrated by Ruby's extend method. We provide a definition of extend, compare it to the include method, and go over the differences between extending a class and extending an object. We then consider two practical examples of Ruby's extend method.

From there, we go on to discuss how other languages provide functionality similar to that of Ruby's extend method. We also compare these implementations to the Ruby implementation as to whether they are more or less powerful than Ruby's. Finally, we also consider prototype-based languages such as Self, which don't even provide classes.

Extend in Ruby

What is Extend?

Definition

Extend vs. Include

Extending classes vs. Extending objects

Practical Examples

Twitter Module

Singleton Pattern

Extend in other languages

Conclusion