<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Arjones3</id>
	<title>Expertiza_Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Arjones3"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Arjones3"/>
	<updated>2026-10-02T05:33:14Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5662</id>
		<title>CSC/ECE 517 Fall 2007/wiki1b 1 as</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5662"/>
		<updated>2007-10-13T03:28:49Z</updated>

		<summary type="html">&lt;p&gt;Arjones3: /* 2. Using Namespaces to Avoid Conflict */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background =&lt;br /&gt;
&lt;br /&gt;
Ruby does not implement true multiple inheritance, but provides Modules as a way to reuse chunks of codes in many classes. Modules, unlike classes in OO languages such as Java, cannot be instantiated or sub-classed. Modules are included in class definitions by using the ‘include’ method which will mix that module’s methods into the calling class. The module’s methods will then become instance methods. &lt;br /&gt;
&lt;br /&gt;
A class can include several modules within the class definition. However, a problem exists when a class includes multiple modules that contain a method of the same name. Since the class will have access to both of these methods, unexpected behavior may occur when a call is made to a method with an ambiguous name.&lt;br /&gt;
&lt;br /&gt;
Let’s look at a few examples!&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
&lt;br /&gt;
== 1. Method Name Conflict ==&lt;br /&gt;
&lt;br /&gt;
In the following example, we have the class Zap. This class includes the module Foo and the module Test. Both modules contain a method named bar.&lt;br /&gt;
   module Foo&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;hello&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
   module Test&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;goodbye&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end   &lt;br /&gt;
   class Zap&lt;br /&gt;
    include Foo&lt;br /&gt;
    include Test&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
If a call is made to Zap's bar method, the caller is unsure whether the result will be &amp;quot;hello&amp;quot; or &amp;quot;goodbye&amp;quot;.&lt;br /&gt;
   z = Zap.new&lt;br /&gt;
   puts z.bar&lt;br /&gt;
&lt;br /&gt;
The result of this call is:&lt;br /&gt;
&lt;br /&gt;
   goodbye&lt;br /&gt;
&lt;br /&gt;
This is because Ruby will first search the last module included, and continue in a descending order until it finds a method with that name. Since in this case, Test was the last module included, its method was the one invoked. The method that is invoked may not be the method that the caller expected to run. Therefore, precaution should be taken to eliminate ambiguity.&lt;br /&gt;
&lt;br /&gt;
== 2. Using Namespaces to Avoid Conflict ==&lt;br /&gt;
Using namespaces within the modules will make the method names unique and help disambiguate any conflicts. The namespace is created simply by prefixing the method name with the module name and a period (i.e., Module.method).&lt;br /&gt;
&lt;br /&gt;
Let's modify the previous example to include namespaces.&lt;br /&gt;
&lt;br /&gt;
  module Foo&lt;br /&gt;
     def Foo.bar #the method name is qualified&lt;br /&gt;
        &amp;quot;hello&amp;quot;&lt;br /&gt;
     end&lt;br /&gt;
  end&lt;br /&gt;
  module Test&lt;br /&gt;
     def Test.bar #the method name is qualified&lt;br /&gt;
        &amp;quot;goodbye&amp;quot;&lt;br /&gt;
     end&lt;br /&gt;
  end   &lt;br /&gt;
  class Zap&lt;br /&gt;
   include Foo&lt;br /&gt;
   include Test&lt;br /&gt;
&lt;br /&gt;
Zap class defines a method named bar, and makes a call to both bar methods in Foo and Test. However, if the programmer knew for sure that any call to the bar method should invoke only one of the modules, this could be handled here by only calling the module of choice. &lt;br /&gt;
   def bar &lt;br /&gt;
      puts Foo.bar&lt;br /&gt;
      puts Test.bar&lt;br /&gt;
   end&lt;br /&gt;
   z = Zap.new&lt;br /&gt;
   puts z.bar&lt;br /&gt;
&lt;br /&gt;
This will produce:&lt;br /&gt;
   Hello&lt;br /&gt;
   Goodbye&lt;br /&gt;
&lt;br /&gt;
== 3. Using Aliases to Avoid Conflict ==&lt;br /&gt;
An alternative to using namespaces is to use alias to disambiguate method names in different modules. Again, looking at the first example, we have modified it to show the use of aliases.&lt;br /&gt;
&lt;br /&gt;
  module Foo&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;hello&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
   module Test&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;goodbye&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
   &lt;br /&gt;
In the Zap class, we define two aliases, one for Foo's bar method and another for Test's bar method. The alias syntax is ''alias :new_name :old_name''. So, to disambiguate, we first include Foo, and give an alias to its bar method. Then include Test and give an alias to its bar method.&lt;br /&gt;
   class Zap&lt;br /&gt;
    include Foo&lt;br /&gt;
    alias :Foo_bar :bar&lt;br /&gt;
    include Test&lt;br /&gt;
    alias :Test_bar :bar&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
The caller then can make a call to the new method names defined by the aliases to choose exactly which call they want to make.&lt;br /&gt;
   z = Zap.new&lt;br /&gt;
   puts z.Foo_bar&lt;br /&gt;
   puts z.Test_bar&lt;br /&gt;
&lt;br /&gt;
The result of this call is:&lt;br /&gt;
   hello&lt;br /&gt;
   goodbye&lt;br /&gt;
&lt;br /&gt;
Note: A call to z.bar would react the same way as shown in example one, with the result being a call to the last module included.&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
&lt;br /&gt;
As illustrated in the examples, there are at least two ways to ensure that your class runs as expected even when using modules with method name conflicts.&lt;br /&gt;
&lt;br /&gt;
The two approaches are:&lt;br /&gt;
#using namespaces&lt;br /&gt;
#using aliases&lt;br /&gt;
&lt;br /&gt;
With namespaces, the class controls what module will be invoked. However, with aliases, the caller controls what will be invoked. These two approaches have their advantages and disadvantages. &lt;br /&gt;
&lt;br /&gt;
An advantage of using namespaces is that the logic that the programmer envisions is captured in the code. For example, the programmer may only be interested in Foo's bar method and not Test's bar method. This can be controlled by internally making the call to Foo.bar anytime the class's bar method is invoked. By the same token, this causes less flexibility, which is a disadvantage.&lt;br /&gt;
&lt;br /&gt;
When using aliases, the caller is more in control. The caller can leverage the fact that the class it is calling has access to the bar method of two different modules, thus providing more power and flexibility. However, the disadvantage of this is that the caller must know the internals of the class it is calling. It must know which aliased method calls what module, and also what that module's method does.&lt;br /&gt;
&lt;br /&gt;
In our opinion, using namespaces is the more efficient object-oriented (OO) design approach. Encapsulation is an important OO concept, and taxing the caller to research the internals of the code, while powerful, is inefficient.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
 &lt;br /&gt;
#[http://www.recentrambles.com/pragmatic/view/69 Modules, Mixins, and Inheritance]&lt;br /&gt;
#[http://www.rubyist.net/~slagell/ruby/modules.html Ruby User's Guide]&lt;br /&gt;
#[http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_modules.html Programming Ruby]&lt;br /&gt;
#[http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/164209 Class and Mixin with same name method problem]&lt;/div&gt;</summary>
		<author><name>Arjones3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5661</id>
		<title>CSC/ECE 517 Fall 2007/wiki1b 1 as</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5661"/>
		<updated>2007-10-13T03:26:56Z</updated>

		<summary type="html">&lt;p&gt;Arjones3: /* 1. Method Name Conflict */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background =&lt;br /&gt;
&lt;br /&gt;
Ruby does not implement true multiple inheritance, but provides Modules as a way to reuse chunks of codes in many classes. Modules, unlike classes in OO languages such as Java, cannot be instantiated or sub-classed. Modules are included in class definitions by using the ‘include’ method which will mix that module’s methods into the calling class. The module’s methods will then become instance methods. &lt;br /&gt;
&lt;br /&gt;
A class can include several modules within the class definition. However, a problem exists when a class includes multiple modules that contain a method of the same name. Since the class will have access to both of these methods, unexpected behavior may occur when a call is made to a method with an ambiguous name.&lt;br /&gt;
&lt;br /&gt;
Let’s look at a few examples!&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
&lt;br /&gt;
== 1. Method Name Conflict ==&lt;br /&gt;
&lt;br /&gt;
In the following example, we have the class Zap. This class includes the module Foo and the module Test. Both modules contain a method named bar.&lt;br /&gt;
   module Foo&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;hello&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
   module Test&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;goodbye&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end   &lt;br /&gt;
   class Zap&lt;br /&gt;
    include Foo&lt;br /&gt;
    include Test&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
If a call is made to Zap's bar method, the caller is unsure whether the result will be &amp;quot;hello&amp;quot; or &amp;quot;goodbye&amp;quot;.&lt;br /&gt;
   z = Zap.new&lt;br /&gt;
   puts z.bar&lt;br /&gt;
&lt;br /&gt;
The result of this call is:&lt;br /&gt;
&lt;br /&gt;
   goodbye&lt;br /&gt;
&lt;br /&gt;
This is because Ruby will first search the last module included, and continue in a descending order until it finds a method with that name. Since in this case, Test was the last module included, its method was the one invoked. The method that is invoked may not be the method that the caller expected to run. Therefore, precaution should be taken to eliminate ambiguity.&lt;br /&gt;
&lt;br /&gt;
== 2. Using Namespaces to Avoid Conflict ==&lt;br /&gt;
Using namespaces within the modules will make the method names unique and help disambiguate any conflicts. The namespace is created simply by prefixing the method name with the module name and a period (i.e., Module.method).&lt;br /&gt;
&lt;br /&gt;
Let's modify the previous example to include namespaces.&lt;br /&gt;
&lt;br /&gt;
  module Foo&lt;br /&gt;
     def Foo.bar #the method name is qualified&lt;br /&gt;
        &amp;quot;hello&amp;quot;&lt;br /&gt;
     end&lt;br /&gt;
  end&lt;br /&gt;
  module Test&lt;br /&gt;
     def Test.bar #the method name is qualified&lt;br /&gt;
        &amp;quot;goodbye&amp;quot;&lt;br /&gt;
     end&lt;br /&gt;
  end   &lt;br /&gt;
  class Zap&lt;br /&gt;
   include Foo&lt;br /&gt;
   include Test&lt;br /&gt;
&lt;br /&gt;
Zap class defines a method called bar, and makes a call to both bar methods in Foo and Test. If the programmer knew for sure that any call to the bar method should invoke only one of the modules, this could be handled here by only calling the module of choice.&lt;br /&gt;
   def bar &lt;br /&gt;
      puts Foo.bar&lt;br /&gt;
      puts Test.bar&lt;br /&gt;
   end&lt;br /&gt;
   z = Zap.new&lt;br /&gt;
   puts z.bar&lt;br /&gt;
&lt;br /&gt;
This will produce:&lt;br /&gt;
   Hello&lt;br /&gt;
   Goodbye&lt;br /&gt;
&lt;br /&gt;
== 3. Using Aliases to Avoid Conflict ==&lt;br /&gt;
An alternative to using namespaces is to use alias to disambiguate method names in different modules. Again, looking at the first example, we have modified it to show the use of aliases.&lt;br /&gt;
&lt;br /&gt;
  module Foo&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;hello&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
   module Test&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;goodbye&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
   &lt;br /&gt;
In the Zap class, we define two aliases, one for Foo's bar method and another for Test's bar method. The alias syntax is ''alias :new_name :old_name''. So, to disambiguate, we first include Foo, and give an alias to its bar method. Then include Test and give an alias to its bar method.&lt;br /&gt;
   class Zap&lt;br /&gt;
    include Foo&lt;br /&gt;
    alias :Foo_bar :bar&lt;br /&gt;
    include Test&lt;br /&gt;
    alias :Test_bar :bar&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
The caller then can make a call to the new method names defined by the aliases to choose exactly which call they want to make.&lt;br /&gt;
   z = Zap.new&lt;br /&gt;
   puts z.Foo_bar&lt;br /&gt;
   puts z.Test_bar&lt;br /&gt;
&lt;br /&gt;
The result of this call is:&lt;br /&gt;
   hello&lt;br /&gt;
   goodbye&lt;br /&gt;
&lt;br /&gt;
Note: A call to z.bar would react the same way as shown in example one, with the result being a call to the last module included.&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
&lt;br /&gt;
As illustrated in the examples, there are at least two ways to ensure that your class runs as expected even when using modules with method name conflicts.&lt;br /&gt;
&lt;br /&gt;
The two approaches are:&lt;br /&gt;
#using namespaces&lt;br /&gt;
#using aliases&lt;br /&gt;
&lt;br /&gt;
With namespaces, the class controls what module will be invoked. However, with aliases, the caller controls what will be invoked. These two approaches have their advantages and disadvantages. &lt;br /&gt;
&lt;br /&gt;
An advantage of using namespaces is that the logic that the programmer envisions is captured in the code. For example, the programmer may only be interested in Foo's bar method and not Test's bar method. This can be controlled by internally making the call to Foo.bar anytime the class's bar method is invoked. By the same token, this causes less flexibility, which is a disadvantage.&lt;br /&gt;
&lt;br /&gt;
When using aliases, the caller is more in control. The caller can leverage the fact that the class it is calling has access to the bar method of two different modules, thus providing more power and flexibility. However, the disadvantage of this is that the caller must know the internals of the class it is calling. It must know which aliased method calls what module, and also what that module's method does.&lt;br /&gt;
&lt;br /&gt;
In our opinion, using namespaces is the more efficient object-oriented (OO) design approach. Encapsulation is an important OO concept, and taxing the caller to research the internals of the code, while powerful, is inefficient.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
 &lt;br /&gt;
#[http://www.recentrambles.com/pragmatic/view/69 Modules, Mixins, and Inheritance]&lt;br /&gt;
#[http://www.rubyist.net/~slagell/ruby/modules.html Ruby User's Guide]&lt;br /&gt;
#[http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_modules.html Programming Ruby]&lt;br /&gt;
#[http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/164209 Class and Mixin with same name method problem]&lt;/div&gt;</summary>
		<author><name>Arjones3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5660</id>
		<title>CSC/ECE 517 Fall 2007/wiki1b 1 as</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5660"/>
		<updated>2007-10-13T03:25:50Z</updated>

		<summary type="html">&lt;p&gt;Arjones3: /* 1. Method Name Conflict */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background =&lt;br /&gt;
&lt;br /&gt;
Ruby does not implement true multiple inheritance, but provides Modules as a way to reuse chunks of codes in many classes. Modules, unlike classes in OO languages such as Java, cannot be instantiated or sub-classed. Modules are included in class definitions by using the ‘include’ method which will mix that module’s methods into the calling class. The module’s methods will then become instance methods. &lt;br /&gt;
&lt;br /&gt;
A class can include several modules within the class definition. However, a problem exists when a class includes multiple modules that contain a method of the same name. Since the class will have access to both of these methods, unexpected behavior may occur when a call is made to a method with an ambiguous name.&lt;br /&gt;
&lt;br /&gt;
Let’s look at a few examples!&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
&lt;br /&gt;
== 1. Method Name Conflict ==&lt;br /&gt;
&lt;br /&gt;
In the following example, we have the class Zap. This class includes the module Foo and the module Test. Both modules contain a method named bar.&lt;br /&gt;
   module Foo&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;hello&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
   module Test&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;goodbye&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end   &lt;br /&gt;
   class Zap&lt;br /&gt;
    include Foo&lt;br /&gt;
    include Test&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
If a call is made to Zap's bar method, the caller is unsure whether the result will be &amp;quot;hello&amp;quot; or &amp;quot;goodbye&amp;quot;.&lt;br /&gt;
   z = Zap.new&lt;br /&gt;
   puts z.bar&lt;br /&gt;
&lt;br /&gt;
The result of this call is:&lt;br /&gt;
&lt;br /&gt;
   goodbye&lt;br /&gt;
&lt;br /&gt;
This is because Ruby will first search the last module included, and continue in a descending order until it finds a method with that name. Since in this case, Test was the last module included, its method was the one invoked. The method that is invoked may not be the method that the caller expected to run. Therefore, precaution to be taken within the class to eliminate ambiguity.&lt;br /&gt;
&lt;br /&gt;
== 2. Using Namespaces to Avoid Conflict ==&lt;br /&gt;
Using namespaces within the modules will make the method names unique and help disambiguate any conflicts. The namespace is created simply by prefixing the method name with the module name and a period (i.e., Module.method).&lt;br /&gt;
&lt;br /&gt;
Let's modify the previous example to include namespaces.&lt;br /&gt;
&lt;br /&gt;
  module Foo&lt;br /&gt;
     def Foo.bar #the method name is qualified&lt;br /&gt;
        &amp;quot;hello&amp;quot;&lt;br /&gt;
     end&lt;br /&gt;
  end&lt;br /&gt;
  module Test&lt;br /&gt;
     def Test.bar #the method name is qualified&lt;br /&gt;
        &amp;quot;goodbye&amp;quot;&lt;br /&gt;
     end&lt;br /&gt;
  end   &lt;br /&gt;
  class Zap&lt;br /&gt;
   include Foo&lt;br /&gt;
   include Test&lt;br /&gt;
&lt;br /&gt;
Zap class defines a method called bar, and makes a call to both bar methods in Foo and Test. If the programmer knew for sure that any call to the bar method should invoke only one of the modules, this could be handled here by only calling the module of choice.&lt;br /&gt;
   def bar &lt;br /&gt;
      puts Foo.bar&lt;br /&gt;
      puts Test.bar&lt;br /&gt;
   end&lt;br /&gt;
   z = Zap.new&lt;br /&gt;
   puts z.bar&lt;br /&gt;
&lt;br /&gt;
This will produce:&lt;br /&gt;
   Hello&lt;br /&gt;
   Goodbye&lt;br /&gt;
&lt;br /&gt;
== 3. Using Aliases to Avoid Conflict ==&lt;br /&gt;
An alternative to using namespaces is to use alias to disambiguate method names in different modules. Again, looking at the first example, we have modified it to show the use of aliases.&lt;br /&gt;
&lt;br /&gt;
  module Foo&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;hello&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
   module Test&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;goodbye&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
   &lt;br /&gt;
In the Zap class, we define two aliases, one for Foo's bar method and another for Test's bar method. The alias syntax is ''alias :new_name :old_name''. So, to disambiguate, we first include Foo, and give an alias to its bar method. Then include Test and give an alias to its bar method.&lt;br /&gt;
   class Zap&lt;br /&gt;
    include Foo&lt;br /&gt;
    alias :Foo_bar :bar&lt;br /&gt;
    include Test&lt;br /&gt;
    alias :Test_bar :bar&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
The caller then can make a call to the new method names defined by the aliases to choose exactly which call they want to make.&lt;br /&gt;
   z = Zap.new&lt;br /&gt;
   puts z.Foo_bar&lt;br /&gt;
   puts z.Test_bar&lt;br /&gt;
&lt;br /&gt;
The result of this call is:&lt;br /&gt;
   hello&lt;br /&gt;
   goodbye&lt;br /&gt;
&lt;br /&gt;
Note: A call to z.bar would react the same way as shown in example one, with the result being a call to the last module included.&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
&lt;br /&gt;
As illustrated in the examples, there are at least two ways to ensure that your class runs as expected even when using modules with method name conflicts.&lt;br /&gt;
&lt;br /&gt;
The two approaches are:&lt;br /&gt;
#using namespaces&lt;br /&gt;
#using aliases&lt;br /&gt;
&lt;br /&gt;
With namespaces, the class controls what module will be invoked. However, with aliases, the caller controls what will be invoked. These two approaches have their advantages and disadvantages. &lt;br /&gt;
&lt;br /&gt;
An advantage of using namespaces is that the logic that the programmer envisions is captured in the code. For example, the programmer may only be interested in Foo's bar method and not Test's bar method. This can be controlled by internally making the call to Foo.bar anytime the class's bar method is invoked. By the same token, this causes less flexibility, which is a disadvantage.&lt;br /&gt;
&lt;br /&gt;
When using aliases, the caller is more in control. The caller can leverage the fact that the class it is calling has access to the bar method of two different modules, thus providing more power and flexibility. However, the disadvantage of this is that the caller must know the internals of the class it is calling. It must know which aliased method calls what module, and also what that module's method does.&lt;br /&gt;
&lt;br /&gt;
In our opinion, using namespaces is the more efficient object-oriented (OO) design approach. Encapsulation is an important OO concept, and taxing the caller to research the internals of the code, while powerful, is inefficient.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
 &lt;br /&gt;
#[http://www.recentrambles.com/pragmatic/view/69 Modules, Mixins, and Inheritance]&lt;br /&gt;
#[http://www.rubyist.net/~slagell/ruby/modules.html Ruby User's Guide]&lt;br /&gt;
#[http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_modules.html Programming Ruby]&lt;br /&gt;
#[http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/164209 Class and Mixin with same name method problem]&lt;/div&gt;</summary>
		<author><name>Arjones3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5659</id>
		<title>CSC/ECE 517 Fall 2007/wiki1b 1 as</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5659"/>
		<updated>2007-10-13T03:24:12Z</updated>

		<summary type="html">&lt;p&gt;Arjones3: /* Background */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background =&lt;br /&gt;
&lt;br /&gt;
Ruby does not implement true multiple inheritance, but provides Modules as a way to reuse chunks of codes in many classes. Modules, unlike classes in OO languages such as Java, cannot be instantiated or sub-classed. Modules are included in class definitions by using the ‘include’ method which will mix that module’s methods into the calling class. The module’s methods will then become instance methods. &lt;br /&gt;
&lt;br /&gt;
A class can include several modules within the class definition. However, a problem exists when a class includes multiple modules that contain a method of the same name. Since the class will have access to both of these methods, unexpected behavior may occur when a call is made to a method with an ambiguous name.&lt;br /&gt;
&lt;br /&gt;
Let’s look at a few examples!&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
&lt;br /&gt;
== 1. Method Name Conflict ==&lt;br /&gt;
&lt;br /&gt;
In the following example, we have the class Zap. This class includes the module Foo and the module Test. Both modules contain a method named bar.&lt;br /&gt;
   module Foo&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;hello&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
   module Test&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;goodbye&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end   &lt;br /&gt;
   class Zap&lt;br /&gt;
    include Foo&lt;br /&gt;
    include Test&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
If a call is made to Zap's bar method, the caller is unsure whether the result will be &amp;quot;hello&amp;quot; or &amp;quot;goodbye&amp;quot;.&lt;br /&gt;
   z = Zap.new&lt;br /&gt;
   puts z.bar&lt;br /&gt;
&lt;br /&gt;
The result of this call is:&lt;br /&gt;
&lt;br /&gt;
   goodbye&lt;br /&gt;
&lt;br /&gt;
This is because Ruby will first search the last module included, and continue in a descending order. The method that is invoked may not be the method that the caller expected to run. Therefore, precaution to be taken within the class to eliminate ambiguity.&lt;br /&gt;
&lt;br /&gt;
== 2. Using Namespaces to Avoid Conflict ==&lt;br /&gt;
Using namespaces within the modules will make the method names unique and help disambiguate any conflicts. The namespace is created simply by prefixing the method name with the module name and a period (i.e., Module.method).&lt;br /&gt;
&lt;br /&gt;
Let's modify the previous example to include namespaces.&lt;br /&gt;
&lt;br /&gt;
  module Foo&lt;br /&gt;
     def Foo.bar #the method name is qualified&lt;br /&gt;
        &amp;quot;hello&amp;quot;&lt;br /&gt;
     end&lt;br /&gt;
  end&lt;br /&gt;
  module Test&lt;br /&gt;
     def Test.bar #the method name is qualified&lt;br /&gt;
        &amp;quot;goodbye&amp;quot;&lt;br /&gt;
     end&lt;br /&gt;
  end   &lt;br /&gt;
  class Zap&lt;br /&gt;
   include Foo&lt;br /&gt;
   include Test&lt;br /&gt;
&lt;br /&gt;
Zap class defines a method called bar, and makes a call to both bar methods in Foo and Test. If the programmer knew for sure that any call to the bar method should invoke only one of the modules, this could be handled here by only calling the module of choice.&lt;br /&gt;
   def bar &lt;br /&gt;
      puts Foo.bar&lt;br /&gt;
      puts Test.bar&lt;br /&gt;
   end&lt;br /&gt;
   z = Zap.new&lt;br /&gt;
   puts z.bar&lt;br /&gt;
&lt;br /&gt;
This will produce:&lt;br /&gt;
   Hello&lt;br /&gt;
   Goodbye&lt;br /&gt;
&lt;br /&gt;
== 3. Using Aliases to Avoid Conflict ==&lt;br /&gt;
An alternative to using namespaces is to use alias to disambiguate method names in different modules. Again, looking at the first example, we have modified it to show the use of aliases.&lt;br /&gt;
&lt;br /&gt;
  module Foo&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;hello&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
   module Test&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;goodbye&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
   &lt;br /&gt;
In the Zap class, we define two aliases, one for Foo's bar method and another for Test's bar method. The alias syntax is ''alias :new_name :old_name''. So, to disambiguate, we first include Foo, and give an alias to its bar method. Then include Test and give an alias to its bar method.&lt;br /&gt;
   class Zap&lt;br /&gt;
    include Foo&lt;br /&gt;
    alias :Foo_bar :bar&lt;br /&gt;
    include Test&lt;br /&gt;
    alias :Test_bar :bar&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
The caller then can make a call to the new method names defined by the aliases to choose exactly which call they want to make.&lt;br /&gt;
   z = Zap.new&lt;br /&gt;
   puts z.Foo_bar&lt;br /&gt;
   puts z.Test_bar&lt;br /&gt;
&lt;br /&gt;
The result of this call is:&lt;br /&gt;
   hello&lt;br /&gt;
   goodbye&lt;br /&gt;
&lt;br /&gt;
Note: A call to z.bar would react the same way as shown in example one, with the result being a call to the last module included.&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
&lt;br /&gt;
As illustrated in the examples, there are at least two ways to ensure that your class runs as expected even when using modules with method name conflicts.&lt;br /&gt;
&lt;br /&gt;
The two approaches are:&lt;br /&gt;
#using namespaces&lt;br /&gt;
#using aliases&lt;br /&gt;
&lt;br /&gt;
With namespaces, the class controls what module will be invoked. However, with aliases, the caller controls what will be invoked. These two approaches have their advantages and disadvantages. &lt;br /&gt;
&lt;br /&gt;
An advantage of using namespaces is that the logic that the programmer envisions is captured in the code. For example, the programmer may only be interested in Foo's bar method and not Test's bar method. This can be controlled by internally making the call to Foo.bar anytime the class's bar method is invoked. By the same token, this causes less flexibility, which is a disadvantage.&lt;br /&gt;
&lt;br /&gt;
When using aliases, the caller is more in control. The caller can leverage the fact that the class it is calling has access to the bar method of two different modules, thus providing more power and flexibility. However, the disadvantage of this is that the caller must know the internals of the class it is calling. It must know which aliased method calls what module, and also what that module's method does.&lt;br /&gt;
&lt;br /&gt;
In our opinion, using namespaces is the more efficient object-oriented (OO) design approach. Encapsulation is an important OO concept, and taxing the caller to research the internals of the code, while powerful, is inefficient.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
 &lt;br /&gt;
#[http://www.recentrambles.com/pragmatic/view/69 Modules, Mixins, and Inheritance]&lt;br /&gt;
#[http://www.rubyist.net/~slagell/ruby/modules.html Ruby User's Guide]&lt;br /&gt;
#[http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_modules.html Programming Ruby]&lt;br /&gt;
#[http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/164209 Class and Mixin with same name method problem]&lt;/div&gt;</summary>
		<author><name>Arjones3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5658</id>
		<title>CSC/ECE 517 Fall 2007/wiki1b 1 as</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5658"/>
		<updated>2007-10-13T03:22:57Z</updated>

		<summary type="html">&lt;p&gt;Arjones3: /* Background */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background =&lt;br /&gt;
&lt;br /&gt;
Ruby does not implement true multiple inheritance, but provides Modules as a way to reuse chunks of codes in many classes. Modules, unlike classes in OO languages such as Java, cannot be instantiated or sub-classed. Modules are included in class definitions by using the ‘include’ method which will mix that module’s methods into the calling class. The module’s methods will then become instance methods. &lt;br /&gt;
&lt;br /&gt;
A class can include several modules within the class definition. However, a problem exists when a class includes multiple modules that contain a method of the same name. Since the class will have access to both of these methods, unexpected behavior may occur when the names of the methods conflict.&lt;br /&gt;
&lt;br /&gt;
Let’s look at a few examples!&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
&lt;br /&gt;
== 1. Method Name Conflict ==&lt;br /&gt;
&lt;br /&gt;
In the following example, we have the class Zap. This class includes the module Foo and the module Test. Both modules contain a method named bar.&lt;br /&gt;
   module Foo&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;hello&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
   module Test&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;goodbye&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end   &lt;br /&gt;
   class Zap&lt;br /&gt;
    include Foo&lt;br /&gt;
    include Test&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
If a call is made to Zap's bar method, the caller is unsure whether the result will be &amp;quot;hello&amp;quot; or &amp;quot;goodbye&amp;quot;.&lt;br /&gt;
   z = Zap.new&lt;br /&gt;
   puts z.bar&lt;br /&gt;
&lt;br /&gt;
The result of this call is:&lt;br /&gt;
&lt;br /&gt;
   goodbye&lt;br /&gt;
&lt;br /&gt;
This is because Ruby will first search the last module included, and continue in a descending order. The method that is invoked may not be the method that the caller expected to run. Therefore, precaution to be taken within the class to eliminate ambiguity.&lt;br /&gt;
&lt;br /&gt;
== 2. Using Namespaces to Avoid Conflict ==&lt;br /&gt;
Using namespaces within the modules will make the method names unique and help disambiguate any conflicts. The namespace is created simply by prefixing the method name with the module name and a period (i.e., Module.method).&lt;br /&gt;
&lt;br /&gt;
Let's modify the previous example to include namespaces.&lt;br /&gt;
&lt;br /&gt;
  module Foo&lt;br /&gt;
     def Foo.bar #the method name is qualified&lt;br /&gt;
        &amp;quot;hello&amp;quot;&lt;br /&gt;
     end&lt;br /&gt;
  end&lt;br /&gt;
  module Test&lt;br /&gt;
     def Test.bar #the method name is qualified&lt;br /&gt;
        &amp;quot;goodbye&amp;quot;&lt;br /&gt;
     end&lt;br /&gt;
  end   &lt;br /&gt;
  class Zap&lt;br /&gt;
   include Foo&lt;br /&gt;
   include Test&lt;br /&gt;
&lt;br /&gt;
Zap class defines a method called bar, and makes a call to both bar methods in Foo and Test. If the programmer knew for sure that any call to the bar method should invoke only one of the modules, this could be handled here by only calling the module of choice.&lt;br /&gt;
   def bar &lt;br /&gt;
      puts Foo.bar&lt;br /&gt;
      puts Test.bar&lt;br /&gt;
   end&lt;br /&gt;
   z = Zap.new&lt;br /&gt;
   puts z.bar&lt;br /&gt;
&lt;br /&gt;
This will produce:&lt;br /&gt;
   Hello&lt;br /&gt;
   Goodbye&lt;br /&gt;
&lt;br /&gt;
== 3. Using Aliases to Avoid Conflict ==&lt;br /&gt;
An alternative to using namespaces is to use alias to disambiguate method names in different modules. Again, looking at the first example, we have modified it to show the use of aliases.&lt;br /&gt;
&lt;br /&gt;
  module Foo&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;hello&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
   module Test&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;goodbye&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
   &lt;br /&gt;
In the Zap class, we define two aliases, one for Foo's bar method and another for Test's bar method. The alias syntax is ''alias :new_name :old_name''. So, to disambiguate, we first include Foo, and give an alias to its bar method. Then include Test and give an alias to its bar method.&lt;br /&gt;
   class Zap&lt;br /&gt;
    include Foo&lt;br /&gt;
    alias :Foo_bar :bar&lt;br /&gt;
    include Test&lt;br /&gt;
    alias :Test_bar :bar&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
The caller then can make a call to the new method names defined by the aliases to choose exactly which call they want to make.&lt;br /&gt;
   z = Zap.new&lt;br /&gt;
   puts z.Foo_bar&lt;br /&gt;
   puts z.Test_bar&lt;br /&gt;
&lt;br /&gt;
The result of this call is:&lt;br /&gt;
   hello&lt;br /&gt;
   goodbye&lt;br /&gt;
&lt;br /&gt;
Note: A call to z.bar would react the same way as shown in example one, with the result being a call to the last module included.&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
&lt;br /&gt;
As illustrated in the examples, there are at least two ways to ensure that your class runs as expected even when using modules with method name conflicts.&lt;br /&gt;
&lt;br /&gt;
The two approaches are:&lt;br /&gt;
#using namespaces&lt;br /&gt;
#using aliases&lt;br /&gt;
&lt;br /&gt;
With namespaces, the class controls what module will be invoked. However, with aliases, the caller controls what will be invoked. These two approaches have their advantages and disadvantages. &lt;br /&gt;
&lt;br /&gt;
An advantage of using namespaces is that the logic that the programmer envisions is captured in the code. For example, the programmer may only be interested in Foo's bar method and not Test's bar method. This can be controlled by internally making the call to Foo.bar anytime the class's bar method is invoked. By the same token, this causes less flexibility, which is a disadvantage.&lt;br /&gt;
&lt;br /&gt;
When using aliases, the caller is more in control. The caller can leverage the fact that the class it is calling has access to the bar method of two different modules, thus providing more power and flexibility. However, the disadvantage of this is that the caller must know the internals of the class it is calling. It must know which aliased method calls what module, and also what that module's method does.&lt;br /&gt;
&lt;br /&gt;
In our opinion, using namespaces is the more efficient object-oriented (OO) design approach. Encapsulation is an important OO concept, and taxing the caller to research the internals of the code, while powerful, is inefficient.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
 &lt;br /&gt;
#[http://www.recentrambles.com/pragmatic/view/69 Modules, Mixins, and Inheritance]&lt;br /&gt;
#[http://www.rubyist.net/~slagell/ruby/modules.html Ruby User's Guide]&lt;br /&gt;
#[http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_modules.html Programming Ruby]&lt;br /&gt;
#[http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/164209 Class and Mixin with same name method problem]&lt;/div&gt;</summary>
		<author><name>Arjones3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5451</id>
		<title>CSC/ECE 517 Fall 2007/wiki1b 1 as</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5451"/>
		<updated>2007-10-10T20:47:50Z</updated>

		<summary type="html">&lt;p&gt;Arjones3: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background =&lt;br /&gt;
&lt;br /&gt;
Ruby does not implement true multiple inheritance, but provides Modules as a way to reuse chunks of codes in many classes. Modules, unlike like classes in OO languages such as Java, cannot be instantiated or sub-classed. Modules are included in class definitions by using the ‘include’ method which will mix that module’s methods into the calling class. The module’s methods will then become instance methods. &lt;br /&gt;
&lt;br /&gt;
A class can include several modules within the class definition. However, a problem exists when a class includes multiple modules that contain a method of the same name. Since the class will have access to both of these methods, unexpected behavior may occur when the names of the methods conflict.&lt;br /&gt;
&lt;br /&gt;
Let’s look at a few examples!&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
&lt;br /&gt;
== 1. Method Name Conflict ==&lt;br /&gt;
&lt;br /&gt;
In the following example, we have the class Zap. This class includes the module Foo and the module Test. Both modules contain a method named bar.&lt;br /&gt;
   module Foo&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;hello&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
   module Test&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;goodbye&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end   &lt;br /&gt;
   class Zap&lt;br /&gt;
    include Foo&lt;br /&gt;
    include Test&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
If a call is made to Zap's bar method, the caller is unsure whether the result will be &amp;quot;hello&amp;quot; or &amp;quot;goodbye&amp;quot;.&lt;br /&gt;
   z = Zap.new&lt;br /&gt;
   puts z.bar&lt;br /&gt;
&lt;br /&gt;
The result of this call is:&lt;br /&gt;
&lt;br /&gt;
   goodbye&lt;br /&gt;
&lt;br /&gt;
This is because Ruby will first search the last module included, and continue in a descending order. The method that is invoked may not be the method that the caller expected to run. Therefore, precaution to be taken within the class to eliminate ambiguity.&lt;br /&gt;
&lt;br /&gt;
== 2. Using Namespaces to Avoid Conflict ==&lt;br /&gt;
Using namespaces within the modules will make the method names unique and help disambiguate any conflicts. The namespace is created simply by prefixing the method name with the module name and a period (i.e., Module.method).&lt;br /&gt;
&lt;br /&gt;
Let's modify the previous example to include namespaces.&lt;br /&gt;
&lt;br /&gt;
  module Foo&lt;br /&gt;
     def Foo.bar #the method name is qualified&lt;br /&gt;
        &amp;quot;hello&amp;quot;&lt;br /&gt;
     end&lt;br /&gt;
  end&lt;br /&gt;
  module Test&lt;br /&gt;
     def Test.bar #the method name is qualified&lt;br /&gt;
        &amp;quot;goodbye&amp;quot;&lt;br /&gt;
     end&lt;br /&gt;
  end   &lt;br /&gt;
  class Zap&lt;br /&gt;
   include Foo&lt;br /&gt;
   include Test&lt;br /&gt;
&lt;br /&gt;
Zap class defines a method called bar, and makes a call to both bar methods in Foo and Test. If the programmer knew for sure that any call to the bar method should invoke only one of the modules, this could be handled here by only calling the module of choice.&lt;br /&gt;
   def bar &lt;br /&gt;
      puts Foo.bar&lt;br /&gt;
      puts Test.bar&lt;br /&gt;
   end&lt;br /&gt;
   z = Zap.new&lt;br /&gt;
   puts z.bar&lt;br /&gt;
&lt;br /&gt;
This will produce:&lt;br /&gt;
   Hello&lt;br /&gt;
   Goodbye&lt;br /&gt;
&lt;br /&gt;
== 3. Using Aliases to Avoid Conflict ==&lt;br /&gt;
An alternative to using namespaces is to use alias to disambiguate method names in different modules. Again, looking at the first example, we have modified it to show the use of aliases.&lt;br /&gt;
&lt;br /&gt;
  module Foo&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;hello&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
   module Test&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;goodbye&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
   &lt;br /&gt;
In the Zap class, we define two aliases, one for Foo's bar method and another for Test's bar method. The alias syntax is ''alias :new_name :old_name''. So, to disambiguate, we first include Foo, and give an alias to its bar method. Then include Test and give an alias to its bar method.&lt;br /&gt;
   class Zap&lt;br /&gt;
    include Foo&lt;br /&gt;
    alias :Foo_bar :bar&lt;br /&gt;
    include Test&lt;br /&gt;
    alias :Test_bar :bar&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
The caller then can make a call to the new method names defined by the aliases to choose exactly which call they want to make.&lt;br /&gt;
   z = Zap.new&lt;br /&gt;
   puts z.Foo_bar&lt;br /&gt;
   puts z.Test_bar&lt;br /&gt;
&lt;br /&gt;
The result of this call is:&lt;br /&gt;
   hello&lt;br /&gt;
   goodbye&lt;br /&gt;
&lt;br /&gt;
Note: A call to z.bar would react the same way as shown in example one, with the result being a call to the last module included.&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
&lt;br /&gt;
As illustrated in the examples, there are at least two ways to ensure that your class runs as expected even when using modules with method name conflicts.&lt;br /&gt;
&lt;br /&gt;
The two approaches are:&lt;br /&gt;
#using namespaces&lt;br /&gt;
#using aliases&lt;br /&gt;
&lt;br /&gt;
With namespaces, the class controls what module will be invoked. However, with aliases, the caller controls what will be invoked. These two approaches have their advantages and disadvantages. &lt;br /&gt;
&lt;br /&gt;
An advantage of using namespaces is that the logic that the programmer envisions is captured in the code. For example, the programmer may only be interested in Foo's bar method and not Test's bar method. This can be controlled by internally making the call to Foo.bar anytime the class's bar method is invoked. By the same token, this causes less flexibility, which is a disadvantage.&lt;br /&gt;
&lt;br /&gt;
When using aliases, the caller is more in control. The caller can leverage the fact that the class it is calling has access to the bar method of two different modules, thus providing more power and flexibility. However, the disadvantage of this is that the caller must know the internals of the class it is calling. It must know which aliased method calls what module, and also what that module's method does.&lt;br /&gt;
&lt;br /&gt;
In our opinion, using namespaces is the more efficient object-oriented (OO) design approach. Encapsulation is an important OO concept, and taxing the caller to research the internals of the code, while powerful, is inefficient.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
 &lt;br /&gt;
#[http://www.recentrambles.com/pragmatic/view/69 Modules, Mixins, and Inheritance]&lt;br /&gt;
#[http://www.rubyist.net/~slagell/ruby/modules.html Ruby User's Guide]&lt;br /&gt;
#[http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_modules.html Programming Ruby]&lt;br /&gt;
#[http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/164209 Class and Mixin with same name method problem]&lt;/div&gt;</summary>
		<author><name>Arjones3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5450</id>
		<title>CSC/ECE 517 Fall 2007/wiki1b 1 as</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5450"/>
		<updated>2007-10-10T20:47:07Z</updated>

		<summary type="html">&lt;p&gt;Arjones3: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background =&lt;br /&gt;
&lt;br /&gt;
Ruby does not implement true multiple inheritance, but provides Modules as a way to reuse chunks of codes in many classes. Modules, unlike like classes in OO languages such as Java, cannot be instantiated or sub-classed. Modules are included in class definitions by using the ‘include’ method which will mix that module’s methods into the calling class. The module’s methods will then become instance methods. &lt;br /&gt;
&lt;br /&gt;
A class can include several modules within the class definition. However, a problem exists when a class includes multiple modules that contain a method of the same name. Since the class will have access to both of these methods, unexpected behavior may occur when the names of the methods conflict.&lt;br /&gt;
&lt;br /&gt;
Let’s look at a few examples!&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
&lt;br /&gt;
== 1. Method Name Conflict ==&lt;br /&gt;
&lt;br /&gt;
In the following example, we have the class Zap. This class includes the module Foo and the module Test. Both modules contain a method named bar.&lt;br /&gt;
   module Foo&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;hello&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
   module Test&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;goodbye&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end   &lt;br /&gt;
   class Zap&lt;br /&gt;
    include Foo&lt;br /&gt;
    include Test&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
If a call is made to Zap's bar method, the caller is unsure whether the result will be &amp;quot;hello&amp;quot; or &amp;quot;goodbye&amp;quot;.&lt;br /&gt;
   z = Zap.new&lt;br /&gt;
   puts z.bar&lt;br /&gt;
&lt;br /&gt;
The result of this call is:&lt;br /&gt;
&lt;br /&gt;
   goodbye&lt;br /&gt;
&lt;br /&gt;
This is because Ruby will first search the last module included, and continue in a descending order. The method that is invoked may not be the method that the caller expected to run. Therefore, precaution to be taken within the class to eliminate ambiguity.&lt;br /&gt;
&lt;br /&gt;
== 2. Using Namespaces to Avoid Conflict ==&lt;br /&gt;
Using namespaces within the modules will make the method names unique and help disambiguate any conflicts. The namespace is created simply by prefixing the method name with the module name and a period (i.e., Module.method).&lt;br /&gt;
&lt;br /&gt;
Let's modify the previous example to include namespaces.&lt;br /&gt;
&lt;br /&gt;
  module Foo&lt;br /&gt;
     def Foo.bar #the method name is qualified&lt;br /&gt;
        &amp;quot;hello&amp;quot;&lt;br /&gt;
     end&lt;br /&gt;
  end&lt;br /&gt;
  module Test&lt;br /&gt;
     def Test.bar #the method name is qualified&lt;br /&gt;
        &amp;quot;goodbye&amp;quot;&lt;br /&gt;
     end&lt;br /&gt;
  end   &lt;br /&gt;
  class Zap&lt;br /&gt;
   include Foo&lt;br /&gt;
   include Test&lt;br /&gt;
&lt;br /&gt;
Zap class defines a method called bar, and makes a call to both bar methods in Foo and Test. If the programmer knew for sure that any call to the bar method should invoke only one of the modules, this could be handled here by only calling the module of choice.&lt;br /&gt;
   def bar &lt;br /&gt;
      puts Foo.bar&lt;br /&gt;
      puts Test.bar&lt;br /&gt;
   end&lt;br /&gt;
   z = Zap.new&lt;br /&gt;
   puts z.bar&lt;br /&gt;
&lt;br /&gt;
This will produce:&lt;br /&gt;
   Hello&lt;br /&gt;
   Goodbye&lt;br /&gt;
&lt;br /&gt;
== 3. Using Aliases to Avoid Conflict ==&lt;br /&gt;
An alternative to using namespaces is to use alias to disambiguate method names in different modules. Again, looking at the first example, we have modified it to show the use of aliases.&lt;br /&gt;
&lt;br /&gt;
  module Foo&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;hello&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
   module Test&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;goodbye&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
   &lt;br /&gt;
In the Zap class, we define two aliases, one for Foo's bar method and another for Test's bar method. The alias syntax is ''alias :new_name :old_name''. So, to disambiguate, we first include Foo, and give an alias to its bar method. Then include Test and give an alias to its bar method.&lt;br /&gt;
   class Zap&lt;br /&gt;
    include Foo&lt;br /&gt;
    alias :Foo_bar :bar&lt;br /&gt;
    include Test&lt;br /&gt;
    alias :Test_bar :bar&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
The caller then can make a call to the new method names defined by the aliases to choose exactly which call they want to make.&lt;br /&gt;
   z = Zap.new&lt;br /&gt;
   puts z.Foo_bar&lt;br /&gt;
   puts z.Test_bar&lt;br /&gt;
&lt;br /&gt;
The result of this call is:&lt;br /&gt;
   hello&lt;br /&gt;
   goodbye&lt;br /&gt;
&lt;br /&gt;
Note: A call to z.bar would react the same way as shown in example one, with the result being a call to the last module included.&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
&lt;br /&gt;
As illustrated in the examples, there are at least two ways to ensure that your class runs as expected even when using modules with method name conflicts.&lt;br /&gt;
&lt;br /&gt;
The two approaches are:&lt;br /&gt;
#using namespaces&lt;br /&gt;
#using an alias&lt;br /&gt;
&lt;br /&gt;
With namespaces, the class controls what module will be invoked. However, with aliases, the caller controls what will be invoked. These two approaches have their advantages and disadvantages. &lt;br /&gt;
&lt;br /&gt;
An advantage of using namespaces is that the logic that the programmer envisions is captured in the code. For example, the programmer may only be interested in Foo's bar method and not Test's bar method. This can be controlled by internally making the call to Foo.bar anytime the class's bar method is invoked. By the same token, this causes less flexibility, which is a disadvantage.&lt;br /&gt;
&lt;br /&gt;
When using aliases, the caller is more in control. The caller can leverage the fact that the class it is calling has access to the bar method of two different modules, thus providing more power and flexibility. However, the disadvantage of this is that the caller must know the internals of the class it is calling. It must know which aliased method calls what module, and also what that module's method does.&lt;br /&gt;
&lt;br /&gt;
In our opinion, using namespaces is the more efficient object-oriented (OO) design approach. Encapsulation is an important OO concept, and taxing the caller to research the internals of the code, while powerful, is inefficient.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
 &lt;br /&gt;
#[http://www.recentrambles.com/pragmatic/view/69 Modules, Mixins, and Inheritance]&lt;br /&gt;
#[http://www.rubyist.net/~slagell/ruby/modules.html Ruby User's Guide]&lt;br /&gt;
#[http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_modules.html Programming Ruby]&lt;br /&gt;
#[http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/164209 Class and Mixin with same name method problem]&lt;/div&gt;</summary>
		<author><name>Arjones3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5449</id>
		<title>CSC/ECE 517 Fall 2007/wiki1b 1 as</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5449"/>
		<updated>2007-10-10T20:45:43Z</updated>

		<summary type="html">&lt;p&gt;Arjones3: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background =&lt;br /&gt;
&lt;br /&gt;
Ruby does not implement true multiple inheritance, but provides Modules as a way to reuse chunks of codes in many classes. Modules, unlike like classes in OO languages such as Java, cannot be instantiated or sub-classed. Modules are included in class definitions by using the ‘include’ method which will mix that module’s methods into the calling class. The module’s methods will then become instance methods. &lt;br /&gt;
&lt;br /&gt;
A class can include several modules within the class definition. However, a problem exists when a class includes multiple modules that contain a method of the same name. Since the class will have access to both of these methods, unexpected behavior may occur when the names of the methods conflict.&lt;br /&gt;
&lt;br /&gt;
Let’s look at a few examples!&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
&lt;br /&gt;
== 1. Method Name Conflict ==&lt;br /&gt;
&lt;br /&gt;
In the following example, we have the class Zap. This class includes the module Foo and the module Test. Both modules contain a method named bar.&lt;br /&gt;
   module Foo&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;hello&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
   module Test&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;goodbye&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end   &lt;br /&gt;
   class Zap&lt;br /&gt;
    include Foo&lt;br /&gt;
    include Test&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
If a call is made to Zap's bar method, the caller is unsure whether the result will be &amp;quot;hello&amp;quot; or &amp;quot;goodbye&amp;quot;.&lt;br /&gt;
   z = Zap.new&lt;br /&gt;
   puts z.bar&lt;br /&gt;
&lt;br /&gt;
The result of this call is:&lt;br /&gt;
&lt;br /&gt;
   goodbye&lt;br /&gt;
&lt;br /&gt;
This is because Ruby will first search the last module included, and continue in a descending order. The method that is invoked may not be the method that the caller expected to run. Therefore, precaution to be taken within the class to eliminate ambiguity.&lt;br /&gt;
&lt;br /&gt;
== 2. Using Namespaces to Avoid Conflict ==&lt;br /&gt;
Using namespaces within the modules will make the method names unique and help disambiguate any conflicts. The namespace is created simply by prefixing the method name with the module name and a period (i.e., Module.method).&lt;br /&gt;
&lt;br /&gt;
Let's modify the previous example to include namespaces.&lt;br /&gt;
&lt;br /&gt;
  module Foo&lt;br /&gt;
     def Foo.bar #the method name is qualified&lt;br /&gt;
        &amp;quot;hello&amp;quot;&lt;br /&gt;
     end&lt;br /&gt;
  end&lt;br /&gt;
  module Test&lt;br /&gt;
     def Test.bar #the method name is qualified&lt;br /&gt;
        &amp;quot;goodbye&amp;quot;&lt;br /&gt;
     end&lt;br /&gt;
  end   &lt;br /&gt;
  class Zap&lt;br /&gt;
   include Foo&lt;br /&gt;
   include Test&lt;br /&gt;
&lt;br /&gt;
Zap class defines a method called bar, and makes a call to both bar methods in Foo and Test. If the programmer knew for sure that any call to the bar method should invoke only one of the modules, this could be handled here by only calling the module of choice.&lt;br /&gt;
   def bar &lt;br /&gt;
      puts Foo.bar&lt;br /&gt;
      puts Test.bar&lt;br /&gt;
   end&lt;br /&gt;
   z = Zap.new&lt;br /&gt;
   puts z.bar&lt;br /&gt;
&lt;br /&gt;
This will produce:&lt;br /&gt;
   Hello&lt;br /&gt;
   Goodbye&lt;br /&gt;
&lt;br /&gt;
== 3. Using Aliases to Avoid Conflict ==&lt;br /&gt;
An alternative to using namespaces is to use alias to disambiguate method names in different modules. Again, looking at the first example, we have modified it to show the use of aliases.&lt;br /&gt;
&lt;br /&gt;
  module Foo&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;hello&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
   module Test&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;goodbye&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
   &lt;br /&gt;
In the Zap class, we define two aliases, one for Foo's bar method and another for Test's bar method. The alias syntax is ''alias :new_name :old_name''. So, to disambiguate, we first include Foo, and give an alias to its bar method. Then include Test and give an alias to its bar method.&lt;br /&gt;
   class Zap&lt;br /&gt;
    include Foo&lt;br /&gt;
    alias :Foo_bar :bar&lt;br /&gt;
    include Test&lt;br /&gt;
    alias :Test_bar :bar&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
The caller then can make a call to the new method names defined by the aliases to choose exactly which call they want to make.&lt;br /&gt;
   z = Zap.new&lt;br /&gt;
   puts z.Foo_bar&lt;br /&gt;
   puts z.Test_bar&lt;br /&gt;
&lt;br /&gt;
The result of this call is:&lt;br /&gt;
   hello&lt;br /&gt;
   goodbye&lt;br /&gt;
&lt;br /&gt;
Note: A call to z.bar would react the same way as shown in example one, with the result being a call to the last module included.&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
&lt;br /&gt;
As illustrated in the examples, there are at least two ways to ensure that your class runs as expected even when using modules with method name conflicts.&lt;br /&gt;
&lt;br /&gt;
The two approaches are:&lt;br /&gt;
#using namespaces&lt;br /&gt;
#using an alias&lt;br /&gt;
&lt;br /&gt;
With namespaces, the class controls what module will be invoked. However, with aliases, the caller controls what will be invoked. These two approaches have their advantages and disadvantages. &lt;br /&gt;
&lt;br /&gt;
An advantage of using namespaces is that the logic that the programmer envisions is captured in the code. For example, the programmer may only be interested in Foo's bar method and not Test's bar method. This can be controlled by internally making the call to Foo.bar anytime the class's bar method is invoked. By the same token, this causes less flexibility, which is a disadvantage.&lt;br /&gt;
&lt;br /&gt;
When using aliases, the caller is more in control. The caller can leverage the fact that the class it is calling has access to the bar method of two different modules, thus providing more power and flexibility. However, the disadvantage of this is that the caller must know the internals of the class it is calling. It must know which aliased method calls what module, and also what that module's method does.&lt;br /&gt;
&lt;br /&gt;
In our opinion, using namespaces is the more efficient object-oriented (OO) design approach. Encapsulation is an important OO concept, and taxing the caller to research the internals of the code, while powerful, is inefficient.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
 &lt;br /&gt;
#[http://www.recentrambles.com/pragmatic/view/69 Modules, Mixins, and Inheritance]&lt;br /&gt;
#[http://www.rubyist.net/~slagell/ruby/modules.html Ruby User's Guide]&lt;br /&gt;
#[http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_modules.html Programming Ruby]&lt;/div&gt;</summary>
		<author><name>Arjones3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5448</id>
		<title>CSC/ECE 517 Fall 2007/wiki1b 1 as</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5448"/>
		<updated>2007-10-10T20:44:07Z</updated>

		<summary type="html">&lt;p&gt;Arjones3: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background =&lt;br /&gt;
&lt;br /&gt;
Ruby does not implement true multiple inheritance, but provides Modules as a way to reuse chunks of codes in many classes. Modules, unlike like classes in OO languages such as Java, cannot be instantiated or sub-classed. Modules are included in class definitions by using the ‘include’ method which will mix that module’s methods into the calling class. The module’s methods will then become instance methods. &lt;br /&gt;
&lt;br /&gt;
A class can include several modules within the class definition. However, a problem exists when a class includes multiple modules that contain a method of the same name. Since the class will have access to both of these methods, unexpected behavior may occur when the names of the methods conflict.&lt;br /&gt;
&lt;br /&gt;
Let’s look at a few examples!&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
&lt;br /&gt;
== 1. Method Name Conflict ==&lt;br /&gt;
&lt;br /&gt;
In the following example, we have the class Zap. This class includes the module Foo and the module Test. Both modules contain a method named bar.&lt;br /&gt;
   module Foo&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;hello&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
   module Test&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;goodbye&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end   &lt;br /&gt;
   class Zap&lt;br /&gt;
    include Foo&lt;br /&gt;
    include Test&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
If a call is made to Zap's bar method, the caller is unsure whether the result will be &amp;quot;hello&amp;quot; or &amp;quot;goodbye&amp;quot;.&lt;br /&gt;
   z = Zap.new&lt;br /&gt;
   puts z.bar&lt;br /&gt;
&lt;br /&gt;
The result of this call is:&lt;br /&gt;
&lt;br /&gt;
   goodbye&lt;br /&gt;
&lt;br /&gt;
This is because Ruby will first search the last module included, and continue in a descending order. The method that is invoked may not be the method that the caller expected to run. Therefore, precaution to be taken within the class to eliminate ambiguity.&lt;br /&gt;
&lt;br /&gt;
== 2. Using Namespaces to Avoid Conflict ==&lt;br /&gt;
Using namespaces within the modules will make the method names unique and help disambiguate any conflicts. The namespace is created simply by prefixing the method name with the module name and a period (i.e., Module.method).&lt;br /&gt;
&lt;br /&gt;
Let's modify the previous example to include namespaces.&lt;br /&gt;
&lt;br /&gt;
  module Foo&lt;br /&gt;
     def Foo.bar #the method name is qualified&lt;br /&gt;
        &amp;quot;hello&amp;quot;&lt;br /&gt;
     end&lt;br /&gt;
  end&lt;br /&gt;
  module Test&lt;br /&gt;
     def Test.bar #the method name is qualified&lt;br /&gt;
        &amp;quot;goodbye&amp;quot;&lt;br /&gt;
     end&lt;br /&gt;
  end   &lt;br /&gt;
  class Zap&lt;br /&gt;
   include Foo&lt;br /&gt;
   include Test&lt;br /&gt;
&lt;br /&gt;
Zap class defines a method called bar, and makes a call to both bar methods in Foo and Test. If the programmer knew for sure that any call to the bar method should invoke only one of the modules, this could be handled here by only calling the module of choice.&lt;br /&gt;
   def bar &lt;br /&gt;
      puts Foo.bar&lt;br /&gt;
      puts Test.bar&lt;br /&gt;
   end&lt;br /&gt;
   z = Zap.new&lt;br /&gt;
   puts z.bar&lt;br /&gt;
&lt;br /&gt;
This will produce:&lt;br /&gt;
   Hello&lt;br /&gt;
   Goodbye&lt;br /&gt;
&lt;br /&gt;
== 3. Using Aliases to Avoid Conflict ==&lt;br /&gt;
An alternative to using namespaces is to use alias to disambiguate method names in different modules. Again, looking at the first example, we have modified it to show the use of aliases.&lt;br /&gt;
&lt;br /&gt;
  module Foo&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;hello&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
   module Test&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;goodbye&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
   &lt;br /&gt;
In the Zap class, we define two aliases, one for Foo's bar method and another for Test's bar method. The alias syntax is ''alias :new_name :old_name''. So, to disambiguate, we first include Foo, and give an alias to its bar method. Then include Test and give an alias to its bar method.&lt;br /&gt;
   class Zap&lt;br /&gt;
    include Foo&lt;br /&gt;
    alias :Foo_bar :bar&lt;br /&gt;
    include Test&lt;br /&gt;
    alias :Test_bar :bar&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
The caller then can make a call to the new method names defined by the aliases to choose exactly which call they want to make.&lt;br /&gt;
   z = Zap.new&lt;br /&gt;
   puts z.Foo_bar&lt;br /&gt;
   puts z.Test_bar&lt;br /&gt;
&lt;br /&gt;
The result of this call is:&lt;br /&gt;
   hello&lt;br /&gt;
   goodbye&lt;br /&gt;
&lt;br /&gt;
Note: A call to z.bar would react the same way as shown in example one, with the result being a call to the last module included.&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
&lt;br /&gt;
As illustrated in the examples, there are at least two ways to ensure that your class runs as expected even when using modules with method name conflicts.&lt;br /&gt;
&lt;br /&gt;
The two approaches are:&lt;br /&gt;
#using namespaces&lt;br /&gt;
#using an alias&lt;br /&gt;
&lt;br /&gt;
With namespaces, the class controls what module will be invoked. However, with aliases, the caller controls what will be invoked. These two approaches have their advantages and disadvantages. &lt;br /&gt;
&lt;br /&gt;
An advantage of using namespaces is that the logic that the programmer envisions is captured in the code. For example, the programmer may only be interested in Foo's bar method and not Test's bar method. This can be controlled by internally making the call to Foo.bar anytime the class's bar method is invoked. By the same token, this causes less flexibility, which is a disadvantage.&lt;br /&gt;
&lt;br /&gt;
When using aliases, the caller is more in control. The caller can leverage the fact that the class it is calling has access to the bar method of two different modules, thus providing more power and flexibility. However, the disadvantage of this is that the caller must know the internals of the class it is calling. It must know which aliased method calls what module, and also what that module's method does.&lt;br /&gt;
&lt;br /&gt;
In our opinion, using namespaces is the more efficient object-oriented (OO) design approach. Encapsulation is an important OO concept, and taxing the caller to research the internals of the code, while powerful, is inefficient.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
 &lt;br /&gt;
#[http://www.recentrambles.com/pragmatic/view/69 Modules, Mixins, and Inheritance]&lt;br /&gt;
#[http://www.rubyist.net/~slagell/ruby/modules.html Ruby User's Guide]&lt;/div&gt;</summary>
		<author><name>Arjones3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5447</id>
		<title>CSC/ECE 517 Fall 2007/wiki1b 1 as</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5447"/>
		<updated>2007-10-10T20:43:56Z</updated>

		<summary type="html">&lt;p&gt;Arjones3: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background =&lt;br /&gt;
&lt;br /&gt;
Ruby does not implement true multiple inheritance, but provides Modules as a way to reuse chunks of codes in many classes. Modules, unlike like classes in OO languages such as Java, cannot be instantiated or sub-classed. Modules are included in class definitions by using the ‘include’ method which will mix that module’s methods into the calling class. The module’s methods will then become instance methods. &lt;br /&gt;
&lt;br /&gt;
A class can include several modules within the class definition. However, a problem exists when a class includes multiple modules that contain a method of the same name. Since the class will have access to both of these methods, unexpected behavior may occur when the names of the methods conflict.&lt;br /&gt;
&lt;br /&gt;
Let’s look at a few examples!&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
&lt;br /&gt;
== 1. Method Name Conflict ==&lt;br /&gt;
&lt;br /&gt;
In the following example, we have the class Zap. This class includes the module Foo and the module Test. Both modules contain a method named bar.&lt;br /&gt;
   module Foo&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;hello&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
   module Test&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;goodbye&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end   &lt;br /&gt;
   class Zap&lt;br /&gt;
    include Foo&lt;br /&gt;
    include Test&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
If a call is made to Zap's bar method, the caller is unsure whether the result will be &amp;quot;hello&amp;quot; or &amp;quot;goodbye&amp;quot;.&lt;br /&gt;
   z = Zap.new&lt;br /&gt;
   puts z.bar&lt;br /&gt;
&lt;br /&gt;
The result of this call is:&lt;br /&gt;
&lt;br /&gt;
   goodbye&lt;br /&gt;
&lt;br /&gt;
This is because Ruby will first search the last module included, and continue in a descending order. The method that is invoked may not be the method that the caller expected to run. Therefore, precaution to be taken within the class to eliminate ambiguity.&lt;br /&gt;
&lt;br /&gt;
== 2. Using Namespaces to Avoid Conflict ==&lt;br /&gt;
Using namespaces within the modules will make the method names unique and help disambiguate any conflicts. The namespace is created simply by prefixing the method name with the module name and a period (i.e., Module.method).&lt;br /&gt;
&lt;br /&gt;
Let's modify the previous example to include namespaces.&lt;br /&gt;
&lt;br /&gt;
  module Foo&lt;br /&gt;
     def Foo.bar #the method name is qualified&lt;br /&gt;
        &amp;quot;hello&amp;quot;&lt;br /&gt;
     end&lt;br /&gt;
  end&lt;br /&gt;
  module Test&lt;br /&gt;
     def Test.bar #the method name is qualified&lt;br /&gt;
        &amp;quot;goodbye&amp;quot;&lt;br /&gt;
     end&lt;br /&gt;
  end   &lt;br /&gt;
  class Zap&lt;br /&gt;
   include Foo&lt;br /&gt;
   include Test&lt;br /&gt;
&lt;br /&gt;
Zap class defines a method called bar, and makes a call to both bar methods in Foo and Test. If the programmer knew for sure that any call to the bar method should invoke only one of the modules, this could be handled here by only calling the module of choice.&lt;br /&gt;
   def bar &lt;br /&gt;
      puts Foo.bar&lt;br /&gt;
      puts Test.bar&lt;br /&gt;
   end&lt;br /&gt;
   z = Zap.new&lt;br /&gt;
   puts z.bar&lt;br /&gt;
&lt;br /&gt;
This will produce:&lt;br /&gt;
   Hello&lt;br /&gt;
   Goodbye&lt;br /&gt;
&lt;br /&gt;
== 3. Using Aliases to Avoid Conflict ==&lt;br /&gt;
An alternative to using namespaces is to use alias to disambiguate method names in different modules. Again, looking at the first example, we have modified it to show the use of aliases.&lt;br /&gt;
&lt;br /&gt;
  module Foo&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;hello&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
   module Test&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;goodbye&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
   &lt;br /&gt;
In the Zap class, we define two aliases, one for Foo's bar method and another for Test's bar method. The alias syntax is ''alias :new_name :old_name''. So, to disambiguate, we first include Foo, and give an alias to its bar method. Then include Test and give an alias to its bar method.&lt;br /&gt;
   class Zap&lt;br /&gt;
    include Foo&lt;br /&gt;
    alias :Foo_bar :bar&lt;br /&gt;
    include Test&lt;br /&gt;
    alias :Test_bar :bar&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
The caller then can make a call to the new method names defined by the aliases to choose exactly which call they want to make.&lt;br /&gt;
   z = Zap.new&lt;br /&gt;
   puts z.Foo_bar&lt;br /&gt;
   puts z.Test_bar&lt;br /&gt;
&lt;br /&gt;
The result of this call is:&lt;br /&gt;
   hello&lt;br /&gt;
   goodbye&lt;br /&gt;
&lt;br /&gt;
Note: A call to z.bar would react the same way as shown in example one, with the result being a call to the last module included.&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
&lt;br /&gt;
As illustrated in the examples, there are at least two ways to ensure that your class runs as expected even when using modules with method name conflicts.&lt;br /&gt;
&lt;br /&gt;
The two approaches are:&lt;br /&gt;
#using namespaces&lt;br /&gt;
#using an alias&lt;br /&gt;
&lt;br /&gt;
With namespaces, the class controls what module will be invoked. However, with aliases, the caller controls what will be invoked. These two approaches have their advantages and disadvantages. &lt;br /&gt;
&lt;br /&gt;
An advantage of using namespaces is that the logic that the programmer envisions is captured in the code. For example, the programmer may only be interested in Foo's bar method and not Test's bar method. This can be controlled by internally making the call to Foo.bar anytime the class's bar method is invoked. By the same token, this causes less flexibility, which is a disadvantage.&lt;br /&gt;
&lt;br /&gt;
When using aliases, the caller is more in control. The caller can leverage the fact that the class it is calling has access to the bar method of two different modules, thus providing more power and flexibility. However, the disadvantage of this is that the caller must know the internals of the class it is calling. It must know which aliased method calls what module, and also what that module's method does.&lt;br /&gt;
&lt;br /&gt;
In our opinion, using namespaces is the more efficient object-oriented (OO) design approach. Encapsulation is an important OO concept, and taxing the caller to research the internals of the code, while powerful, is inefficient.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
 &lt;br /&gt;
#[http://www.recentrambles.com/pragmatic/view/69 Modules, Mixins, and Inheritance]&lt;br /&gt;
#[http://www.rubyist.net/~slagell/ruby/modules.html Ruby User's Guide]&lt;br /&gt;
#[http://rubyforge.org/docman/view.php/735/309/readme.html 'use' package readme]&lt;/div&gt;</summary>
		<author><name>Arjones3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5444</id>
		<title>CSC/ECE 517 Fall 2007/wiki1b 1 as</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5444"/>
		<updated>2007-10-10T20:30:49Z</updated>

		<summary type="html">&lt;p&gt;Arjones3: /* 2. Using Namespaces to Avoid Conflict */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background =&lt;br /&gt;
&lt;br /&gt;
Ruby does not implement true multiple inheritance, but provides Modules as a way to reuse chunks of codes in many classes. Modules, unlike like classes in OO languages such as Java, cannot be instantiated or sub-classed. Modules are included in class definitions by using the ‘include’ method which will mix that module’s methods into the calling class. The module’s methods will then become instance methods. &lt;br /&gt;
&lt;br /&gt;
A class can include several modules within the class definition. However, a problem exists when a class includes multiple modules that contain a method of the same name. Since the class will have access to both of these methods, unexpected behavior may occur when the names of the methods conflict.&lt;br /&gt;
&lt;br /&gt;
Let’s look at a few examples!&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
&lt;br /&gt;
== 1. Method Name Conflict ==&lt;br /&gt;
&lt;br /&gt;
In the following example, we have the class Zap. This class includes the module Foo and the module Test. Both modules contain a method named bar.&lt;br /&gt;
   module Foo&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;hello&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
   module Test&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;goodbye&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end   &lt;br /&gt;
   class Zap&lt;br /&gt;
    include Foo&lt;br /&gt;
    include Test&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
If a call is made to Zap's bar method, the caller is unsure whether the result will be &amp;quot;hello&amp;quot; or &amp;quot;goodbye&amp;quot;.&lt;br /&gt;
   z = Zap.new&lt;br /&gt;
   puts z.bar&lt;br /&gt;
&lt;br /&gt;
The result of this call is:&lt;br /&gt;
&lt;br /&gt;
   goodbye&lt;br /&gt;
&lt;br /&gt;
This is because Ruby will first search the last module included, and continue in a descending order. The method that is invoked may not be the method that the caller expected to run. Therefore, precaution to be taken within the class to eliminate ambiguity.&lt;br /&gt;
&lt;br /&gt;
== 2. Using Namespaces to Avoid Conflict ==&lt;br /&gt;
Using namespaces within the modules will make the method names unique and help disambiguate any conflicts. The namespace is created simply by prefixing the method name with the module name and a period (i.e., Module.method).&lt;br /&gt;
&lt;br /&gt;
Let's modify the previous example to include namespaces.&lt;br /&gt;
&lt;br /&gt;
  module Foo&lt;br /&gt;
     def Foo.bar #the method name is qualified&lt;br /&gt;
        &amp;quot;hello&amp;quot;&lt;br /&gt;
     end&lt;br /&gt;
  end&lt;br /&gt;
  module Test&lt;br /&gt;
     def Test.bar #the method name is qualified&lt;br /&gt;
        &amp;quot;goodbye&amp;quot;&lt;br /&gt;
     end&lt;br /&gt;
  end   &lt;br /&gt;
  class Zap&lt;br /&gt;
   include Foo&lt;br /&gt;
   include Test&lt;br /&gt;
&lt;br /&gt;
Zap class defines a method called bar, and makes a call to both bar methods in Foo and Test. If the programmer knew for sure that any call to the bar method should invoke only one of the modules, this could be handled here by only calling the module of choice.&lt;br /&gt;
   def bar &lt;br /&gt;
      puts Foo.bar&lt;br /&gt;
      puts Test.bar&lt;br /&gt;
   end&lt;br /&gt;
   z = Zap.new&lt;br /&gt;
   puts z.bar&lt;br /&gt;
&lt;br /&gt;
This will produce:&lt;br /&gt;
   Hello&lt;br /&gt;
   Goodbye&lt;br /&gt;
&lt;br /&gt;
== 3. Using Aliases to Avoid Conflict ==&lt;br /&gt;
An alternative to using namespaces is to use alias to disambiguate method names in different modules. Again, looking at the first example, we have modified it to show the use of aliases.&lt;br /&gt;
&lt;br /&gt;
  module Foo&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;hello&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
   module Test&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;goodbye&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
   &lt;br /&gt;
In the Zap class, we define two aliases, one for Foo's bar method and another for Test's bar method. The alias syntax is ''alias :new_name :old_name''. So, to disambiguate, we first include Foo, and give an alias to its bar method. Then include Test and give an alias to its bar method.&lt;br /&gt;
   class Zap&lt;br /&gt;
    include Foo&lt;br /&gt;
    alias :Foo_bar :bar&lt;br /&gt;
    include Test&lt;br /&gt;
    alias :Test_bar :bar&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
The caller then can make a call to the new method names defined by the aliases to choose exactly which call they want to make.&lt;br /&gt;
   z = Zap.new&lt;br /&gt;
   puts z.Foo_bar&lt;br /&gt;
   puts z.Test_bar&lt;br /&gt;
&lt;br /&gt;
The result of this call is:&lt;br /&gt;
   hello&lt;br /&gt;
   goodbye&lt;br /&gt;
&lt;br /&gt;
Note: A call to z.bar would react the same way as shown in example one, with the result being a call to the last module included.&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
&lt;br /&gt;
As illustrated in the examples, there are at least two ways to ensure that your class runs as expected even when using modules with method name conflicts.&lt;br /&gt;
&lt;br /&gt;
The two approaches are:&lt;br /&gt;
#using namespaces&lt;br /&gt;
#using an alias&lt;br /&gt;
&lt;br /&gt;
In our opinion, using namespaces is the better approach. Inheriting from the module and using the qualified names to avoid conflicts is a more efficient OO design. It is also easier to read and maintain because in viewing the call, a reader will immediately gather the expected behavior of the call, as opposed to finding the alias definition and trying to make the connection. &lt;br /&gt;
&lt;br /&gt;
With the alias approach, the inheritance is limited and the programmer will need to constantly update the list of aliases for methods needed as they arise.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
 &lt;br /&gt;
#[http://www.recentrambles.com/pragmatic/view/69 Modules, Mixins, and Inheritance]&lt;br /&gt;
#[http://www.rubyist.net/~slagell/ruby/modules.html Ruby User's Guide]&lt;br /&gt;
#[http://rubyforge.org/docman/view.php/735/309/readme.html 'use' package readme]&lt;/div&gt;</summary>
		<author><name>Arjones3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5443</id>
		<title>CSC/ECE 517 Fall 2007/wiki1b 1 as</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5443"/>
		<updated>2007-10-10T20:30:08Z</updated>

		<summary type="html">&lt;p&gt;Arjones3: /* 3. Using Aliases to Avoid Conflict */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background =&lt;br /&gt;
&lt;br /&gt;
Ruby does not implement true multiple inheritance, but provides Modules as a way to reuse chunks of codes in many classes. Modules, unlike like classes in OO languages such as Java, cannot be instantiated or sub-classed. Modules are included in class definitions by using the ‘include’ method which will mix that module’s methods into the calling class. The module’s methods will then become instance methods. &lt;br /&gt;
&lt;br /&gt;
A class can include several modules within the class definition. However, a problem exists when a class includes multiple modules that contain a method of the same name. Since the class will have access to both of these methods, unexpected behavior may occur when the names of the methods conflict.&lt;br /&gt;
&lt;br /&gt;
Let’s look at a few examples!&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
&lt;br /&gt;
== 1. Method Name Conflict ==&lt;br /&gt;
&lt;br /&gt;
In the following example, we have the class Zap. This class includes the module Foo and the module Test. Both modules contain a method named bar.&lt;br /&gt;
   module Foo&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;hello&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
   module Test&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;goodbye&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end   &lt;br /&gt;
   class Zap&lt;br /&gt;
    include Foo&lt;br /&gt;
    include Test&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
If a call is made to Zap's bar method, the caller is unsure whether the result will be &amp;quot;hello&amp;quot; or &amp;quot;goodbye&amp;quot;.&lt;br /&gt;
   z = Zap.new&lt;br /&gt;
   puts z.bar&lt;br /&gt;
&lt;br /&gt;
The result of this call is:&lt;br /&gt;
&lt;br /&gt;
   goodbye&lt;br /&gt;
&lt;br /&gt;
This is because Ruby will first search the last module included, and continue in a descending order. The method that is invoked may not be the method that the caller expected to run. Therefore, precaution to be taken within the class to eliminate ambiguity.&lt;br /&gt;
&lt;br /&gt;
== 2. Using Namespaces to Avoid Conflict ==&lt;br /&gt;
Using namespaces within the modules will make the method names unique and help disambiguate any conflicts. The namespace is created simply by prefixing the method name with the module name and a period (i.e., Module.method).&lt;br /&gt;
&lt;br /&gt;
Let's modify the previous example to include namespaces.&lt;br /&gt;
&lt;br /&gt;
  module Foo&lt;br /&gt;
     def Foo.bar #the method name is qualified&lt;br /&gt;
        &amp;quot;hello&amp;quot;&lt;br /&gt;
     end&lt;br /&gt;
  end&lt;br /&gt;
  module Test&lt;br /&gt;
     def Test.bar #the method name is qualified&lt;br /&gt;
        &amp;quot;goodbye&amp;quot;&lt;br /&gt;
     end&lt;br /&gt;
  end   &lt;br /&gt;
  class Zap&lt;br /&gt;
   include Foo&lt;br /&gt;
   include Test&lt;br /&gt;
&lt;br /&gt;
Zap class defines a method called bar, and makes a call to both bar methods in Foo and Test. If the programmer knew for sure that any call to the bar method should invoke only one of the modules, this could be handled here by only calling the module of choice.&lt;br /&gt;
   def bar &lt;br /&gt;
      puts Foo.bar&lt;br /&gt;
      puts Test.bar&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
   z = Zap.new&lt;br /&gt;
   puts z.bar&lt;br /&gt;
&lt;br /&gt;
This will produce:&lt;br /&gt;
   Hello&lt;br /&gt;
   Goodbye&lt;br /&gt;
&lt;br /&gt;
== 3. Using Aliases to Avoid Conflict ==&lt;br /&gt;
An alternative to using namespaces is to use alias to disambiguate method names in different modules. Again, looking at the first example, we have modified it to show the use of aliases.&lt;br /&gt;
&lt;br /&gt;
  module Foo&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;hello&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
   module Test&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;goodbye&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
   &lt;br /&gt;
In the Zap class, we define two aliases, one for Foo's bar method and another for Test's bar method. The alias syntax is ''alias :new_name :old_name''. So, to disambiguate, we first include Foo, and give an alias to its bar method. Then include Test and give an alias to its bar method.&lt;br /&gt;
   class Zap&lt;br /&gt;
    include Foo&lt;br /&gt;
    alias :Foo_bar :bar&lt;br /&gt;
    include Test&lt;br /&gt;
    alias :Test_bar :bar&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
The caller then can make a call to the new method names defined by the aliases to choose exactly which call they want to make.&lt;br /&gt;
   z = Zap.new&lt;br /&gt;
   puts z.Foo_bar&lt;br /&gt;
   puts z.Test_bar&lt;br /&gt;
&lt;br /&gt;
The result of this call is:&lt;br /&gt;
   hello&lt;br /&gt;
   goodbye&lt;br /&gt;
&lt;br /&gt;
Note: A call to z.bar would react the same way as shown in example one, with the result being a call to the last module included.&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
&lt;br /&gt;
As illustrated in the examples, there are at least two ways to ensure that your class runs as expected even when using modules with method name conflicts.&lt;br /&gt;
&lt;br /&gt;
The two approaches are:&lt;br /&gt;
#using namespaces&lt;br /&gt;
#using an alias&lt;br /&gt;
&lt;br /&gt;
In our opinion, using namespaces is the better approach. Inheriting from the module and using the qualified names to avoid conflicts is a more efficient OO design. It is also easier to read and maintain because in viewing the call, a reader will immediately gather the expected behavior of the call, as opposed to finding the alias definition and trying to make the connection. &lt;br /&gt;
&lt;br /&gt;
With the alias approach, the inheritance is limited and the programmer will need to constantly update the list of aliases for methods needed as they arise.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
 &lt;br /&gt;
#[http://www.recentrambles.com/pragmatic/view/69 Modules, Mixins, and Inheritance]&lt;br /&gt;
#[http://www.rubyist.net/~slagell/ruby/modules.html Ruby User's Guide]&lt;br /&gt;
#[http://rubyforge.org/docman/view.php/735/309/readme.html 'use' package readme]&lt;/div&gt;</summary>
		<author><name>Arjones3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5441</id>
		<title>CSC/ECE 517 Fall 2007/wiki1b 1 as</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5441"/>
		<updated>2007-10-10T20:27:51Z</updated>

		<summary type="html">&lt;p&gt;Arjones3: /* 3. Using Aliases to Avoid Conflict */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background =&lt;br /&gt;
&lt;br /&gt;
Ruby does not implement true multiple inheritance, but provides Modules as a way to reuse chunks of codes in many classes. Modules, unlike like classes in OO languages such as Java, cannot be instantiated or sub-classed. Modules are included in class definitions by using the ‘include’ method which will mix that module’s methods into the calling class. The module’s methods will then become instance methods. &lt;br /&gt;
&lt;br /&gt;
A class can include several modules within the class definition. However, a problem exists when a class includes multiple modules that contain a method of the same name. Since the class will have access to both of these methods, unexpected behavior may occur when the names of the methods conflict.&lt;br /&gt;
&lt;br /&gt;
Let’s look at a few examples!&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
&lt;br /&gt;
== 1. Method Name Conflict ==&lt;br /&gt;
&lt;br /&gt;
In the following example, we have the class Zap. This class includes the module Foo and the module Test. Both modules contain a method named bar.&lt;br /&gt;
   module Foo&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;hello&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
   module Test&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;goodbye&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end   &lt;br /&gt;
   class Zap&lt;br /&gt;
    include Foo&lt;br /&gt;
    include Test&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
If a call is made to Zap's bar method, the caller is unsure whether the result will be &amp;quot;hello&amp;quot; or &amp;quot;goodbye&amp;quot;.&lt;br /&gt;
   z = Zap.new&lt;br /&gt;
   puts z.bar&lt;br /&gt;
&lt;br /&gt;
The result of this call is:&lt;br /&gt;
&lt;br /&gt;
   goodbye&lt;br /&gt;
&lt;br /&gt;
This is because Ruby will first search the last module included, and continue in a descending order. The method that is invoked may not be the method that the caller expected to run. Therefore, precaution to be taken within the class to eliminate ambiguity.&lt;br /&gt;
&lt;br /&gt;
== 2. Using Namespaces to Avoid Conflict ==&lt;br /&gt;
Using namespaces within the modules will make the method names unique and help disambiguate any conflicts. The namespace is created simply by prefixing the method name with the module name and a period (i.e., Module.method).&lt;br /&gt;
&lt;br /&gt;
Let's modify the previous example to include namespaces.&lt;br /&gt;
&lt;br /&gt;
  module Foo&lt;br /&gt;
     def Foo.bar #the method name is qualified&lt;br /&gt;
        &amp;quot;hello&amp;quot;&lt;br /&gt;
     end&lt;br /&gt;
  end&lt;br /&gt;
  module Test&lt;br /&gt;
     def Test.bar #the method name is qualified&lt;br /&gt;
        &amp;quot;goodbye&amp;quot;&lt;br /&gt;
     end&lt;br /&gt;
  end   &lt;br /&gt;
  class Zap&lt;br /&gt;
   include Foo&lt;br /&gt;
   include Test&lt;br /&gt;
&lt;br /&gt;
Zap class defines a method called bar, and makes a call to both bar methods in Foo and Test. If the programmer knew for sure that any call to the bar method should invoke only one of the modules, this could be handled here by only calling the module of choice.&lt;br /&gt;
   def bar &lt;br /&gt;
      puts Foo.bar&lt;br /&gt;
      puts Test.bar&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
   z = Zap.new&lt;br /&gt;
   puts z.bar&lt;br /&gt;
&lt;br /&gt;
This will produce:&lt;br /&gt;
   Hello&lt;br /&gt;
   Goodbye&lt;br /&gt;
&lt;br /&gt;
== 3. Using Aliases to Avoid Conflict ==&lt;br /&gt;
An alternative to using namespaces is to use alias to disambiguate method names in different modules. Again, looking at the first example, we have modified it to show the use of aliases.&lt;br /&gt;
&lt;br /&gt;
  module Foo&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;hello&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
   module Test&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;goodbye&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
   &lt;br /&gt;
In the Zap class, we define two aliases, one for Foo's bar method and another for Test's bar method. The alias syntax is ''alias :new_name :old_name''. So, to disambiguate, we first include Foo, and give an alias to its bar method. Then include Test and give an alias to its bar method.&lt;br /&gt;
   class Zap&lt;br /&gt;
    include Foo&lt;br /&gt;
    alias :Foo_bar :bar&lt;br /&gt;
    include Test&lt;br /&gt;
    alias :Test_bar :bar&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
The caller then can make a call to the new method names defined by the aliases to choose exactly which call they want to make.&lt;br /&gt;
   z = Zap.new&lt;br /&gt;
   puts z.Foo_bar&lt;br /&gt;
   puts z.Test_bar&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
&lt;br /&gt;
As illustrated in the examples, there are at least two ways to ensure that your class runs as expected even when using modules with method name conflicts.&lt;br /&gt;
&lt;br /&gt;
The two approaches are:&lt;br /&gt;
#using namespaces&lt;br /&gt;
#using an alias&lt;br /&gt;
&lt;br /&gt;
In our opinion, using namespaces is the better approach. Inheriting from the module and using the qualified names to avoid conflicts is a more efficient OO design. It is also easier to read and maintain because in viewing the call, a reader will immediately gather the expected behavior of the call, as opposed to finding the alias definition and trying to make the connection. &lt;br /&gt;
&lt;br /&gt;
With the alias approach, the inheritance is limited and the programmer will need to constantly update the list of aliases for methods needed as they arise.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
 &lt;br /&gt;
#[http://www.recentrambles.com/pragmatic/view/69 Modules, Mixins, and Inheritance]&lt;br /&gt;
#[http://www.rubyist.net/~slagell/ruby/modules.html Ruby User's Guide]&lt;br /&gt;
#[http://rubyforge.org/docman/view.php/735/309/readme.html 'use' package readme]&lt;/div&gt;</summary>
		<author><name>Arjones3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5437</id>
		<title>CSC/ECE 517 Fall 2007/wiki1b 1 as</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5437"/>
		<updated>2007-10-10T20:15:08Z</updated>

		<summary type="html">&lt;p&gt;Arjones3: /* Background */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background =&lt;br /&gt;
&lt;br /&gt;
Ruby does not implement true multiple inheritance, but provides Modules as a way to reuse chunks of codes in many classes. Modules, unlike like classes in OO languages such as Java, cannot be instantiated or sub-classed. Modules are included in class definitions by using the ‘include’ method which will mix that module’s methods into the calling class. The module’s methods will then become instance methods. &lt;br /&gt;
&lt;br /&gt;
A class can include several modules within the class definition. However, a problem exists when a class includes multiple modules that contain a method of the same name. Since the class will have access to both of these methods, unexpected behavior may occur when the names of the methods conflict.&lt;br /&gt;
&lt;br /&gt;
Let’s look at a few examples!&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
&lt;br /&gt;
== 1. Method Name Conflict ==&lt;br /&gt;
&lt;br /&gt;
In the following example, we have the class Zap. This class includes the module Foo and the module Test. Both modules contain a method named bar.&lt;br /&gt;
   module Foo&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;hello&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
   module Test&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;goodbye&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end   &lt;br /&gt;
   class Zap&lt;br /&gt;
    include Foo&lt;br /&gt;
    include Test&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
If a call is made to Zap's bar method, the caller is unsure whether the result will be &amp;quot;hello&amp;quot; or &amp;quot;goodbye&amp;quot;.&lt;br /&gt;
   z = Zap.new&lt;br /&gt;
   puts z.bar&lt;br /&gt;
&lt;br /&gt;
The result of this call is:&lt;br /&gt;
&lt;br /&gt;
   goodbye&lt;br /&gt;
&lt;br /&gt;
This is because Ruby will first search the last module included, and continue in a descending order. The method that is invoked may not be the method that the caller expected to run. Therefore, precaution to be taken within the class to eliminate ambiguity.&lt;br /&gt;
&lt;br /&gt;
== 2. Using Namespaces to Avoid Conflict ==&lt;br /&gt;
Using namespaces within the modules will make the method names unique and help disambiguate any conflicts. The namespace is created simply by prefixing the method name with the module name and a period (i.e., Module.method).&lt;br /&gt;
&lt;br /&gt;
Let's modify the previous example to include namespaces.&lt;br /&gt;
&lt;br /&gt;
  module Foo&lt;br /&gt;
     def Foo.bar #the method name is qualified&lt;br /&gt;
        &amp;quot;hello&amp;quot;&lt;br /&gt;
     end&lt;br /&gt;
  end&lt;br /&gt;
  module Test&lt;br /&gt;
     def Test.bar #the method name is qualified&lt;br /&gt;
        &amp;quot;goodbye&amp;quot;&lt;br /&gt;
     end&lt;br /&gt;
  end   &lt;br /&gt;
  class Zap&lt;br /&gt;
   include Foo&lt;br /&gt;
   include Test&lt;br /&gt;
&lt;br /&gt;
Zap class defines a method called bar, and makes a call to both bar methods in Foo and Test. If the programmer knew for sure that any call to the bar method should invoke only one of the modules, this could be handled here by only calling the module of choice.&lt;br /&gt;
   def bar &lt;br /&gt;
      puts Foo.bar&lt;br /&gt;
      puts Test.bar&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
   z = Zap.new&lt;br /&gt;
   puts z.bar&lt;br /&gt;
&lt;br /&gt;
This will produce:&lt;br /&gt;
   Hello&lt;br /&gt;
   Goodbye&lt;br /&gt;
&lt;br /&gt;
== 3. Using Aliases to Avoid Conflict ==&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
&lt;br /&gt;
As illustrated in the examples, there are at least two ways to ensure that your class runs as expected even when using modules with method name conflicts.&lt;br /&gt;
&lt;br /&gt;
The two approaches are:&lt;br /&gt;
#using namespaces&lt;br /&gt;
#using an alias&lt;br /&gt;
&lt;br /&gt;
In our opinion, using namespaces is the better approach. Inheriting from the module and using the qualified names to avoid conflicts is a more efficient OO design. It is also easier to read and maintain because in viewing the call, a reader will immediately gather the expected behavior of the call, as opposed to finding the alias definition and trying to make the connection. &lt;br /&gt;
&lt;br /&gt;
With the alias approach, the inheritance is limited and the programmer will need to constantly update the list of aliases for methods needed as they arise.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
 &lt;br /&gt;
#[http://www.recentrambles.com/pragmatic/view/69 Modules, Mixins, and Inheritance]&lt;br /&gt;
#[http://www.rubyist.net/~slagell/ruby/modules.html Ruby User's Guide]&lt;br /&gt;
#[http://rubyforge.org/docman/view.php/735/309/readme.html 'use' package readme]&lt;/div&gt;</summary>
		<author><name>Arjones3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5436</id>
		<title>CSC/ECE 517 Fall 2007/wiki1b 1 as</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5436"/>
		<updated>2007-10-10T20:13:59Z</updated>

		<summary type="html">&lt;p&gt;Arjones3: /* 2. Using Namespaces to Avoid Conflict */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background =&lt;br /&gt;
&lt;br /&gt;
Ruby does not implement true multiple inheritance, but provides Modules as a way to reuse chunks of codes in many classes. &lt;br /&gt;
&lt;br /&gt;
Modules, unlike like classes in OO languages such as Java, cannot be instantiated or sub-classed. Modules are included in class definitions by using the ‘include’ method which will mix that module’s methods into the calling class. The module’s methods will then become instance methods. &lt;br /&gt;
&lt;br /&gt;
A class can include several modules within the class definition. However, a problem exists when a class includes multiple modules that contain a method of the same name. Since the class will have access to both of these methods, unexpected behavior may occur when the names of the methods conflict.&lt;br /&gt;
&lt;br /&gt;
Let’s look at a few examples!&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
&lt;br /&gt;
== 1. Method Name Conflict ==&lt;br /&gt;
&lt;br /&gt;
In the following example, we have the class Zap. This class includes the module Foo and the module Test. Both modules contain a method named bar.&lt;br /&gt;
   module Foo&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;hello&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
   module Test&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;goodbye&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end   &lt;br /&gt;
   class Zap&lt;br /&gt;
    include Foo&lt;br /&gt;
    include Test&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
If a call is made to Zap's bar method, the caller is unsure whether the result will be &amp;quot;hello&amp;quot; or &amp;quot;goodbye&amp;quot;.&lt;br /&gt;
   z = Zap.new&lt;br /&gt;
   puts z.bar&lt;br /&gt;
&lt;br /&gt;
The result of this call is:&lt;br /&gt;
&lt;br /&gt;
   goodbye&lt;br /&gt;
&lt;br /&gt;
This is because Ruby will first search the last module included, and continue in a descending order. The method that is invoked may not be the method that the caller expected to run. Therefore, precaution to be taken within the class to eliminate ambiguity.&lt;br /&gt;
&lt;br /&gt;
== 2. Using Namespaces to Avoid Conflict ==&lt;br /&gt;
Using namespaces within the modules will make the method names unique and help disambiguate any conflicts. The namespace is created simply by prefixing the method name with the module name and a period (i.e., Module.method).&lt;br /&gt;
&lt;br /&gt;
Let's modify the previous example to include namespaces.&lt;br /&gt;
&lt;br /&gt;
  module Foo&lt;br /&gt;
     def Foo.bar #the method name is qualified&lt;br /&gt;
        &amp;quot;hello&amp;quot;&lt;br /&gt;
     end&lt;br /&gt;
  end&lt;br /&gt;
  module Test&lt;br /&gt;
     def Test.bar #the method name is qualified&lt;br /&gt;
        &amp;quot;goodbye&amp;quot;&lt;br /&gt;
     end&lt;br /&gt;
  end   &lt;br /&gt;
  class Zap&lt;br /&gt;
   include Foo&lt;br /&gt;
   include Test&lt;br /&gt;
&lt;br /&gt;
Zap class defines a method called bar, and makes a call to both bar methods in Foo and Test. If the programmer knew for sure that any call to the bar method should invoke only one of the modules, this could be handled here by only calling the module of choice.&lt;br /&gt;
   def bar &lt;br /&gt;
      puts Foo.bar&lt;br /&gt;
      puts Test.bar&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
   z = Zap.new&lt;br /&gt;
   puts z.bar&lt;br /&gt;
&lt;br /&gt;
This will produce:&lt;br /&gt;
   Hello&lt;br /&gt;
   Goodbye&lt;br /&gt;
&lt;br /&gt;
== 3. Using Aliases to Avoid Conflict ==&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
&lt;br /&gt;
As illustrated in the examples, there are at least two ways to ensure that your class runs as expected even when using modules with method name conflicts.&lt;br /&gt;
&lt;br /&gt;
The two approaches are:&lt;br /&gt;
#using namespaces&lt;br /&gt;
#using an alias&lt;br /&gt;
&lt;br /&gt;
In our opinion, using namespaces is the better approach. Inheriting from the module and using the qualified names to avoid conflicts is a more efficient OO design. It is also easier to read and maintain because in viewing the call, a reader will immediately gather the expected behavior of the call, as opposed to finding the alias definition and trying to make the connection. &lt;br /&gt;
&lt;br /&gt;
With the alias approach, the inheritance is limited and the programmer will need to constantly update the list of aliases for methods needed as they arise.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
 &lt;br /&gt;
#[http://www.recentrambles.com/pragmatic/view/69 Modules, Mixins, and Inheritance]&lt;br /&gt;
#[http://www.rubyist.net/~slagell/ruby/modules.html Ruby User's Guide]&lt;br /&gt;
#[http://rubyforge.org/docman/view.php/735/309/readme.html 'use' package readme]&lt;/div&gt;</summary>
		<author><name>Arjones3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5435</id>
		<title>CSC/ECE 517 Fall 2007/wiki1b 1 as</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5435"/>
		<updated>2007-10-10T20:13:07Z</updated>

		<summary type="html">&lt;p&gt;Arjones3: /* 2. Using Namespaces to Avoid Conflict */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background =&lt;br /&gt;
&lt;br /&gt;
Ruby does not implement true multiple inheritance, but provides Modules as a way to reuse chunks of codes in many classes. &lt;br /&gt;
&lt;br /&gt;
Modules, unlike like classes in OO languages such as Java, cannot be instantiated or sub-classed. Modules are included in class definitions by using the ‘include’ method which will mix that module’s methods into the calling class. The module’s methods will then become instance methods. &lt;br /&gt;
&lt;br /&gt;
A class can include several modules within the class definition. However, a problem exists when a class includes multiple modules that contain a method of the same name. Since the class will have access to both of these methods, unexpected behavior may occur when the names of the methods conflict.&lt;br /&gt;
&lt;br /&gt;
Let’s look at a few examples!&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
&lt;br /&gt;
== 1. Method Name Conflict ==&lt;br /&gt;
&lt;br /&gt;
In the following example, we have the class Zap. This class includes the module Foo and the module Test. Both modules contain a method named bar.&lt;br /&gt;
   module Foo&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;hello&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
   module Test&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;goodbye&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end   &lt;br /&gt;
   class Zap&lt;br /&gt;
    include Foo&lt;br /&gt;
    include Test&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
If a call is made to Zap's bar method, the caller is unsure whether the result will be &amp;quot;hello&amp;quot; or &amp;quot;goodbye&amp;quot;.&lt;br /&gt;
   z = Zap.new&lt;br /&gt;
   puts z.bar&lt;br /&gt;
&lt;br /&gt;
The result of this call is:&lt;br /&gt;
&lt;br /&gt;
   goodbye&lt;br /&gt;
&lt;br /&gt;
This is because Ruby will first search the last module included, and continue in a descending order. The method that is invoked may not be the method that the caller expected to run. Therefore, precaution to be taken within the class to eliminate ambiguity.&lt;br /&gt;
&lt;br /&gt;
== 2. Using Namespaces to Avoid Conflict ==&lt;br /&gt;
Using namespaces within the modules will make the method names unique and help disambiguate any conflicts. The namespace is created simply by prefixing the method name with the module name and a period (i.e., Module.method).&lt;br /&gt;
&lt;br /&gt;
Let's modify the previous example to include namespaces.&lt;br /&gt;
&lt;br /&gt;
  module Foo&lt;br /&gt;
     def Foo.bar #the method name is qualified&lt;br /&gt;
        &amp;quot;hello&amp;quot;&lt;br /&gt;
     end&lt;br /&gt;
  end&lt;br /&gt;
  module Test&lt;br /&gt;
     def Test.bar #the method name is qualified&lt;br /&gt;
        &amp;quot;goodbye&amp;quot;&lt;br /&gt;
     end&lt;br /&gt;
  end   &lt;br /&gt;
  class Zap&lt;br /&gt;
   include Foo&lt;br /&gt;
   include Test&lt;br /&gt;
&lt;br /&gt;
Zap class defines a method called bar, and makes a call to both bar methods in Foo and Test. If the programmer knew for sure that any call to the bar method should invoke only one of the modules, this could be handled here by only calling the module of choice.&lt;br /&gt;
   def bar &lt;br /&gt;
      puts Foo.bar&lt;br /&gt;
      puts Test.bar&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
   z = Zap.new&lt;br /&gt;
   puts z.bar&lt;br /&gt;
&lt;br /&gt;
This will produce:&lt;br /&gt;
   Hello&lt;br /&gt;
   Goodbye&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
class RubyTest  &lt;br /&gt;
  include Burp  &lt;br /&gt;
  alias :Burp_who_am_i :who_am_i   &lt;br /&gt;
  include Debug&lt;br /&gt;
  alias :Debug_who_am_i :who_am_i   &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
rt = RubyTest.new&lt;br /&gt;
puts rt.Debug_who_am_i&lt;br /&gt;
puts rt.Burp_who_am_i&lt;br /&gt;
&lt;br /&gt;
== 3. Using Aliases to Avoid Conflict ==&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
&lt;br /&gt;
As illustrated in the examples, there are at least two ways to ensure that your class runs as expected even when using modules with method name conflicts.&lt;br /&gt;
&lt;br /&gt;
The two approaches are:&lt;br /&gt;
#using namespaces&lt;br /&gt;
#using an alias&lt;br /&gt;
&lt;br /&gt;
In our opinion, using namespaces is the better approach. Inheriting from the module and using the qualified names to avoid conflicts is a more efficient OO design. It is also easier to read and maintain because in viewing the call, a reader will immediately gather the expected behavior of the call, as opposed to finding the alias definition and trying to make the connection. &lt;br /&gt;
&lt;br /&gt;
With the alias approach, the inheritance is limited and the programmer will need to constantly update the list of aliases for methods needed as they arise.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
 &lt;br /&gt;
#[http://www.recentrambles.com/pragmatic/view/69 Modules, Mixins, and Inheritance]&lt;br /&gt;
#[http://www.rubyist.net/~slagell/ruby/modules.html Ruby User's Guide]&lt;br /&gt;
#[http://rubyforge.org/docman/view.php/735/309/readme.html 'use' package readme]&lt;/div&gt;</summary>
		<author><name>Arjones3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5422</id>
		<title>CSC/ECE 517 Fall 2007/wiki1b 1 as</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5422"/>
		<updated>2007-10-10T19:41:08Z</updated>

		<summary type="html">&lt;p&gt;Arjones3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background =&lt;br /&gt;
&lt;br /&gt;
Ruby does not implement true multiple inheritance, but provides Modules as a way to reuse chunks of codes in many classes. &lt;br /&gt;
&lt;br /&gt;
Modules, unlike like classes in OO languages such as Java, cannot be instantiated or sub-classed. Modules are included in class definitions by using the ‘include’ method which will mix that module’s methods into the calling class. The module’s methods will then become instance methods. &lt;br /&gt;
&lt;br /&gt;
A class can include several modules within the class definition. However, a problem exists when a class includes multiple modules that contain a method of the same name. Since the class will have access to both of these methods, unexpected behavior may occur when the names of the methods conflict.&lt;br /&gt;
&lt;br /&gt;
Let’s look at a few examples!&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
&lt;br /&gt;
== 1. Method Name Conflict ==&lt;br /&gt;
&lt;br /&gt;
In the following example, we have the class Zap. This class includes the module Foo and the module Test. Both modules contain a method named bar.&lt;br /&gt;
   module Foo&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;hello&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
   module Test&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;goodbye&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end   &lt;br /&gt;
   class Zap&lt;br /&gt;
    include Foo&lt;br /&gt;
    include Test&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
If a call is made to Zap's bar method, the caller is unsure whether the result will be &amp;quot;hello&amp;quot; or &amp;quot;goodbye&amp;quot;.&lt;br /&gt;
   z = Zap.new&lt;br /&gt;
   puts z.bar&lt;br /&gt;
&lt;br /&gt;
The result of this call is:&lt;br /&gt;
&lt;br /&gt;
   goodbye&lt;br /&gt;
&lt;br /&gt;
This is because Ruby will first search the last module included, and continue in a descending order. The method that is invoked may not be the method that the caller expected to run. Therefore, precaution to be taken within the class to eliminate ambiguity.&lt;br /&gt;
&lt;br /&gt;
== 2. Using Namespaces to Avoid Conflict ==&lt;br /&gt;
&lt;br /&gt;
  module Grouchy&lt;br /&gt;
   def Grouchy.say_hello(string='somebody')&lt;br /&gt;
    puts &amp;quot;#{string} says: Don't tell me what to do!&amp;quot; &lt;br /&gt;
   end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
Grouchy.say_hello is the class method of the module Grouchy&lt;br /&gt;
We have a class Person which includes the module Grouchy&lt;br /&gt;
&lt;br /&gt;
class Person&lt;br /&gt;
&lt;br /&gt;
  require &amp;quot;grouchy&amp;quot; &lt;br /&gt;
&lt;br /&gt;
  attr_accessor :name&lt;br /&gt;
&lt;br /&gt;
  def initialize(name='somebody')&lt;br /&gt;
    @name = name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
person = Person.new('Charlie')&lt;br /&gt;
Grouchy.say_hello(person.name)&lt;br /&gt;
&lt;br /&gt;
It products: &lt;br /&gt;
&lt;br /&gt;
Charlie says: Don't tell me what to do! &lt;br /&gt;
&lt;br /&gt;
When facing the name conflicts problem, we can use namespace to tell the different of two methods. &lt;br /&gt;
&lt;br /&gt;
module Debug&lt;br /&gt;
  def Debug.who_am_i&lt;br /&gt;
    &amp;quot;Debug&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
module Burp&lt;br /&gt;
  def Burp.who_am_i&lt;br /&gt;
    &amp;quot;Burp&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
class EightTrack&lt;br /&gt;
  include Debug&lt;br /&gt;
  include Burp&lt;br /&gt;
  def who_am_i&lt;br /&gt;
    puts Burp.who_am_i&lt;br /&gt;
    puts Debug.who_am_i    &lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
et = EightTrack.new&lt;br /&gt;
&lt;br /&gt;
et.who_am_i&lt;br /&gt;
&lt;br /&gt;
It products:&lt;br /&gt;
&lt;br /&gt;
Burp&lt;br /&gt;
Debug&lt;br /&gt;
&lt;br /&gt;
Another way is using the alias method, we still have two modules have the same name method who_am_i.&lt;br /&gt;
module Debug&lt;br /&gt;
  def who_am_i&lt;br /&gt;
    &amp;quot;Debug&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
module Burp&lt;br /&gt;
  def who_am_i&lt;br /&gt;
    &amp;quot;Burp&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
class RubyTest  &lt;br /&gt;
  include Burp  &lt;br /&gt;
  alias :Burp_who_am_i :who_am_i   &lt;br /&gt;
  include Debug&lt;br /&gt;
  alias :Debug_who_am_i :who_am_i   &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
rt = RubyTest.new&lt;br /&gt;
puts rt.Debug_who_am_i&lt;br /&gt;
puts rt.Burp_who_am_i&lt;br /&gt;
&lt;br /&gt;
== 3. Using Aliases to Avoid Conflict ==&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
&lt;br /&gt;
As illustrated in the examples, there are at least two ways to ensure that your class runs as expected even when using modules with method name conflicts.&lt;br /&gt;
&lt;br /&gt;
The two approaches are:&lt;br /&gt;
#using namespaces&lt;br /&gt;
#using an alias&lt;br /&gt;
&lt;br /&gt;
In our opinion, using namespaces is the better approach. Inheriting from the module and using the qualified names to avoid conflicts is a more efficient OO design. It is also easier to read and maintain because in viewing the call, a reader will immediately gather the expected behavior of the call, as opposed to finding the alias definition and trying to make the connection. &lt;br /&gt;
&lt;br /&gt;
With the alias approach, the inheritance is limited and the programmer will need to constantly update the list of aliases for methods needed as they arise.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
 &lt;br /&gt;
#[http://www.recentrambles.com/pragmatic/view/69 Modules, Mixins, and Inheritance]&lt;br /&gt;
#[http://www.rubyist.net/~slagell/ruby/modules.html Ruby User's Guide]&lt;/div&gt;</summary>
		<author><name>Arjones3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5416</id>
		<title>CSC/ECE 517 Fall 2007/wiki1b 1 as</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5416"/>
		<updated>2007-10-10T19:32:56Z</updated>

		<summary type="html">&lt;p&gt;Arjones3: /* 1. Method Name Conflict */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background =&lt;br /&gt;
&lt;br /&gt;
Ruby does not implement true multiple inheritance, but provides Modules as a way to reuse chunks of codes in many classes. &lt;br /&gt;
&lt;br /&gt;
Modules, unlike like classes in OO languages such as Java, cannot be instantiated or sub-classed. Modules are included in class definitions by using the ‘include’ method which will mix that module’s methods into the calling class. The module’s methods will then become instance methods. &lt;br /&gt;
&lt;br /&gt;
A class can include several modules within the class definition. However, a problem exists when a class includes multiple modules that contain a method of the same name. Since the class will have access to both of these methods, unexpected behavior may occur when the names of the methods conflict.&lt;br /&gt;
&lt;br /&gt;
Let’s look at a few examples!&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
&lt;br /&gt;
== 1. Method Name Conflict ==&lt;br /&gt;
   module Foo&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;hello&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
      def baz&lt;br /&gt;
         &amp;quot;world&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
   module Test&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;goodbye&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
      def blah&lt;br /&gt;
         &amp;quot;new york&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end   &lt;br /&gt;
   class Zap&lt;br /&gt;
    include Foo&lt;br /&gt;
    include Test&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
   z = Zap.new&lt;br /&gt;
   puts z.bar&lt;br /&gt;
&lt;br /&gt;
We might expect it come out &amp;quot;Hello&amp;quot; but it producces:&lt;br /&gt;
&lt;br /&gt;
   goodbye&lt;br /&gt;
&lt;br /&gt;
== 2. Using Namespaces to Avoid Conflict ==&lt;br /&gt;
&lt;br /&gt;
  module Grouchy&lt;br /&gt;
   def Grouchy.say_hello(string='somebody')&lt;br /&gt;
    puts &amp;quot;#{string} says: Don't tell me what to do!&amp;quot; &lt;br /&gt;
   end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
Grouchy.say_hello is the class method of the module Grouchy&lt;br /&gt;
We have a class Person which includes the module Grouchy&lt;br /&gt;
&lt;br /&gt;
class Person&lt;br /&gt;
&lt;br /&gt;
  require &amp;quot;grouchy&amp;quot; &lt;br /&gt;
&lt;br /&gt;
  attr_accessor :name&lt;br /&gt;
&lt;br /&gt;
  def initialize(name='somebody')&lt;br /&gt;
    @name = name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
person = Person.new('Charlie')&lt;br /&gt;
Grouchy.say_hello(person.name)&lt;br /&gt;
&lt;br /&gt;
It products: &lt;br /&gt;
&lt;br /&gt;
Charlie says: Don't tell me what to do! &lt;br /&gt;
&lt;br /&gt;
When facing the name conflicts problem, we can use namespace to tell the different of two methods. &lt;br /&gt;
&lt;br /&gt;
module Debug&lt;br /&gt;
  def Debug.who_am_i&lt;br /&gt;
    &amp;quot;Debug&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
module Burp&lt;br /&gt;
  def Burp.who_am_i&lt;br /&gt;
    &amp;quot;Burp&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
class EightTrack&lt;br /&gt;
  include Debug&lt;br /&gt;
  include Burp&lt;br /&gt;
  def who_am_i&lt;br /&gt;
    puts Burp.who_am_i&lt;br /&gt;
    puts Debug.who_am_i    &lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
et = EightTrack.new&lt;br /&gt;
&lt;br /&gt;
et.who_am_i&lt;br /&gt;
&lt;br /&gt;
It products:&lt;br /&gt;
&lt;br /&gt;
Burp&lt;br /&gt;
Debug&lt;br /&gt;
&lt;br /&gt;
Another way is using the alias method, we still have two modules have the same name method who_am_i.&lt;br /&gt;
module Debug&lt;br /&gt;
  def who_am_i&lt;br /&gt;
    &amp;quot;Debug&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
module Burp&lt;br /&gt;
  def who_am_i&lt;br /&gt;
    &amp;quot;Burp&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
class RubyTest  &lt;br /&gt;
  include Burp  &lt;br /&gt;
  alias :Burp_who_am_i :who_am_i   &lt;br /&gt;
  include Debug&lt;br /&gt;
  alias :Debug_who_am_i :who_am_i   &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
rt = RubyTest.new&lt;br /&gt;
puts rt.Debug_who_am_i&lt;br /&gt;
puts rt.Burp_who_am_i&lt;br /&gt;
&lt;br /&gt;
== 3. Using Aliases to Avoid Conflict ==&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
&lt;br /&gt;
As illustrated in the examples, there are at least two ways to ensure that your class runs as expected even when using modules with method name conflicts.&lt;br /&gt;
&lt;br /&gt;
The two approaches are:&lt;br /&gt;
#using namespaces&lt;br /&gt;
#using an alias&lt;br /&gt;
&lt;br /&gt;
In our opinion, using namespaces is the better approach. Inheriting from the module and using the qualified names to avoid conflicts is a more efficient OO design. It is also easier to read and maintain because in viewing the call, a reader will immediately gather the expected behavior of the call, as opposed to finding the alias definition and trying to make the connection. &lt;br /&gt;
&lt;br /&gt;
With the alias approach, the inheritance is limited and the programmer will need to constantly update the list of aliases for methods needed as they arise.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
 &lt;br /&gt;
#[http://www.recentrambles.com/pragmatic/view/69 Modules, Mixins, and Inheritance]&lt;br /&gt;
#[http://www.rubyist.net/~slagell/ruby/modules.html Ruby User's Guide]&lt;/div&gt;</summary>
		<author><name>Arjones3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5414</id>
		<title>CSC/ECE 517 Fall 2007/wiki1b 1 as</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5414"/>
		<updated>2007-10-10T19:31:23Z</updated>

		<summary type="html">&lt;p&gt;Arjones3: /* 2. Using Namespaces to Avoid Conflict */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background =&lt;br /&gt;
&lt;br /&gt;
Ruby does not implement true multiple inheritance, but provides Modules as a way to reuse chunks of codes in many classes. &lt;br /&gt;
&lt;br /&gt;
Modules, unlike like classes in OO languages such as Java, cannot be instantiated or sub-classed. Modules are included in class definitions by using the ‘include’ method which will mix that module’s methods into the calling class. The module’s methods will then become instance methods. &lt;br /&gt;
&lt;br /&gt;
A class can include several modules within the class definition. However, a problem exists when a class includes multiple modules that contain a method of the same name. Since the class will have access to both of these methods, unexpected behavior may occur when the names of the methods conflict.&lt;br /&gt;
&lt;br /&gt;
Let’s look at a few examples!&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
&lt;br /&gt;
== 1. Method Name Conflict ==&lt;br /&gt;
module Foo&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;hello&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
      def baz&lt;br /&gt;
         &amp;quot;world&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
   module Test&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;goodbye&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
      def blah&lt;br /&gt;
         &amp;quot;new york&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end   &lt;br /&gt;
   class Zap&lt;br /&gt;
    include Foo&lt;br /&gt;
    include Test&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
z = Zap.new&lt;br /&gt;
puts z.bar&lt;br /&gt;
&lt;br /&gt;
We might expect it come out &amp;quot;Hello&amp;quot; but it products:&lt;br /&gt;
&lt;br /&gt;
goodbye&lt;br /&gt;
&lt;br /&gt;
== 2. Using Namespaces to Avoid Conflict ==&lt;br /&gt;
&lt;br /&gt;
  module Grouchy&lt;br /&gt;
   def Grouchy.say_hello(string='somebody')&lt;br /&gt;
    puts &amp;quot;#{string} says: Don't tell me what to do!&amp;quot; &lt;br /&gt;
   end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
Grouchy.say_hello is the class method of the module Grouchy&lt;br /&gt;
We have a class Person which includes the module Grouchy&lt;br /&gt;
&lt;br /&gt;
class Person&lt;br /&gt;
&lt;br /&gt;
  require &amp;quot;grouchy&amp;quot; &lt;br /&gt;
&lt;br /&gt;
  attr_accessor :name&lt;br /&gt;
&lt;br /&gt;
  def initialize(name='somebody')&lt;br /&gt;
    @name = name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
person = Person.new('Charlie')&lt;br /&gt;
Grouchy.say_hello(person.name)&lt;br /&gt;
&lt;br /&gt;
It products: &lt;br /&gt;
&lt;br /&gt;
Charlie says: Don't tell me what to do! &lt;br /&gt;
&lt;br /&gt;
When facing the name conflicts problem, we can use namespace to tell the different of two methods. &lt;br /&gt;
&lt;br /&gt;
module Debug&lt;br /&gt;
  def Debug.who_am_i&lt;br /&gt;
    &amp;quot;Debug&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
module Burp&lt;br /&gt;
  def Burp.who_am_i&lt;br /&gt;
    &amp;quot;Burp&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
class EightTrack&lt;br /&gt;
  include Debug&lt;br /&gt;
  include Burp&lt;br /&gt;
  def who_am_i&lt;br /&gt;
    puts Burp.who_am_i&lt;br /&gt;
    puts Debug.who_am_i    &lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
et = EightTrack.new&lt;br /&gt;
&lt;br /&gt;
et.who_am_i&lt;br /&gt;
&lt;br /&gt;
It products:&lt;br /&gt;
&lt;br /&gt;
Burp&lt;br /&gt;
Debug&lt;br /&gt;
&lt;br /&gt;
Another way is using the alias method, we still have two modules have the same name method who_am_i.&lt;br /&gt;
module Debug&lt;br /&gt;
  def who_am_i&lt;br /&gt;
    &amp;quot;Debug&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
module Burp&lt;br /&gt;
  def who_am_i&lt;br /&gt;
    &amp;quot;Burp&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
class RubyTest  &lt;br /&gt;
  include Burp  &lt;br /&gt;
  alias :Burp_who_am_i :who_am_i   &lt;br /&gt;
  include Debug&lt;br /&gt;
  alias :Debug_who_am_i :who_am_i   &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
rt = RubyTest.new&lt;br /&gt;
puts rt.Debug_who_am_i&lt;br /&gt;
puts rt.Burp_who_am_i&lt;br /&gt;
&lt;br /&gt;
== 3. Using Aliases to Avoid Conflict ==&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
&lt;br /&gt;
As illustrated in the examples, there are at least two ways to ensure that your class runs as expected even when using modules with method name conflicts.&lt;br /&gt;
&lt;br /&gt;
The two approaches are:&lt;br /&gt;
#using namespaces&lt;br /&gt;
#using an alias&lt;br /&gt;
&lt;br /&gt;
In our opinion, using namespaces is the better approach. Inheriting from the module and using the qualified names to avoid conflicts is a more efficient OO design. It is also easier to read and maintain because in viewing the call, a reader will immediately gather the expected behavior of the call, as opposed to finding the alias definition and trying to make the connection. &lt;br /&gt;
&lt;br /&gt;
With the alias approach, the inheritance is limited and the programmer will need to constantly update the list of aliases for methods needed as they arise.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
 &lt;br /&gt;
#[http://www.recentrambles.com/pragmatic/view/69 Modules, Mixins, and Inheritance]&lt;br /&gt;
#[http://www.rubyist.net/~slagell/ruby/modules.html Ruby User's Guide]&lt;/div&gt;</summary>
		<author><name>Arjones3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5403</id>
		<title>CSC/ECE 517 Fall 2007/wiki1b 1 as</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5403"/>
		<updated>2007-10-10T19:23:06Z</updated>

		<summary type="html">&lt;p&gt;Arjones3: /* 1. Using Namespaces */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background =&lt;br /&gt;
&lt;br /&gt;
Ruby does not implement true multiple inheritance, but provides Modules as a way to reuse chunks of codes in many classes. &lt;br /&gt;
&lt;br /&gt;
Modules, unlike like classes in OO languages such as Java, cannot be instantiated or sub-classed. Modules are included in class definitions by using the ‘include’ method which will mix that module’s methods into the calling class. The module’s methods will then become instance methods. &lt;br /&gt;
&lt;br /&gt;
A class can include several modules within the class definition. However, a problem exists when a class includes multiple modules that contain a method of the same name. Since the class will have access to both of these methods, unexpected behavior may occur when the names of the methods conflict.&lt;br /&gt;
&lt;br /&gt;
Let’s look at a few examples!&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
&lt;br /&gt;
== 1. Method Name Conflict ==&lt;br /&gt;
&lt;br /&gt;
== 2. Using Namespaces to Avoid Conflict ==&lt;br /&gt;
&lt;br /&gt;
module Grouchy&lt;br /&gt;
 def Grouchy.say_hello(string='somebody')&lt;br /&gt;
  puts &amp;quot;#{string} says: Don't tell me what to do!&amp;quot; &lt;br /&gt;
 end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
Grouchy.say_hello is the class method of the module Grouchy&lt;br /&gt;
We have a class Person which includes the module Grouchy&lt;br /&gt;
&lt;br /&gt;
class Person&lt;br /&gt;
&lt;br /&gt;
  require &amp;quot;grouchy&amp;quot; &lt;br /&gt;
&lt;br /&gt;
  attr_accessor :name&lt;br /&gt;
&lt;br /&gt;
  def initialize(name='somebody')&lt;br /&gt;
    @name = name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
person = Person.new('Charlie')&lt;br /&gt;
Grouchy.say_hello(person.name)&lt;br /&gt;
&lt;br /&gt;
It products: &lt;br /&gt;
&lt;br /&gt;
Charlie says: Don't tell me what to do! &lt;br /&gt;
&lt;br /&gt;
When facing the name conflicts problem, we can use namespace to tell the different of two methods. &lt;br /&gt;
&lt;br /&gt;
module Debug&lt;br /&gt;
  def Debug.who_am_i&lt;br /&gt;
    &amp;quot;Debug&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
module Burp&lt;br /&gt;
  def Burp.who_am_i&lt;br /&gt;
    &amp;quot;Burp&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
class EightTrack&lt;br /&gt;
  include Debug&lt;br /&gt;
  include Burp&lt;br /&gt;
  def who_am_i&lt;br /&gt;
    puts Burp.who_am_i&lt;br /&gt;
    puts Debug.who_am_i    &lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
et = EightTrack.new&lt;br /&gt;
&lt;br /&gt;
et.who_am_i&lt;br /&gt;
&lt;br /&gt;
It products:&lt;br /&gt;
&lt;br /&gt;
Burp&lt;br /&gt;
Debug&lt;br /&gt;
&lt;br /&gt;
Another way is using the alias method, we still have two modules have the same name method who_am_i.&lt;br /&gt;
module Debug&lt;br /&gt;
  def who_am_i&lt;br /&gt;
    &amp;quot;Debug&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
module Burp&lt;br /&gt;
  def who_am_i&lt;br /&gt;
    &amp;quot;Burp&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
class RubyTest  &lt;br /&gt;
  include Burp  &lt;br /&gt;
  alias :Burp_who_am_i :who_am_i   &lt;br /&gt;
  include Debug&lt;br /&gt;
  alias :Debug_who_am_i :who_am_i   &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
rt = RubyTest.new&lt;br /&gt;
puts rt.Debug_who_am_i&lt;br /&gt;
puts rt.Burp_who_am_i&lt;br /&gt;
&lt;br /&gt;
== 3. Using Aliases to Avoid Conflict ==&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
&lt;br /&gt;
As illustrated in the examples, there are at least two ways to ensure that your class runs as expected even when using modules with method name conflicts.&lt;br /&gt;
&lt;br /&gt;
The two approaches are:&lt;br /&gt;
#using namespaces&lt;br /&gt;
#using an alias&lt;br /&gt;
&lt;br /&gt;
In our opinion, using namespaces is the better approach. Inheriting from the module and using the qualified names to avoid conflicts is a more efficient OO design. It is also easier to read and maintain because in viewing the call, a reader will immediately gather the expected behavior of the call, as opposed to finding the alias definition and trying to make the connection. &lt;br /&gt;
&lt;br /&gt;
With the alias approach, the inheritance is limited and the programmer will need to constantly update the list of aliases for methods needed as they arise.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
 &lt;br /&gt;
#[http://www.recentrambles.com/pragmatic/view/69 Modules, Mixins, and Inheritance]&lt;br /&gt;
#[http://www.rubyist.net/~slagell/ruby/modules.html Ruby User's Guide]&lt;/div&gt;</summary>
		<author><name>Arjones3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5402</id>
		<title>CSC/ECE 517 Fall 2007/wiki1b 1 as</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5402"/>
		<updated>2007-10-10T19:21:01Z</updated>

		<summary type="html">&lt;p&gt;Arjones3: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background =&lt;br /&gt;
&lt;br /&gt;
Ruby does not implement true multiple inheritance, but provides Modules as a way to reuse chunks of codes in many classes. &lt;br /&gt;
&lt;br /&gt;
Modules, unlike like classes in OO languages such as Java, cannot be instantiated or sub-classed. Modules are included in class definitions by using the ‘include’ method which will mix that module’s methods into the calling class. The module’s methods will then become instance methods. &lt;br /&gt;
&lt;br /&gt;
A class can include several modules within the class definition. However, a problem exists when a class includes multiple modules that contain a method of the same name. Since the class will have access to both of these methods, unexpected behavior may occur when the names of the methods conflict.&lt;br /&gt;
&lt;br /&gt;
Let’s look at a few examples!&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
&lt;br /&gt;
== 1. Using Namespaces ==&lt;br /&gt;
&lt;br /&gt;
module Grouchy&lt;br /&gt;
 def Grouchy.say_hello(string='somebody')&lt;br /&gt;
  puts &amp;quot;#{string} says: Don't tell me what to do!&amp;quot; &lt;br /&gt;
 end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
Grouchy.say_hello is the class method of the module Grouchy&lt;br /&gt;
We have a class Person which includes the module Grouchy&lt;br /&gt;
&lt;br /&gt;
class Person&lt;br /&gt;
&lt;br /&gt;
  require &amp;quot;grouchy&amp;quot; &lt;br /&gt;
&lt;br /&gt;
  attr_accessor :name&lt;br /&gt;
&lt;br /&gt;
  def initialize(name='somebody')&lt;br /&gt;
    @name = name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
person = Person.new('Charlie')&lt;br /&gt;
Grouchy.say_hello(person.name)&lt;br /&gt;
&lt;br /&gt;
It products: &lt;br /&gt;
&lt;br /&gt;
Charlie says: Don't tell me what to do! &lt;br /&gt;
&lt;br /&gt;
When facing the name conflicts problem, we can use namespace to tell the different of two methods. &lt;br /&gt;
&lt;br /&gt;
module Debug&lt;br /&gt;
  def Debug.who_am_i&lt;br /&gt;
    &amp;quot;Debug&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
module Burp&lt;br /&gt;
  def Burp.who_am_i&lt;br /&gt;
    &amp;quot;Burp&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
class EightTrack&lt;br /&gt;
  include Debug&lt;br /&gt;
  include Burp&lt;br /&gt;
  def who_am_i&lt;br /&gt;
    puts Burp.who_am_i&lt;br /&gt;
    puts Debug.who_am_i    &lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
et = EightTrack.new&lt;br /&gt;
&lt;br /&gt;
et.who_am_i&lt;br /&gt;
&lt;br /&gt;
It products:&lt;br /&gt;
&lt;br /&gt;
Burp&lt;br /&gt;
Debug&lt;br /&gt;
&lt;br /&gt;
Another way is using the alias method, we still have two modules have the same name method who_am_i.&lt;br /&gt;
module Debug&lt;br /&gt;
  def who_am_i&lt;br /&gt;
    &amp;quot;Debug&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
module Burp&lt;br /&gt;
  def who_am_i&lt;br /&gt;
    &amp;quot;Burp&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
class RubyTest  &lt;br /&gt;
  include Burp  &lt;br /&gt;
  alias :Burp_who_am_i :who_am_i   &lt;br /&gt;
  include Debug&lt;br /&gt;
  alias :Debug_who_am_i :who_am_i   &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
rt = RubyTest.new&lt;br /&gt;
puts rt.Debug_who_am_i&lt;br /&gt;
puts rt.Burp_who_am_i&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
&lt;br /&gt;
As illustrated in the examples, there are at least two ways to ensure that your class runs as expected even when using modules with method name conflicts.&lt;br /&gt;
&lt;br /&gt;
The two approaches are:&lt;br /&gt;
#using namespaces&lt;br /&gt;
#using an alias&lt;br /&gt;
&lt;br /&gt;
In our opinion, using namespaces is the better approach. Inheriting from the module and using the qualified names to avoid conflicts is a more efficient OO design. It is also easier to read and maintain because in viewing the call, a reader will immediately gather the expected behavior of the call, as opposed to finding the alias definition and trying to make the connection. &lt;br /&gt;
&lt;br /&gt;
With the alias approach, the inheritance is limited and the programmer will need to constantly update the list of aliases for methods needed as they arise.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
 &lt;br /&gt;
#[http://www.recentrambles.com/pragmatic/view/69 Modules, Mixins, and Inheritance]&lt;br /&gt;
#[http://www.rubyist.net/~slagell/ruby/modules.html Ruby User's Guide]&lt;/div&gt;</summary>
		<author><name>Arjones3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5401</id>
		<title>CSC/ECE 517 Fall 2007/wiki1b 1 as</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5401"/>
		<updated>2007-10-10T19:19:42Z</updated>

		<summary type="html">&lt;p&gt;Arjones3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background =&lt;br /&gt;
&lt;br /&gt;
Ruby does not implement true multiple inheritance, but provides Modules as a way to reuse chunks of codes in many classes. &lt;br /&gt;
&lt;br /&gt;
Modules, unlike like classes in OO languages such as Java, cannot be instantiated or sub-classed. Modules are included in class definitions by using the ‘include’ method which will mix that module’s methods into the calling class. The module’s methods will then become instance methods. &lt;br /&gt;
&lt;br /&gt;
A class can include several modules within the class definition. However, a problem exists when a class includes multiple modules that contain a method of the same name. Since the class will have access to both of these methods, unexpected behavior may occur when the names of the methods conflict.&lt;br /&gt;
&lt;br /&gt;
Let’s look at a few examples!&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
&lt;br /&gt;
== 1. Using Namespaces ==&lt;br /&gt;
&lt;br /&gt;
module Grouchy&lt;br /&gt;
 def Grouchy.say_hello(string='somebody')&lt;br /&gt;
  puts &amp;quot;#{string} says: Don't tell me what to do!&amp;quot; &lt;br /&gt;
 end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
Grouchy.say_hello is the class method of the module Grouchy&lt;br /&gt;
We have a class Person which includes the module Grouchy&lt;br /&gt;
&lt;br /&gt;
class Person&lt;br /&gt;
&lt;br /&gt;
  require &amp;quot;grouchy&amp;quot; &lt;br /&gt;
&lt;br /&gt;
  attr_accessor :name&lt;br /&gt;
&lt;br /&gt;
  def initialize(name='somebody')&lt;br /&gt;
    @name = name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
person = Person.new('Charlie')&lt;br /&gt;
Grouchy.say_hello(person.name)&lt;br /&gt;
&lt;br /&gt;
It products: &lt;br /&gt;
&lt;br /&gt;
Charlie says: Don't tell me what to do! &lt;br /&gt;
&lt;br /&gt;
When facing the name conflicts problem, we can use namespace to tell the different of two methods. &lt;br /&gt;
&lt;br /&gt;
module Debug&lt;br /&gt;
  def Debug.who_am_i&lt;br /&gt;
    &amp;quot;Debug&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
module Burp&lt;br /&gt;
  def Burp.who_am_i&lt;br /&gt;
    &amp;quot;Burp&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
class EightTrack&lt;br /&gt;
  include Debug&lt;br /&gt;
  include Burp&lt;br /&gt;
  def who_am_i&lt;br /&gt;
    puts Burp.who_am_i&lt;br /&gt;
    puts Debug.who_am_i    &lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
et = EightTrack.new&lt;br /&gt;
&lt;br /&gt;
et.who_am_i&lt;br /&gt;
&lt;br /&gt;
It products:&lt;br /&gt;
&lt;br /&gt;
Burp&lt;br /&gt;
Debug&lt;br /&gt;
&lt;br /&gt;
Another way is using the alias method, we still have two modules have the same name method who_am_i.&lt;br /&gt;
module Debug&lt;br /&gt;
  def who_am_i&lt;br /&gt;
    &amp;quot;Debug&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
module Burp&lt;br /&gt;
  def who_am_i&lt;br /&gt;
    &amp;quot;Burp&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
class RubyTest  &lt;br /&gt;
  include Burp  &lt;br /&gt;
  alias :Burp_who_am_i :who_am_i   &lt;br /&gt;
  include Debug&lt;br /&gt;
  alias :Debug_who_am_i :who_am_i   &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
rt = RubyTest.new&lt;br /&gt;
puts rt.Debug_who_am_i&lt;br /&gt;
puts rt.Burp_who_am_i&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
&lt;br /&gt;
As illustrated in the examples, there are at least two ways to ensure that your class runs as expected even when using modules with method name conflicts.&lt;br /&gt;
&lt;br /&gt;
The two approaches are:&lt;br /&gt;
#calling the module's methods using qualified names&lt;br /&gt;
#using an alias&lt;br /&gt;
&lt;br /&gt;
In our opinion, the first approach, calling the module's methods using qualified names, is the better approach. Inheriting from the module and using the qualified names to avoid conflicts is a more efficient OO design. It is also easier to read and maintain because in viewing the call, a reader will immediately gather the expected behavior of the call, as opposed to finding the alias definition and trying to make the connection. &lt;br /&gt;
&lt;br /&gt;
With the alias approach, the inheritance is limited and the programmer will need to constantly update the list of aliases for methods needed as they arise.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
 &lt;br /&gt;
#[http://www.recentrambles.com/pragmatic/view/69 Modules, Mixins, and Inheritance]&lt;br /&gt;
#[http://www.rubyist.net/~slagell/ruby/modules.html Ruby User's Guide]&lt;/div&gt;</summary>
		<author><name>Arjones3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5399</id>
		<title>CSC/ECE 517 Fall 2007/wiki1b 1 as</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5399"/>
		<updated>2007-10-10T19:17:52Z</updated>

		<summary type="html">&lt;p&gt;Arjones3: /* Background */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
Ruby does not implement true multiple inheritance, but provides Modules as a way to reuse chunks of codes in many classes. &lt;br /&gt;
&lt;br /&gt;
Modules, unlike like classes in OO languages such as Java, cannot be instantiated or sub-classed. Modules are included in class definitions by using the ‘include’ method which will mix that module’s methods into the calling class. The module’s methods will then become instance methods. &lt;br /&gt;
&lt;br /&gt;
A class can include several modules within the class definition. However, a problem exists when a class includes multiple modules that contain a method of the same name. Since the class will have access to both of these methods, unexpected behavior may occur when the names of the methods conflict.&lt;br /&gt;
&lt;br /&gt;
Let’s look at a few examples!&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
= 1. Using Namespaces =&lt;br /&gt;
&lt;br /&gt;
module Grouchy&lt;br /&gt;
 def Grouchy.say_hello(string='somebody')&lt;br /&gt;
  puts &amp;quot;#{string} says: Don't tell me what to do!&amp;quot; &lt;br /&gt;
 end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
Grouchy.say_hello is the class method of the module Grouchy&lt;br /&gt;
We have a class Person which includes the module Grouchy&lt;br /&gt;
&lt;br /&gt;
class Person&lt;br /&gt;
&lt;br /&gt;
  require &amp;quot;grouchy&amp;quot; &lt;br /&gt;
&lt;br /&gt;
  attr_accessor :name&lt;br /&gt;
&lt;br /&gt;
  def initialize(name='somebody')&lt;br /&gt;
    @name = name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
person = Person.new('Charlie')&lt;br /&gt;
Grouchy.say_hello(person.name)&lt;br /&gt;
&lt;br /&gt;
It products: &lt;br /&gt;
&lt;br /&gt;
Charlie says: Don't tell me what to do! &lt;br /&gt;
&lt;br /&gt;
When facing the name conflicts problem, we can use namespace to tell the different of two methods. &lt;br /&gt;
&lt;br /&gt;
module Debug&lt;br /&gt;
  def Debug.who_am_i&lt;br /&gt;
    &amp;quot;Debug&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
module Burp&lt;br /&gt;
  def Burp.who_am_i&lt;br /&gt;
    &amp;quot;Burp&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
class EightTrack&lt;br /&gt;
  include Debug&lt;br /&gt;
  include Burp&lt;br /&gt;
  def who_am_i&lt;br /&gt;
    puts Burp.who_am_i&lt;br /&gt;
    puts Debug.who_am_i    &lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
et = EightTrack.new&lt;br /&gt;
&lt;br /&gt;
et.who_am_i&lt;br /&gt;
&lt;br /&gt;
It products:&lt;br /&gt;
&lt;br /&gt;
Burp&lt;br /&gt;
Debug&lt;br /&gt;
&lt;br /&gt;
Another way is using the alias method, we still have two modules have the same name method who_am_i.&lt;br /&gt;
module Debug&lt;br /&gt;
  def who_am_i&lt;br /&gt;
    &amp;quot;Debug&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
module Burp&lt;br /&gt;
  def who_am_i&lt;br /&gt;
    &amp;quot;Burp&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
class RubyTest  &lt;br /&gt;
  include Burp  &lt;br /&gt;
  alias :Burp_who_am_i :who_am_i   &lt;br /&gt;
  include Debug&lt;br /&gt;
  alias :Debug_who_am_i :who_am_i   &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
rt = RubyTest.new&lt;br /&gt;
puts rt.Debug_who_am_i&lt;br /&gt;
puts rt.Burp_who_am_i&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
As illustrated in the examples, there are at least two ways to ensure that your class runs as expected even when using modules with method name conflicts.&lt;br /&gt;
&lt;br /&gt;
The two approaches are:&lt;br /&gt;
#calling the module's methods using qualified names&lt;br /&gt;
#using an alias&lt;br /&gt;
&lt;br /&gt;
In our opinion, the first approach, calling the module's methods using qualified names, is the better approach. Inheriting from the module and using the qualified names to avoid conflicts is a more efficient OO design. It is also easier to read and maintain because in viewing the call, a reader will immediately gather the expected behavior of the call, as opposed to finding the alias definition and trying to make the connection. &lt;br /&gt;
&lt;br /&gt;
With the alias approach, the inheritance is limited and the programmer will need to constantly update the list of aliases for methods needed as they arise.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
 &lt;br /&gt;
#[http://www.recentrambles.com/pragmatic/view/69 Modules, Mixins, and Inheritance]&lt;br /&gt;
#[http://www.rubyist.net/~slagell/ruby/modules.html Ruby User's Guide]&lt;/div&gt;</summary>
		<author><name>Arjones3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5398</id>
		<title>CSC/ECE 517 Fall 2007/wiki1b 1 as</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5398"/>
		<updated>2007-10-10T19:17:36Z</updated>

		<summary type="html">&lt;p&gt;Arjones3: /* Background */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background =&lt;br /&gt;
&lt;br /&gt;
Ruby does not implement true multiple inheritance, but provides Modules as a way to reuse chunks of codes in many classes. &lt;br /&gt;
&lt;br /&gt;
Modules, unlike like classes in OO languages such as Java, cannot be instantiated or sub-classed. Modules are included in class definitions by using the ‘include’ method which will mix that module’s methods into the calling class. The module’s methods will then become instance methods. &lt;br /&gt;
&lt;br /&gt;
A class can include several modules within the class definition. However, a problem exists when a class includes multiple modules that contain a method of the same name. Since the class will have access to both of these methods, unexpected behavior may occur when the names of the methods conflict.&lt;br /&gt;
&lt;br /&gt;
Let’s look at a few examples!&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
= 1. Using Namespaces =&lt;br /&gt;
&lt;br /&gt;
module Grouchy&lt;br /&gt;
 def Grouchy.say_hello(string='somebody')&lt;br /&gt;
  puts &amp;quot;#{string} says: Don't tell me what to do!&amp;quot; &lt;br /&gt;
 end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
Grouchy.say_hello is the class method of the module Grouchy&lt;br /&gt;
We have a class Person which includes the module Grouchy&lt;br /&gt;
&lt;br /&gt;
class Person&lt;br /&gt;
&lt;br /&gt;
  require &amp;quot;grouchy&amp;quot; &lt;br /&gt;
&lt;br /&gt;
  attr_accessor :name&lt;br /&gt;
&lt;br /&gt;
  def initialize(name='somebody')&lt;br /&gt;
    @name = name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
person = Person.new('Charlie')&lt;br /&gt;
Grouchy.say_hello(person.name)&lt;br /&gt;
&lt;br /&gt;
It products: &lt;br /&gt;
&lt;br /&gt;
Charlie says: Don't tell me what to do! &lt;br /&gt;
&lt;br /&gt;
When facing the name conflicts problem, we can use namespace to tell the different of two methods. &lt;br /&gt;
&lt;br /&gt;
module Debug&lt;br /&gt;
  def Debug.who_am_i&lt;br /&gt;
    &amp;quot;Debug&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
module Burp&lt;br /&gt;
  def Burp.who_am_i&lt;br /&gt;
    &amp;quot;Burp&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
class EightTrack&lt;br /&gt;
  include Debug&lt;br /&gt;
  include Burp&lt;br /&gt;
  def who_am_i&lt;br /&gt;
    puts Burp.who_am_i&lt;br /&gt;
    puts Debug.who_am_i    &lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
et = EightTrack.new&lt;br /&gt;
&lt;br /&gt;
et.who_am_i&lt;br /&gt;
&lt;br /&gt;
It products:&lt;br /&gt;
&lt;br /&gt;
Burp&lt;br /&gt;
Debug&lt;br /&gt;
&lt;br /&gt;
Another way is using the alias method, we still have two modules have the same name method who_am_i.&lt;br /&gt;
module Debug&lt;br /&gt;
  def who_am_i&lt;br /&gt;
    &amp;quot;Debug&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
module Burp&lt;br /&gt;
  def who_am_i&lt;br /&gt;
    &amp;quot;Burp&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
class RubyTest  &lt;br /&gt;
  include Burp  &lt;br /&gt;
  alias :Burp_who_am_i :who_am_i   &lt;br /&gt;
  include Debug&lt;br /&gt;
  alias :Debug_who_am_i :who_am_i   &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
rt = RubyTest.new&lt;br /&gt;
puts rt.Debug_who_am_i&lt;br /&gt;
puts rt.Burp_who_am_i&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
As illustrated in the examples, there are at least two ways to ensure that your class runs as expected even when using modules with method name conflicts.&lt;br /&gt;
&lt;br /&gt;
The two approaches are:&lt;br /&gt;
#calling the module's methods using qualified names&lt;br /&gt;
#using an alias&lt;br /&gt;
&lt;br /&gt;
In our opinion, the first approach, calling the module's methods using qualified names, is the better approach. Inheriting from the module and using the qualified names to avoid conflicts is a more efficient OO design. It is also easier to read and maintain because in viewing the call, a reader will immediately gather the expected behavior of the call, as opposed to finding the alias definition and trying to make the connection. &lt;br /&gt;
&lt;br /&gt;
With the alias approach, the inheritance is limited and the programmer will need to constantly update the list of aliases for methods needed as they arise.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
 &lt;br /&gt;
#[http://www.recentrambles.com/pragmatic/view/69 Modules, Mixins, and Inheritance]&lt;br /&gt;
#[http://www.rubyist.net/~slagell/ruby/modules.html Ruby User's Guide]&lt;/div&gt;</summary>
		<author><name>Arjones3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5397</id>
		<title>CSC/ECE 517 Fall 2007/wiki1b 1 as</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5397"/>
		<updated>2007-10-10T19:16:40Z</updated>

		<summary type="html">&lt;p&gt;Arjones3: /* Background */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
Ruby does not implement true multiple inheritance, but provides Modules as a way to reuse chunks of codes in many classes. &lt;br /&gt;
&lt;br /&gt;
Modules, unlike like classes in OO languages such as Java, cannot be instantiated or sub-classed. Modules are included in class definitions by using the ‘include’ method which will mix that module’s methods into the calling class. The module’s methods will then become instance methods. &lt;br /&gt;
&lt;br /&gt;
A class can include several modules within the class definition. However, a problem exists when a class includes multiple modules that contain a method of the same name. Since the class will have access to both of these methods, unexpected behavior may occur when the names of the methods conflict.&lt;br /&gt;
&lt;br /&gt;
Let’s look at a few examples!&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
= 1. Using Namespaces =&lt;br /&gt;
&lt;br /&gt;
module Grouchy&lt;br /&gt;
 def Grouchy.say_hello(string='somebody')&lt;br /&gt;
  puts &amp;quot;#{string} says: Don't tell me what to do!&amp;quot; &lt;br /&gt;
 end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
Grouchy.say_hello is the class method of the module Grouchy&lt;br /&gt;
We have a class Person which includes the module Grouchy&lt;br /&gt;
&lt;br /&gt;
class Person&lt;br /&gt;
&lt;br /&gt;
  require &amp;quot;grouchy&amp;quot; &lt;br /&gt;
&lt;br /&gt;
  attr_accessor :name&lt;br /&gt;
&lt;br /&gt;
  def initialize(name='somebody')&lt;br /&gt;
    @name = name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
person = Person.new('Charlie')&lt;br /&gt;
Grouchy.say_hello(person.name)&lt;br /&gt;
&lt;br /&gt;
It products: &lt;br /&gt;
&lt;br /&gt;
Charlie says: Don't tell me what to do! &lt;br /&gt;
&lt;br /&gt;
When facing the name conflicts problem, we can use namespace to tell the different of two methods. &lt;br /&gt;
&lt;br /&gt;
module Debug&lt;br /&gt;
  def Debug.who_am_i&lt;br /&gt;
    &amp;quot;Debug&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
module Burp&lt;br /&gt;
  def Burp.who_am_i&lt;br /&gt;
    &amp;quot;Burp&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
class EightTrack&lt;br /&gt;
  include Debug&lt;br /&gt;
  include Burp&lt;br /&gt;
  def who_am_i&lt;br /&gt;
    puts Burp.who_am_i&lt;br /&gt;
    puts Debug.who_am_i    &lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
et = EightTrack.new&lt;br /&gt;
&lt;br /&gt;
et.who_am_i&lt;br /&gt;
&lt;br /&gt;
It products:&lt;br /&gt;
&lt;br /&gt;
Burp&lt;br /&gt;
Debug&lt;br /&gt;
&lt;br /&gt;
Another way is using the alias method, we still have two modules have the same name method who_am_i.&lt;br /&gt;
module Debug&lt;br /&gt;
  def who_am_i&lt;br /&gt;
    &amp;quot;Debug&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
module Burp&lt;br /&gt;
  def who_am_i&lt;br /&gt;
    &amp;quot;Burp&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
class RubyTest  &lt;br /&gt;
  include Burp  &lt;br /&gt;
  alias :Burp_who_am_i :who_am_i   &lt;br /&gt;
  include Debug&lt;br /&gt;
  alias :Debug_who_am_i :who_am_i   &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
rt = RubyTest.new&lt;br /&gt;
puts rt.Debug_who_am_i&lt;br /&gt;
puts rt.Burp_who_am_i&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
As illustrated in the examples, there are at least two ways to ensure that your class runs as expected even when using modules with method name conflicts.&lt;br /&gt;
&lt;br /&gt;
The two approaches are:&lt;br /&gt;
#calling the module's methods using qualified names&lt;br /&gt;
#using an alias&lt;br /&gt;
&lt;br /&gt;
In our opinion, the first approach, calling the module's methods using qualified names, is the better approach. Inheriting from the module and using the qualified names to avoid conflicts is a more efficient OO design. It is also easier to read and maintain because in viewing the call, a reader will immediately gather the expected behavior of the call, as opposed to finding the alias definition and trying to make the connection. &lt;br /&gt;
&lt;br /&gt;
With the alias approach, the inheritance is limited and the programmer will need to constantly update the list of aliases for methods needed as they arise.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
 &lt;br /&gt;
#[http://www.recentrambles.com/pragmatic/view/69 Modules, Mixins, and Inheritance]&lt;br /&gt;
#[http://www.rubyist.net/~slagell/ruby/modules.html Ruby User's Guide]&lt;/div&gt;</summary>
		<author><name>Arjones3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5396</id>
		<title>CSC/ECE 517 Fall 2007/wiki1b 1 as</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5396"/>
		<updated>2007-10-10T19:15:19Z</updated>

		<summary type="html">&lt;p&gt;Arjones3: /* 1. Using Namespaces */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
Ruby does not implement true multiple inheritance, but provides Modules as a way to reuse chunks of codes in many classes. &lt;br /&gt;
&lt;br /&gt;
Modules, unlike like classes in OO languages such as Java, cannot be instantiated or sub-classed. Modules are included in class definitions by using the ‘include’ method which will mix that module’s methods into the calling class. The module’s methods will then become instance methods. &lt;br /&gt;
&lt;br /&gt;
A class can include several modules within the class definition. However, a problem exists when a class includes multiple modules that contain a method of the same name. Since the class will have access to both of these methods, unexpected behavior may occur when the names of the methods conflict.&lt;br /&gt;
&lt;br /&gt;
Let’s look at a few examples!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Question 1: If multiple methods with the same name are defined, there needs to be some way of determining which method a call refers to. The general rule is given on p. 123 of Programming Ruby. But questions still remain.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''I.) Is it possible to get unexpected behavior if one of the modules you are using is &amp;quot;enhanced&amp;quot; to contain a new method that happens to conflict with a name of an existing method?''' &lt;br /&gt;
&lt;br /&gt;
Yes, it is possible to get unexpected behavior if the user does not use the qualified name when calling the ambiguous method. Ruby will first search the last module included, and continue in a descending order.  The method that is invoked may not be the method that the caller expected to run. &lt;br /&gt;
&lt;br /&gt;
''Source: Programming Ruby textbook''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''II.) Is it possible to refer to these methods using a qualified name?'''&lt;br /&gt;
 &lt;br /&gt;
Yes, by adding ‘require’ statements for the modules being used, and invoking the methods with the qualified name (ModuleName:method), conflict can be avoided.&lt;br /&gt;
&lt;br /&gt;
''Source: http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_modules.html''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''III.) Is it possible to use method aliasing to resolve the ambiguity?''' &lt;br /&gt;
&lt;br /&gt;
Yes, a library is available to allow a class to selectively mixin methods from a module, as opposed to all of the module’s methods, and alias them on the fly to avoid conflicts.&lt;br /&gt;
&lt;br /&gt;
''Source: http://rubyforge.org/docman/view.php/735/309/readme.html''&lt;br /&gt;
&lt;br /&gt;
'''IV.) What approach does good o-o design dictate?'''&lt;br /&gt;
&lt;br /&gt;
Calling the modules’ methods using qualified names is the better OO design approach. With the alias approach, the inheritance is limited and the programmer will need constantly update the list of aliases for methods needed as they come up.&lt;br /&gt;
&lt;br /&gt;
However, inheriting from the entire module and using the qualified names to avoid conflicts is a more efficient OO approach. It is also easier to read and maintain because in viewing the call, a reader will immediately gather the expected behavior of the call, as opposed to finding the alias definition and trying to make the connection.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
= 1. Using Namespaces =&lt;br /&gt;
&lt;br /&gt;
module Grouchy&lt;br /&gt;
 def Grouchy.say_hello(string='somebody')&lt;br /&gt;
  puts &amp;quot;#{string} says: Don't tell me what to do!&amp;quot; &lt;br /&gt;
 end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
Grouchy.say_hello is the class method of the module Grouchy&lt;br /&gt;
We have a class Person which includes the module Grouchy&lt;br /&gt;
&lt;br /&gt;
class Person&lt;br /&gt;
&lt;br /&gt;
  require &amp;quot;grouchy&amp;quot; &lt;br /&gt;
&lt;br /&gt;
  attr_accessor :name&lt;br /&gt;
&lt;br /&gt;
  def initialize(name='somebody')&lt;br /&gt;
    @name = name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
person = Person.new('Charlie')&lt;br /&gt;
Grouchy.say_hello(person.name)&lt;br /&gt;
&lt;br /&gt;
It products: &lt;br /&gt;
&lt;br /&gt;
Charlie says: Don't tell me what to do! &lt;br /&gt;
&lt;br /&gt;
When facing the name conflicts problem, we can use namespace to tell the different of two methods. &lt;br /&gt;
&lt;br /&gt;
module Debug&lt;br /&gt;
  def Debug.who_am_i&lt;br /&gt;
    &amp;quot;Debug&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
module Burp&lt;br /&gt;
  def Burp.who_am_i&lt;br /&gt;
    &amp;quot;Burp&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
class EightTrack&lt;br /&gt;
  include Debug&lt;br /&gt;
  include Burp&lt;br /&gt;
  def who_am_i&lt;br /&gt;
    puts Burp.who_am_i&lt;br /&gt;
    puts Debug.who_am_i    &lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
et = EightTrack.new&lt;br /&gt;
&lt;br /&gt;
et.who_am_i&lt;br /&gt;
&lt;br /&gt;
It products:&lt;br /&gt;
&lt;br /&gt;
Burp&lt;br /&gt;
Debug&lt;br /&gt;
&lt;br /&gt;
Another way is using the alias method, we still have two modules have the same name method who_am_i.&lt;br /&gt;
module Debug&lt;br /&gt;
  def who_am_i&lt;br /&gt;
    &amp;quot;Debug&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
module Burp&lt;br /&gt;
  def who_am_i&lt;br /&gt;
    &amp;quot;Burp&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
class RubyTest  &lt;br /&gt;
  include Burp  &lt;br /&gt;
  alias :Burp_who_am_i :who_am_i   &lt;br /&gt;
  include Debug&lt;br /&gt;
  alias :Debug_who_am_i :who_am_i   &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
rt = RubyTest.new&lt;br /&gt;
puts rt.Debug_who_am_i&lt;br /&gt;
puts rt.Burp_who_am_i&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
As illustrated in the examples, there are at least two ways to ensure that your class runs as expected even when using modules with method name conflicts.&lt;br /&gt;
&lt;br /&gt;
The two approaches are:&lt;br /&gt;
#calling the module's methods using qualified names&lt;br /&gt;
#using an alias&lt;br /&gt;
&lt;br /&gt;
In our opinion, the first approach, calling the module's methods using qualified names, is the better approach. Inheriting from the module and using the qualified names to avoid conflicts is a more efficient OO design. It is also easier to read and maintain because in viewing the call, a reader will immediately gather the expected behavior of the call, as opposed to finding the alias definition and trying to make the connection. &lt;br /&gt;
&lt;br /&gt;
With the alias approach, the inheritance is limited and the programmer will need to constantly update the list of aliases for methods needed as they arise.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
 &lt;br /&gt;
#[http://www.recentrambles.com/pragmatic/view/69 Modules, Mixins, and Inheritance]&lt;br /&gt;
#[http://www.rubyist.net/~slagell/ruby/modules.html Ruby User's Guide]&lt;/div&gt;</summary>
		<author><name>Arjones3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5394</id>
		<title>CSC/ECE 517 Fall 2007/wiki1b 1 as</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5394"/>
		<updated>2007-10-10T19:12:59Z</updated>

		<summary type="html">&lt;p&gt;Arjones3: /* Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
Ruby does not implement true multiple inheritance, but provides Modules as a way to reuse chunks of codes in many classes. &lt;br /&gt;
&lt;br /&gt;
Modules, unlike like classes in OO languages such as Java, cannot be instantiated or sub-classed. Modules are included in class definitions by using the ‘include’ method which will mix that module’s methods into the calling class. The module’s methods will then become instance methods. &lt;br /&gt;
&lt;br /&gt;
A class can include several modules within the class definition. However, a problem exists when a class includes multiple modules that contain a method of the same name. Since the class will have access to both of these methods, unexpected behavior may occur when the names of the methods conflict.&lt;br /&gt;
&lt;br /&gt;
Let’s look at a few examples!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Question 1: If multiple methods with the same name are defined, there needs to be some way of determining which method a call refers to. The general rule is given on p. 123 of Programming Ruby. But questions still remain.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''I.) Is it possible to get unexpected behavior if one of the modules you are using is &amp;quot;enhanced&amp;quot; to contain a new method that happens to conflict with a name of an existing method?''' &lt;br /&gt;
&lt;br /&gt;
Yes, it is possible to get unexpected behavior if the user does not use the qualified name when calling the ambiguous method. Ruby will first search the last module included, and continue in a descending order.  The method that is invoked may not be the method that the caller expected to run. &lt;br /&gt;
&lt;br /&gt;
''Source: Programming Ruby textbook''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''II.) Is it possible to refer to these methods using a qualified name?'''&lt;br /&gt;
 &lt;br /&gt;
Yes, by adding ‘require’ statements for the modules being used, and invoking the methods with the qualified name (ModuleName:method), conflict can be avoided.&lt;br /&gt;
&lt;br /&gt;
''Source: http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_modules.html''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''III.) Is it possible to use method aliasing to resolve the ambiguity?''' &lt;br /&gt;
&lt;br /&gt;
Yes, a library is available to allow a class to selectively mixin methods from a module, as opposed to all of the module’s methods, and alias them on the fly to avoid conflicts.&lt;br /&gt;
&lt;br /&gt;
''Source: http://rubyforge.org/docman/view.php/735/309/readme.html''&lt;br /&gt;
&lt;br /&gt;
'''IV.) What approach does good o-o design dictate?'''&lt;br /&gt;
&lt;br /&gt;
Calling the modules’ methods using qualified names is the better OO design approach. With the alias approach, the inheritance is limited and the programmer will need constantly update the list of aliases for methods needed as they come up.&lt;br /&gt;
&lt;br /&gt;
However, inheriting from the entire module and using the qualified names to avoid conflicts is a more efficient OO approach. It is also easier to read and maintain because in viewing the call, a reader will immediately gather the expected behavior of the call, as opposed to finding the alias definition and trying to make the connection.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
== 1. Using Namespaces ==&lt;br /&gt;
&lt;br /&gt;
module Grouchy&lt;br /&gt;
 def Grouchy.say_hello(string='somebody')&lt;br /&gt;
  puts &amp;quot;#{string} says: Don't tell me what to do!&amp;quot; &lt;br /&gt;
 end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
Grouchy.say_hello is the class method of the module Grouchy&lt;br /&gt;
We have a class Person which includes the module Grouchy&lt;br /&gt;
&lt;br /&gt;
class Person&lt;br /&gt;
&lt;br /&gt;
  require &amp;quot;grouchy&amp;quot; &lt;br /&gt;
&lt;br /&gt;
  attr_accessor :name&lt;br /&gt;
&lt;br /&gt;
  def initialize(name='somebody')&lt;br /&gt;
    @name = name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
person = Person.new('Charlie')&lt;br /&gt;
Grouchy.say_hello(person.name)&lt;br /&gt;
&lt;br /&gt;
It products: &lt;br /&gt;
&lt;br /&gt;
Charlie says: Don't tell me what to do! &lt;br /&gt;
&lt;br /&gt;
When facing the name conflicts problem, we can use namespace to tell the different of two methods. &lt;br /&gt;
&lt;br /&gt;
module Debug&lt;br /&gt;
  def Debug.who_am_i&lt;br /&gt;
    &amp;quot;Debug&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
module Burp&lt;br /&gt;
  def Burp.who_am_i&lt;br /&gt;
    &amp;quot;Burp&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
class EightTrack&lt;br /&gt;
  include Debug&lt;br /&gt;
  include Burp&lt;br /&gt;
  def who_am_i&lt;br /&gt;
    puts Burp.who_am_i&lt;br /&gt;
    puts Debug.who_am_i    &lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
et = EightTrack.new&lt;br /&gt;
&lt;br /&gt;
et.who_am_i&lt;br /&gt;
&lt;br /&gt;
It products:&lt;br /&gt;
&lt;br /&gt;
Burp&lt;br /&gt;
Debug&lt;br /&gt;
&lt;br /&gt;
Another way is using the alias method, we still have two modules have the same name method who_am_i.&lt;br /&gt;
module Debug&lt;br /&gt;
  def who_am_i&lt;br /&gt;
    &amp;quot;Debug&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
module Burp&lt;br /&gt;
  def who_am_i&lt;br /&gt;
    &amp;quot;Burp&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
class RubyTest  &lt;br /&gt;
  include Burp  &lt;br /&gt;
  alias :Burp_who_am_i :who_am_i   &lt;br /&gt;
  include Debug&lt;br /&gt;
  alias :Debug_who_am_i :who_am_i   &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
rt = RubyTest.new&lt;br /&gt;
puts rt.Debug_who_am_i&lt;br /&gt;
puts rt.Burp_who_am_i&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
As illustrated in the examples, there are at least two ways to ensure that your class runs as expected even when using modules with method name conflicts.&lt;br /&gt;
&lt;br /&gt;
The two approaches are:&lt;br /&gt;
#calling the module's methods using qualified names&lt;br /&gt;
#using an alias&lt;br /&gt;
&lt;br /&gt;
In our opinion, the first approach, calling the module's methods using qualified names, is the better approach. Inheriting from the module and using the qualified names to avoid conflicts is a more efficient OO design. It is also easier to read and maintain because in viewing the call, a reader will immediately gather the expected behavior of the call, as opposed to finding the alias definition and trying to make the connection. &lt;br /&gt;
&lt;br /&gt;
With the alias approach, the inheritance is limited and the programmer will need to constantly update the list of aliases for methods needed as they arise.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
 &lt;br /&gt;
#[http://www.recentrambles.com/pragmatic/view/69 Modules, Mixins, and Inheritance]&lt;br /&gt;
#[http://www.rubyist.net/~slagell/ruby/modules.html Ruby User's Guide]&lt;/div&gt;</summary>
		<author><name>Arjones3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5392</id>
		<title>CSC/ECE 517 Fall 2007/wiki1b 1 as</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5392"/>
		<updated>2007-10-10T19:07:32Z</updated>

		<summary type="html">&lt;p&gt;Arjones3: /* Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
Ruby does not implement true multiple inheritance, but provides Modules as a way to reuse chunks of codes in many classes. &lt;br /&gt;
&lt;br /&gt;
Modules, unlike like classes in OO languages such as Java, cannot be instantiated or sub-classed. Modules are included in class definitions by using the ‘include’ method which will mix that module’s methods into the calling class. The module’s methods will then become instance methods. &lt;br /&gt;
&lt;br /&gt;
A class can include several modules within the class definition. However, a problem exists when a class includes multiple modules that contain a method of the same name. Since the class will have access to both of these methods, unexpected behavior may occur when the names of the methods conflict.&lt;br /&gt;
&lt;br /&gt;
Let’s look at a few examples!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Question 1: If multiple methods with the same name are defined, there needs to be some way of determining which method a call refers to. The general rule is given on p. 123 of Programming Ruby. But questions still remain.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''I.) Is it possible to get unexpected behavior if one of the modules you are using is &amp;quot;enhanced&amp;quot; to contain a new method that happens to conflict with a name of an existing method?''' &lt;br /&gt;
&lt;br /&gt;
Yes, it is possible to get unexpected behavior if the user does not use the qualified name when calling the ambiguous method. Ruby will first search the last module included, and continue in a descending order.  The method that is invoked may not be the method that the caller expected to run. &lt;br /&gt;
&lt;br /&gt;
''Source: Programming Ruby textbook''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''II.) Is it possible to refer to these methods using a qualified name?'''&lt;br /&gt;
 &lt;br /&gt;
Yes, by adding ‘require’ statements for the modules being used, and invoking the methods with the qualified name (ModuleName:method), conflict can be avoided.&lt;br /&gt;
&lt;br /&gt;
''Source: http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_modules.html''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''III.) Is it possible to use method aliasing to resolve the ambiguity?''' &lt;br /&gt;
&lt;br /&gt;
Yes, a library is available to allow a class to selectively mixin methods from a module, as opposed to all of the module’s methods, and alias them on the fly to avoid conflicts.&lt;br /&gt;
&lt;br /&gt;
''Source: http://rubyforge.org/docman/view.php/735/309/readme.html''&lt;br /&gt;
&lt;br /&gt;
'''IV.) What approach does good o-o design dictate?'''&lt;br /&gt;
&lt;br /&gt;
Calling the modules’ methods using qualified names is the better OO design approach. With the alias approach, the inheritance is limited and the programmer will need constantly update the list of aliases for methods needed as they come up.&lt;br /&gt;
&lt;br /&gt;
However, inheriting from the entire module and using the qualified names to avoid conflicts is a more efficient OO approach. It is also easier to read and maintain because in viewing the call, a reader will immediately gather the expected behavior of the call, as opposed to finding the alias definition and trying to make the connection.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
It’s the example of how to use namespace.&lt;br /&gt;
&lt;br /&gt;
module Grouchy&lt;br /&gt;
 def Grouchy.say_hello(string='somebody')&lt;br /&gt;
  puts &amp;quot;#{string} says: Don't tell me what to do!&amp;quot; &lt;br /&gt;
 end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
Grouchy.say_hello is the class method of the module Grouchy&lt;br /&gt;
We have a class Person which includes the module Grouchy&lt;br /&gt;
&lt;br /&gt;
class Person&lt;br /&gt;
&lt;br /&gt;
  require &amp;quot;grouchy&amp;quot; &lt;br /&gt;
&lt;br /&gt;
  attr_accessor :name&lt;br /&gt;
&lt;br /&gt;
  def initialize(name='somebody')&lt;br /&gt;
    @name = name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
person = Person.new('Charlie')&lt;br /&gt;
Grouchy.say_hello(person.name)&lt;br /&gt;
&lt;br /&gt;
It products: &lt;br /&gt;
&lt;br /&gt;
Charlie says: Don't tell me what to do! &lt;br /&gt;
&lt;br /&gt;
When facing the name conflicts problem, we can use namespace to tell the different of two methods. &lt;br /&gt;
&lt;br /&gt;
module Debug&lt;br /&gt;
  def Debug.who_am_i&lt;br /&gt;
    &amp;quot;Debug&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
module Burp&lt;br /&gt;
  def Burp.who_am_i&lt;br /&gt;
    &amp;quot;Burp&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
class EightTrack&lt;br /&gt;
  include Debug&lt;br /&gt;
  include Burp&lt;br /&gt;
  def who_am_i&lt;br /&gt;
    puts Burp.who_am_i&lt;br /&gt;
    puts Debug.who_am_i    &lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
et = EightTrack.new&lt;br /&gt;
&lt;br /&gt;
et.who_am_i&lt;br /&gt;
&lt;br /&gt;
It products:&lt;br /&gt;
&lt;br /&gt;
Burp&lt;br /&gt;
Debug&lt;br /&gt;
&lt;br /&gt;
Another way is using the alias method, we still have two modules have the same name method who_am_i.&lt;br /&gt;
module Debug&lt;br /&gt;
  def who_am_i&lt;br /&gt;
    &amp;quot;Debug&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
module Burp&lt;br /&gt;
  def who_am_i&lt;br /&gt;
    &amp;quot;Burp&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
class RubyTest  &lt;br /&gt;
  include Burp  &lt;br /&gt;
  alias :Burp_who_am_i :who_am_i   &lt;br /&gt;
  include Debug&lt;br /&gt;
  alias :Debug_who_am_i :who_am_i   &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
rt = RubyTest.new&lt;br /&gt;
puts rt.Debug_who_am_i&lt;br /&gt;
puts rt.Burp_who_am_i&lt;br /&gt;
&lt;br /&gt;
We alias the Burp’s who_am_i method to Burp_who_am_i and Debug’s who_am_i method to Debug_who_am_i so it products:&lt;br /&gt;
&lt;br /&gt;
Debug&lt;br /&gt;
Burp&lt;br /&gt;
&lt;br /&gt;
There is another way to do it. We can import a library, ‘use’ package. &lt;br /&gt;
&lt;br /&gt;
   module Foo&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;hello&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
      def baz&lt;br /&gt;
         &amp;quot;world&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
   module Test&lt;br /&gt;
      def bar&lt;br /&gt;
         &amp;quot;goodbye&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
      def blah&lt;br /&gt;
         &amp;quot;new york&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
   class Zap&lt;br /&gt;
      use Foo, :bar&lt;br /&gt;
      use Test, :blah&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
   z = Zap.new&lt;br /&gt;
&lt;br /&gt;
   z.bar  # &amp;quot;hello&amp;quot;&lt;br /&gt;
   z.baz  # NoMethodError&lt;br /&gt;
   z.blah # &amp;quot;new york&amp;quot;&lt;br /&gt;
&lt;br /&gt;
   # Using the new keywords&lt;br /&gt;
   class MyKlass&lt;br /&gt;
      use Foo :alias =&amp;gt; {:bar, :test}&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
   m = MyKlass.new&lt;br /&gt;
   m.test # &amp;quot;hello&amp;quot;&lt;br /&gt;
   m.bar  # NoMethodError&lt;br /&gt;
&lt;br /&gt;
It lets us import the method we need rather than whole module.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
As illustrated in the examples, there are at least two ways to ensure that your class runs as expected even when using modules with method name conflicts.&lt;br /&gt;
&lt;br /&gt;
The two approaches are:&lt;br /&gt;
#calling the module's methods using qualified names&lt;br /&gt;
#using an alias&lt;br /&gt;
&lt;br /&gt;
In our opinion, the first approach, calling the module's methods using qualified names, is the better approach. Inheriting from the module and using the qualified names to avoid conflicts is a more efficient OO design. It is also easier to read and maintain because in viewing the call, a reader will immediately gather the expected behavior of the call, as opposed to finding the alias definition and trying to make the connection. &lt;br /&gt;
&lt;br /&gt;
With the alias approach, the inheritance is limited and the programmer will need to constantly update the list of aliases for methods needed as they arise.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
 &lt;br /&gt;
#[http://www.recentrambles.com/pragmatic/view/69 Modules, Mixins, and Inheritance]&lt;br /&gt;
#[http://www.rubyist.net/~slagell/ruby/modules.html Ruby User's Guide]&lt;/div&gt;</summary>
		<author><name>Arjones3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5390</id>
		<title>CSC/ECE 517 Fall 2007/wiki1b 1 as</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5390"/>
		<updated>2007-10-10T19:06:05Z</updated>

		<summary type="html">&lt;p&gt;Arjones3: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
Ruby does not implement true multiple inheritance, but provides Modules as a way to reuse chunks of codes in many classes. &lt;br /&gt;
&lt;br /&gt;
Modules, unlike like classes in OO languages such as Java, cannot be instantiated or sub-classed. Modules are included in class definitions by using the ‘include’ method which will mix that module’s methods into the calling class. The module’s methods will then become instance methods. &lt;br /&gt;
&lt;br /&gt;
A class can include several modules within the class definition. However, a problem exists when a class includes multiple modules that contain a method of the same name. Since the class will have access to both of these methods, unexpected behavior may occur when the names of the methods conflict.&lt;br /&gt;
&lt;br /&gt;
Let’s look at a few examples!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Question 1: If multiple methods with the same name are defined, there needs to be some way of determining which method a call refers to. The general rule is given on p. 123 of Programming Ruby. But questions still remain.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''I.) Is it possible to get unexpected behavior if one of the modules you are using is &amp;quot;enhanced&amp;quot; to contain a new method that happens to conflict with a name of an existing method?''' &lt;br /&gt;
&lt;br /&gt;
Yes, it is possible to get unexpected behavior if the user does not use the qualified name when calling the ambiguous method. Ruby will first search the last module included, and continue in a descending order.  The method that is invoked may not be the method that the caller expected to run. &lt;br /&gt;
&lt;br /&gt;
''Source: Programming Ruby textbook''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''II.) Is it possible to refer to these methods using a qualified name?'''&lt;br /&gt;
 &lt;br /&gt;
Yes, by adding ‘require’ statements for the modules being used, and invoking the methods with the qualified name (ModuleName:method), conflict can be avoided.&lt;br /&gt;
&lt;br /&gt;
''Source: http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_modules.html''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''III.) Is it possible to use method aliasing to resolve the ambiguity?''' &lt;br /&gt;
&lt;br /&gt;
Yes, a library is available to allow a class to selectively mixin methods from a module, as opposed to all of the module’s methods, and alias them on the fly to avoid conflicts.&lt;br /&gt;
&lt;br /&gt;
''Source: http://rubyforge.org/docman/view.php/735/309/readme.html''&lt;br /&gt;
&lt;br /&gt;
'''IV.) What approach does good o-o design dictate?'''&lt;br /&gt;
&lt;br /&gt;
Calling the modules’ methods using qualified names is the better OO design approach. With the alias approach, the inheritance is limited and the programmer will need constantly update the list of aliases for methods needed as they come up.&lt;br /&gt;
&lt;br /&gt;
However, inheriting from the entire module and using the qualified names to avoid conflicts is a more efficient OO approach. It is also easier to read and maintain because in viewing the call, a reader will immediately gather the expected behavior of the call, as opposed to finding the alias definition and trying to make the connection.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
As illustrated in the examples, there are at least two ways to ensure that your class runs as expected even when using modules with method name conflicts.&lt;br /&gt;
&lt;br /&gt;
The two approaches are:&lt;br /&gt;
#calling the module's methods using qualified names&lt;br /&gt;
#using an alias&lt;br /&gt;
&lt;br /&gt;
In our opinion, the first approach, calling the module's methods using qualified names, is the better approach. Inheriting from the module and using the qualified names to avoid conflicts is a more efficient OO design. It is also easier to read and maintain because in viewing the call, a reader will immediately gather the expected behavior of the call, as opposed to finding the alias definition and trying to make the connection. &lt;br /&gt;
&lt;br /&gt;
With the alias approach, the inheritance is limited and the programmer will need to constantly update the list of aliases for methods needed as they arise.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
 &lt;br /&gt;
#[http://www.recentrambles.com/pragmatic/view/69 Modules, Mixins, and Inheritance]&lt;br /&gt;
#[http://www.rubyist.net/~slagell/ruby/modules.html Ruby User's Guide]&lt;/div&gt;</summary>
		<author><name>Arjones3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5385</id>
		<title>CSC/ECE 517 Fall 2007/wiki1b 1 as</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5385"/>
		<updated>2007-10-10T19:00:09Z</updated>

		<summary type="html">&lt;p&gt;Arjones3: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
Ruby does not implement true multiple inheritance, but provides Modules as a way to reuse chunks of codes in many classes. &lt;br /&gt;
&lt;br /&gt;
Modules, unlike like classes in OO languages such as Java, cannot be instantiated or sub-classed. Modules are included in class definitions by using the ‘include’ method which will mix that module’s methods into the calling class. The module’s methods will then become instance methods. &lt;br /&gt;
&lt;br /&gt;
A class can include several modules within the class definition. However, a problem exists when a class includes multiple modules that contain a method of the same name. Since the class will have access to both of these methods, unexpected behavior may occur when the names of the methods conflict.&lt;br /&gt;
&lt;br /&gt;
Let’s look at a few examples!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Question 1: If multiple methods with the same name are defined, there needs to be some way of determining which method a call refers to. The general rule is given on p. 123 of Programming Ruby. But questions still remain.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''I.) Is it possible to get unexpected behavior if one of the modules you are using is &amp;quot;enhanced&amp;quot; to contain a new method that happens to conflict with a name of an existing method?''' &lt;br /&gt;
&lt;br /&gt;
Yes, it is possible to get unexpected behavior if the user does not use the qualified name when calling the ambiguous method. Ruby will first search the last module included, and continue in a descending order.  The method that is invoked may not be the method that the caller expected to run. &lt;br /&gt;
&lt;br /&gt;
''Source: Programming Ruby textbook''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''II.) Is it possible to refer to these methods using a qualified name?'''&lt;br /&gt;
 &lt;br /&gt;
Yes, by adding ‘require’ statements for the modules being used, and invoking the methods with the qualified name (ModuleName:method), conflict can be avoided.&lt;br /&gt;
&lt;br /&gt;
''Source: http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_modules.html''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''III.) Is it possible to use method aliasing to resolve the ambiguity?''' &lt;br /&gt;
&lt;br /&gt;
Yes, a library is available to allow a class to selectively mixin methods from a module, as opposed to all of the module’s methods, and alias them on the fly to avoid conflicts.&lt;br /&gt;
&lt;br /&gt;
''Source: http://rubyforge.org/docman/view.php/735/309/readme.html''&lt;br /&gt;
&lt;br /&gt;
'''IV.) What approach does good o-o design dictate?'''&lt;br /&gt;
&lt;br /&gt;
Calling the modules’ methods using qualified names is the better OO design approach. With the alias approach, the inheritance is limited and the programmer will need constantly update the list of aliases for methods needed as they come up.&lt;br /&gt;
&lt;br /&gt;
However, inheriting from the entire module and using the qualified names to avoid conflicts is a more efficient OO approach. It is also easier to read and maintain because in viewing the call, a reader will immediately gather the expected behavior of the call, as opposed to finding the alias definition and trying to make the connection.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
 &lt;br /&gt;
#[http://www.recentrambles.com/pragmatic/view/69 Modules, Mixins, and Inheritance]&lt;br /&gt;
#[http://www.rubyist.net/~slagell/ruby/modules.html Ruby User's Guide]&lt;/div&gt;</summary>
		<author><name>Arjones3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5376</id>
		<title>CSC/ECE 517 Fall 2007/wiki1b 1 as</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5376"/>
		<updated>2007-10-10T18:54:57Z</updated>

		<summary type="html">&lt;p&gt;Arjones3: /* Background */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
Ruby does not implement true multiple inheritance, but provides Modules as a way to reuse chunks of codes in many classes. &lt;br /&gt;
&lt;br /&gt;
Modules, unlike like classes in OO languages such as Java, cannot be instantiated or sub-classed. Modules are included in class definitions by using the ‘include’ method which will mix that module’s methods into the calling class. The module’s methods will then become instance methods. &lt;br /&gt;
&lt;br /&gt;
A class can include several modules within the class definition. However, a problem exists when a class includes multiple modules that contain a method of the same name. Since the class will have access to both of these methods, unexpected behavior may occur when the names of the methods conflict.&lt;br /&gt;
&lt;br /&gt;
Let’s look at a few examples!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Question 1: If multiple methods with the same name are defined, there needs to be some way of determining which method a call refers to. The general rule is given on p. 123 of Programming Ruby. But questions still remain.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''I.) Is it possible to get unexpected behavior if one of the modules you are using is &amp;quot;enhanced&amp;quot; to contain a new method that happens to conflict with a name of an existing method?''' &lt;br /&gt;
&lt;br /&gt;
Yes, it is possible to get unexpected behavior if the user does not use the qualified name when calling the ambiguous method. Ruby will first search the last module included, and continue in a descending order.  The method that is invoked may not be the method that the caller expected to run. &lt;br /&gt;
&lt;br /&gt;
''Source: Programming Ruby textbook''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''II.) Is it possible to refer to these methods using a qualified name?'''&lt;br /&gt;
 &lt;br /&gt;
Yes, by adding ‘require’ statements for the modules being used, and invoking the methods with the qualified name (ModuleName:method), conflict can be avoided.&lt;br /&gt;
&lt;br /&gt;
''Source: http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_modules.html''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''III.) Is it possible to use method aliasing to resolve the ambiguity?''' &lt;br /&gt;
&lt;br /&gt;
Yes, a library is available to allow a class to selectively mixin methods from a module, as opposed to all of the module’s methods, and alias them on the fly to avoid conflicts.&lt;br /&gt;
&lt;br /&gt;
''Source: http://rubyforge.org/docman/view.php/735/309/readme.html''&lt;br /&gt;
&lt;br /&gt;
'''IV.) What approach does good o-o design dictate?'''&lt;br /&gt;
&lt;br /&gt;
Calling the modules’ methods using qualified names is the better OO design approach. With the alias approach, the inheritance is limited and the programmer will need constantly update the list of aliases for methods needed as they come up.&lt;br /&gt;
&lt;br /&gt;
However, inheriting from the entire module and using the qualified names to avoid conflicts is a more efficient OO approach. It is also easier to read and maintain because in viewing the call, a reader will immediately gather the expected behavior of the call, as opposed to finding the alias definition and trying to make the connection.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
 [http://www.recentrambles.com/pragmatic/view/69 Modules, Mixins, and Inheritance]&lt;br /&gt;
[http://www.rubyist.net/~slagell/ruby/modules.html Ruby User's Guide]&lt;/div&gt;</summary>
		<author><name>Arjones3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5374</id>
		<title>CSC/ECE 517 Fall 2007/wiki1b 1 as</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5374"/>
		<updated>2007-10-10T18:53:46Z</updated>

		<summary type="html">&lt;p&gt;Arjones3: /* Background */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
Ruby does not implement true multiple inheritance, but provides Modules as a way to reuse chunks of codes in many classes. &lt;br /&gt;
&lt;br /&gt;
Modules, unlike like classes in OO languages such as Java, cannot be instantiated or sub-classed. Modules are included in class definitions by using the ‘include’ method which will mix that module’s methods into the calling class. The module’s methods will then become instance methods. &lt;br /&gt;
&lt;br /&gt;
A class can include several modules within the class definition. However, a problem exists when a class includes multiple modules that contain a method of the same name. Since the class will have access to both of these methods, unexpected behavior may occur when the names of the methods conflict.&lt;br /&gt;
Let’s look at a few examples.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Question 1: If multiple methods with the same name are defined, there needs to be some way of determining which method a call refers to. The general rule is given on p. 123 of Programming Ruby. But questions still remain.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''I.) Is it possible to get unexpected behavior if one of the modules you are using is &amp;quot;enhanced&amp;quot; to contain a new method that happens to conflict with a name of an existing method?''' &lt;br /&gt;
&lt;br /&gt;
Yes, it is possible to get unexpected behavior if the user does not use the qualified name when calling the ambiguous method. Ruby will first search the last module included, and continue in a descending order.  The method that is invoked may not be the method that the caller expected to run. &lt;br /&gt;
&lt;br /&gt;
''Source: Programming Ruby textbook''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''II.) Is it possible to refer to these methods using a qualified name?'''&lt;br /&gt;
 &lt;br /&gt;
Yes, by adding ‘require’ statements for the modules being used, and invoking the methods with the qualified name (ModuleName:method), conflict can be avoided.&lt;br /&gt;
&lt;br /&gt;
''Source: http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_modules.html''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''III.) Is it possible to use method aliasing to resolve the ambiguity?''' &lt;br /&gt;
&lt;br /&gt;
Yes, a library is available to allow a class to selectively mixin methods from a module, as opposed to all of the module’s methods, and alias them on the fly to avoid conflicts.&lt;br /&gt;
&lt;br /&gt;
''Source: http://rubyforge.org/docman/view.php/735/309/readme.html''&lt;br /&gt;
&lt;br /&gt;
'''IV.) What approach does good o-o design dictate?'''&lt;br /&gt;
&lt;br /&gt;
Calling the modules’ methods using qualified names is the better OO design approach. With the alias approach, the inheritance is limited and the programmer will need constantly update the list of aliases for methods needed as they come up.&lt;br /&gt;
&lt;br /&gt;
However, inheriting from the entire module and using the qualified names to avoid conflicts is a more efficient OO approach. It is also easier to read and maintain because in viewing the call, a reader will immediately gather the expected behavior of the call, as opposed to finding the alias definition and trying to make the connection.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
 [http://www.recentrambles.com/pragmatic/view/69 Modules, Mixins, and Inheritance]&lt;br /&gt;
[http://www.rubyist.net/~slagell/ruby/modules.html Ruby User's Guide]&lt;/div&gt;</summary>
		<author><name>Arjones3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5366</id>
		<title>CSC/ECE 517 Fall 2007/wiki1b 1 as</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5366"/>
		<updated>2007-10-10T18:44:44Z</updated>

		<summary type="html">&lt;p&gt;Arjones3: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Question 1: If multiple methods with the same name are defined, there needs to be some way of determining which method a call refers to. The general rule is given on p. 123 of Programming Ruby. But questions still remain.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''I.) Is it possible to get unexpected behavior if one of the modules you are using is &amp;quot;enhanced&amp;quot; to contain a new method that happens to conflict with a name of an existing method?''' &lt;br /&gt;
&lt;br /&gt;
Yes, it is possible to get unexpected behavior if the user does not use the qualified name when calling the ambiguous method. Ruby will first search the last module included, and continue in a descending order.  The method that is invoked may not be the method that the caller expected to run. &lt;br /&gt;
&lt;br /&gt;
''Source: Programming Ruby textbook''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''II.) Is it possible to refer to these methods using a qualified name?'''&lt;br /&gt;
 &lt;br /&gt;
Yes, by adding ‘require’ statements for the modules being used, and invoking the methods with the qualified name (ModuleName:method), conflict can be avoided.&lt;br /&gt;
&lt;br /&gt;
''Source: http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_modules.html''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''III.) Is it possible to use method aliasing to resolve the ambiguity?''' &lt;br /&gt;
&lt;br /&gt;
Yes, a library is available to allow a class to selectively mixin methods from a module, as opposed to all of the module’s methods, and alias them on the fly to avoid conflicts.&lt;br /&gt;
&lt;br /&gt;
''Source: http://rubyforge.org/docman/view.php/735/309/readme.html''&lt;br /&gt;
&lt;br /&gt;
'''IV.) What approach does good o-o design dictate?'''&lt;br /&gt;
&lt;br /&gt;
Calling the modules’ methods using qualified names is the better OO design approach. With the alias approach, the inheritance is limited and the programmer will need constantly update the list of aliases for methods needed as they come up.&lt;br /&gt;
&lt;br /&gt;
However, inheriting from the entire module and using the qualified names to avoid conflicts is a more efficient OO approach. It is also easier to read and maintain because in viewing the call, a reader will immediately gather the expected behavior of the call, as opposed to finding the alias definition and trying to make the connection.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
 [http://www.recentrambles.com/pragmatic/view/69 Modules, Mixins, and Inheritance]&lt;br /&gt;
[http://www.rubyist.net/~slagell/ruby/modules.html Ruby User's Guide]&lt;/div&gt;</summary>
		<author><name>Arjones3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5354</id>
		<title>CSC/ECE 517 Fall 2007/wiki1b 1 as</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5354"/>
		<updated>2007-10-10T18:27:14Z</updated>

		<summary type="html">&lt;p&gt;Arjones3: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Question 1: If multiple methods with the same name are defined, there needs to be some way of determining which method a call refers to. The general rule is given on p. 123 of Programming Ruby. But questions still remain.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''I.) Is it possible to get unexpected behavior if one of the modules you are using is &amp;quot;enhanced&amp;quot; to contain a new method that happens to conflict with a name of an existing method?''' &lt;br /&gt;
&lt;br /&gt;
Yes, it is possible to get unexpected behavior if the user does not use the qualified name when calling the ambiguous method. Ruby will first search the last module included, and continue in a descending order.  The method that is invoked may not be the method that the caller expected to run. &lt;br /&gt;
&lt;br /&gt;
''Source: Programming Ruby textbook''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''II.) Is it possible to refer to these methods using a qualified name?'''&lt;br /&gt;
 &lt;br /&gt;
Yes, by adding ‘require’ statements for the modules being used, and invoking the methods with the qualified name (ModuleName:method), conflict can be avoided.&lt;br /&gt;
&lt;br /&gt;
''Source: http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_modules.html''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''III.) Is it possible to use method aliasing to resolve the ambiguity?''' &lt;br /&gt;
&lt;br /&gt;
Yes, a library is available to allow a class to selectively mixin methods from a module, as opposed to all of the module’s methods, and alias them on the fly to avoid conflicts.&lt;br /&gt;
&lt;br /&gt;
''Source: http://rubyforge.org/docman/view.php/735/309/readme.html''&lt;br /&gt;
&lt;br /&gt;
'''IV.) What approach does good o-o design dictate?'''&lt;br /&gt;
&lt;br /&gt;
Calling the modules’ methods using qualified names is the better OO design approach. With the alias approach, the inheritance is limited and the programmer will need constantly update the list of aliases for methods needed as they come up.&lt;br /&gt;
&lt;br /&gt;
However, inheriting from the entire module and using the qualified names to avoid conflicts is a more efficient OO approach. It is also easier to read and maintain because in viewing the call, a reader will immediately gather the expected behavior of the call, as opposed to finding the alias definition and trying to make the connection.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
 [http://www.recentrambles.com/pragmatic/view/69 Modules, Mixins, and Inheritance]&lt;/div&gt;</summary>
		<author><name>Arjones3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5353</id>
		<title>CSC/ECE 517 Fall 2007/wiki1b 1 as</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5353"/>
		<updated>2007-10-10T18:22:20Z</updated>

		<summary type="html">&lt;p&gt;Arjones3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Question 1: If multiple methods with the same name are defined, there needs to be some way of determining which method a call refers to. The general rule is given on p. 123 of Programming Ruby. But questions still remain.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''I.) Is it possible to get unexpected behavior if one of the modules you are using is &amp;quot;enhanced&amp;quot; to contain a new method that happens to conflict with a name of an existing method?''' &lt;br /&gt;
&lt;br /&gt;
Yes, it is possible to get unexpected behavior if the user does not use the qualified name when calling the ambiguous method. Ruby will first search the last module included, and continue in a descending order.  The method that is invoked may not be the method that the caller expected to run. &lt;br /&gt;
&lt;br /&gt;
''Source: Programming Ruby textbook''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''II.) Is it possible to refer to these methods using a qualified name?'''&lt;br /&gt;
 &lt;br /&gt;
Yes, by adding ‘require’ statements for the modules being used, and invoking the methods with the qualified name (ModuleName:method), conflict can be avoided.&lt;br /&gt;
&lt;br /&gt;
''Source: http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_modules.html''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''III.) Is it possible to use method aliasing to resolve the ambiguity?''' &lt;br /&gt;
&lt;br /&gt;
Yes, a library is available to allow a class to selectively mixin methods from a module, as opposed to all of the module’s methods, and alias them on the fly to avoid conflicts.&lt;br /&gt;
&lt;br /&gt;
''Source: http://rubyforge.org/docman/view.php/735/309/readme.html''&lt;br /&gt;
&lt;br /&gt;
'''IV.) What approach does good o-o design dictate?'''&lt;br /&gt;
&lt;br /&gt;
Calling the modules’ methods using qualified names is the better OO design approach. With the alias approach, the inheritance is limited and the programmer will need constantly update the list of aliases for methods needed as they come up.&lt;br /&gt;
&lt;br /&gt;
However, inheriting from the entire module and using the qualified names to avoid conflicts is a more efficient OO approach. It is also easier to read and maintain because in viewing the call, a reader will immediately gather the expected behavior of the call, as opposed to finding the alias definition and trying to make the connection.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Arjones3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5349</id>
		<title>CSC/ECE 517 Fall 2007/wiki1b 1 as</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5349"/>
		<updated>2007-10-10T18:16:22Z</updated>

		<summary type="html">&lt;p&gt;Arjones3: /* Background */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Question 1: If multiple methods with the same name are defined, there needs to be some way of determining which method a call refers to. The general rule is given on p. 123 of Programming Ruby. But questions still remain.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''I.) Is it possible to get unexpected behavior if one of the modules you are using is &amp;quot;enhanced&amp;quot; to contain a new method that happens to conflict with a name of an existing method?''' &lt;br /&gt;
&lt;br /&gt;
Yes, it is possible to get unexpected behavior if the user does not use the qualified name when calling the ambiguous method. Ruby will first search the last module included, and continue in a descending order.  The method that is invoked may not be the method that the caller expected to run. &lt;br /&gt;
&lt;br /&gt;
''Source: Programming Ruby textbook''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''II.) Is it possible to refer to these methods using a qualified name?'''&lt;br /&gt;
 &lt;br /&gt;
Yes, by adding ‘require’ statements for the modules being used, and invoking the methods with the qualified name (ModuleName:method), conflict can be avoided.&lt;br /&gt;
&lt;br /&gt;
''Source: http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_modules.html''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''III.) Is it possible to use method aliasing to resolve the ambiguity?''' &lt;br /&gt;
&lt;br /&gt;
Yes, a library is available to allow a class to selectively mixin methods from a module, as opposed to all of the module’s methods, and alias them on the fly to avoid conflicts.&lt;br /&gt;
&lt;br /&gt;
''Source: http://rubyforge.org/docman/view.php/735/309/readme.html''&lt;br /&gt;
&lt;br /&gt;
'''IV.) What approach does good o-o design dictate?'''&lt;br /&gt;
&lt;br /&gt;
Calling the modules’ methods using qualified names is the better OO design approach. With the alias approach, the inheritance is limited and the programmer will need constantly update the list of aliases for methods needed as they come up.&lt;br /&gt;
&lt;br /&gt;
However, inheriting from the entire module and using the qualified names to avoid conflicts is a more efficient OO approach. It is also easier to read and maintain because in viewing the call, a reader will immediately gather the expected behavior of the call, as opposed to finding the alias definition and trying to make the connection.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Arjones3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5348</id>
		<title>CSC/ECE 517 Fall 2007/wiki1b 1 as</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5348"/>
		<updated>2007-10-10T18:14:57Z</updated>

		<summary type="html">&lt;p&gt;Arjones3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Background ==&lt;br /&gt;
Question 1: If multiple methods with the same name are defined, there needs to be some way of determining which method a call refers to. The general rule is given on p. 123 of Programming Ruby. But questions still remain.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''I.) Is it possible to get unexpected behavior if one of the modules you are using is &amp;quot;enhanced&amp;quot; to contain a new method that happens to conflict with a name of an existing method?''' &lt;br /&gt;
&lt;br /&gt;
Yes, it is possible to get unexpected behavior if the user does not use the qualified name when calling the ambiguous method. Ruby will first search the last module included, and continue in a descending order.  The method that is invoked may not be the method that the caller expected to run. &lt;br /&gt;
&lt;br /&gt;
''Source: Programming Ruby textbook''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''II.) Is it possible to refer to these methods using a qualified name?'''&lt;br /&gt;
 &lt;br /&gt;
Yes, by adding ‘require’ statements for the modules being used, and invoking the methods with the qualified name (ModuleName:method), conflict can be avoided.&lt;br /&gt;
&lt;br /&gt;
''Source: http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_modules.html''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''III.) Is it possible to use method aliasing to resolve the ambiguity?''' &lt;br /&gt;
&lt;br /&gt;
Yes, a library is available to allow a class to selectively mixin methods from a module, as opposed to all of the module’s methods, and alias them on the fly to avoid conflicts.&lt;br /&gt;
&lt;br /&gt;
''Source: http://rubyforge.org/docman/view.php/735/309/readme.html''&lt;br /&gt;
&lt;br /&gt;
'''IV.) What approach does good o-o design dictate?'''&lt;br /&gt;
&lt;br /&gt;
Calling the modules’ methods using qualified names is the better OO design approach. With the alias approach, the inheritance is limited and the programmer will need constantly update the list of aliases for methods needed as they come up.&lt;br /&gt;
&lt;br /&gt;
However, inheriting from the entire module and using the qualified names to avoid conflicts is a more efficient OO approach. It is also easier to read and maintain because in viewing the call, a reader will immediately gather the expected behavior of the call, as opposed to finding the alias definition and trying to make the connection.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Arjones3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5347</id>
		<title>CSC/ECE 517 Fall 2007/wiki1b 1 as</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5347"/>
		<updated>2007-10-10T18:13:51Z</updated>

		<summary type="html">&lt;p&gt;Arjones3: /* Background */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Background ==&lt;br /&gt;
== Examples ==&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Question 1: If multiple methods with the same name are defined, there needs to be some way of determining which method a call refers to. The general rule is given on p. 123 of Programming Ruby. But questions still remain.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''I.) Is it possible to get unexpected behavior if one of the modules you are using is &amp;quot;enhanced&amp;quot; to contain a new method that happens to conflict with a name of an existing method?''' &lt;br /&gt;
&lt;br /&gt;
Yes, it is possible to get unexpected behavior if the user does not use the qualified name when calling the ambiguous method. Ruby will first search the last module included, and continue in a descending order.  The method that is invoked may not be the method that the caller expected to run. &lt;br /&gt;
&lt;br /&gt;
''Source: Programming Ruby textbook''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''II.) Is it possible to refer to these methods using a qualified name?'''&lt;br /&gt;
 &lt;br /&gt;
Yes, by adding ‘require’ statements for the modules being used, and invoking the methods with the qualified name (ModuleName:method), conflict can be avoided.&lt;br /&gt;
&lt;br /&gt;
''Source: http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_modules.html''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''III.) Is it possible to use method aliasing to resolve the ambiguity?''' &lt;br /&gt;
&lt;br /&gt;
Yes, a library is available to allow a class to selectively mixin methods from a module, as opposed to all of the module’s methods, and alias them on the fly to avoid conflicts.&lt;br /&gt;
&lt;br /&gt;
''Source: http://rubyforge.org/docman/view.php/735/309/readme.html''&lt;br /&gt;
&lt;br /&gt;
'''IV.) What approach does good o-o design dictate?'''&lt;br /&gt;
&lt;br /&gt;
Calling the modules’ methods using qualified names is the better OO design approach. With the alias approach, the inheritance is limited and the programmer will need constantly update the list of aliases for methods needed as they come up.&lt;br /&gt;
&lt;br /&gt;
However, inheriting from the entire module and using the qualified names to avoid conflicts is a more efficient OO approach. It is also easier to read and maintain because in viewing the call, a reader will immediately gather the expected behavior of the call, as opposed to finding the alias definition and trying to make the connection.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Arjones3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5345</id>
		<title>CSC/ECE 517 Fall 2007/wiki1b 1 as</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5345"/>
		<updated>2007-10-10T18:12:07Z</updated>

		<summary type="html">&lt;p&gt;Arjones3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Background ==&lt;br /&gt;
Question 1: If multiple methods with the same name are defined, there needs to be some way of determining which method a call refers to. The general rule is given on p. 123 of Programming Ruby. But questions still remain.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''I.) Is it possible to get unexpected behavior if one of the modules you are using is &amp;quot;enhanced&amp;quot; to contain a new method that happens to conflict with a name of an existing method?''' &lt;br /&gt;
&lt;br /&gt;
Yes, it is possible to get unexpected behavior if the user does not use the qualified name when calling the ambiguous method. Ruby will first search the last module included, and continue in a descending order.  The method that is invoked may not be the method that the caller expected to run. &lt;br /&gt;
&lt;br /&gt;
''Source: Programming Ruby textbook''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''II.) Is it possible to refer to these methods using a qualified name?'''&lt;br /&gt;
 &lt;br /&gt;
Yes, by adding ‘require’ statements for the modules being used, and invoking the methods with the qualified name (ModuleName:method), conflict can be avoided.&lt;br /&gt;
&lt;br /&gt;
''Source: http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_modules.html''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''III.) Is it possible to use method aliasing to resolve the ambiguity?''' &lt;br /&gt;
&lt;br /&gt;
Yes, a library is available to allow a class to selectively mixin methods from a module, as opposed to all of the module’s methods, and alias them on the fly to avoid conflicts.&lt;br /&gt;
&lt;br /&gt;
''Source: http://rubyforge.org/docman/view.php/735/309/readme.html''&lt;br /&gt;
&lt;br /&gt;
'''IV.) What approach does good o-o design dictate?'''&lt;br /&gt;
&lt;br /&gt;
Calling the modules’ methods using qualified names is the better OO design approach. With the alias approach, the inheritance is limited and the programmer will need constantly update the list of aliases for methods needed as they come up.&lt;br /&gt;
&lt;br /&gt;
However, inheriting from the entire module and using the qualified names to avoid conflicts is a more efficient OO approach. It is also easier to read and maintain because in viewing the call, a reader will immediately gather the expected behavior of the call, as opposed to finding the alias definition and trying to make the connection.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Arjones3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5340</id>
		<title>CSC/ECE 517 Fall 2007/wiki1b 1 as</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=5340"/>
		<updated>2007-10-10T18:08:09Z</updated>

		<summary type="html">&lt;p&gt;Arjones3: /* Question 1: If multiple methods with the same name are defined, there needs to be some way of determining which method a call refers to. The general rule is given on p. 123 of Programming Ruby. But&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== BACKGROUND ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== EXAMPLES ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== REFERENCES ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Question 1: If multiple methods with the same name are defined, there needs to be some way of determining which method a call refers to. The general rule is given on p. 123 of Programming Ruby. But questions still remain. ==&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''I.) Is it possible to get unexpected behavior if one of the modules you are using is &amp;quot;enhanced&amp;quot; to contain a new method that happens to conflict with a name of an existing method?''' &lt;br /&gt;
&lt;br /&gt;
Yes, it is possible to get unexpected behavior if the user does not use the qualified name when calling the ambiguous method. Ruby will first search the last module included, and continue in a descending order.  The method that is invoked may not be the method that the caller expected to run. &lt;br /&gt;
&lt;br /&gt;
''Source: Programming Ruby textbook''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''II.) Is it possible to refer to these methods using a qualified name?'''&lt;br /&gt;
 &lt;br /&gt;
Yes, by adding ‘require’ statements for the modules being used, and invoking the methods with the qualified name (ModuleName:method), conflict can be avoided.&lt;br /&gt;
&lt;br /&gt;
''Source: http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_modules.html''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''III.) Is it possible to use method aliasing to resolve the ambiguity?''' &lt;br /&gt;
&lt;br /&gt;
Yes, a library is available to allow a class to selectively mixin methods from a module, as opposed to all of the module’s methods, and alias them on the fly to avoid conflicts.&lt;br /&gt;
&lt;br /&gt;
''Source: http://rubyforge.org/docman/view.php/735/309/readme.html''&lt;br /&gt;
&lt;br /&gt;
'''IV.) What approach does good o-o design dictate?'''&lt;br /&gt;
&lt;br /&gt;
Calling the modules’ methods using qualified names is the better OO design approach. With the alias approach, the inheritance is limited and the programmer will need constantly update the list of aliases for methods needed as they come up.&lt;br /&gt;
&lt;br /&gt;
However, inheriting from the entire module and using the qualified names to avoid conflicts is a more efficient OO approach. It is also easier to read and maintain because in viewing the call, a reader will immediately gather the expected behavior of the call, as opposed to finding the alias definition and trying to make the connection.&lt;/div&gt;</summary>
		<author><name>Arjones3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=4800</id>
		<title>CSC/ECE 517 Fall 2007/wiki1b 1 as</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1b_1_as&amp;diff=4800"/>
		<updated>2007-09-29T14:43:34Z</updated>

		<summary type="html">&lt;p&gt;Arjones3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Question 1: If multiple methods with the same name are defined, there needs to be some way of determining which method a call refers to. The general rule is given on p. 123 of Programming Ruby. But questions still remain. ==&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''I.) Is it possible to get unexpected behavior if one of the modules you are using is &amp;quot;enhanced&amp;quot; to contain a new method that happens to conflict with a name of an existing method?''' &lt;br /&gt;
&lt;br /&gt;
Yes, it is possible to get unexpected behavior if the user does not use the qualified name when calling the ambiguous method. Ruby will first search the last module included, and continue in a descending order.  The method that is invoked may not be the method that the caller expected to run. &lt;br /&gt;
&lt;br /&gt;
''Source: Programming Ruby textbook''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''II.) Is it possible to refer to these methods using a qualified name?'''&lt;br /&gt;
 &lt;br /&gt;
Yes, by adding ‘require’ statements for the modules being used, and invoking the methods with the qualified name (ModuleName:method), conflict can be avoided.&lt;br /&gt;
&lt;br /&gt;
''Source: http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_modules.html''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''III.) Is it possible to use method aliasing to resolve the ambiguity?''' &lt;br /&gt;
&lt;br /&gt;
Yes, a library is available to allow a class to selectively mixin methods from a module, as opposed to all of the module’s methods, and alias them on the fly to avoid conflicts.&lt;br /&gt;
&lt;br /&gt;
''Source: http://rubyforge.org/docman/view.php/735/309/readme.html''&lt;br /&gt;
&lt;br /&gt;
'''IV.) What approach does good o-o design dictate?'''&lt;br /&gt;
&lt;br /&gt;
Calling the modules’ methods using qualified names is the better OO design approach. With the alias approach, the inheritance is limited and the programmer will need constantly update the list of aliases for methods needed as they come up.&lt;br /&gt;
&lt;br /&gt;
However, inheriting from the entire module and using the qualified names to avoid conflicts is a more efficient OO approach. It is also easier to read and maintain because in viewing the call, a reader will immediately gather the expected behavior of the call, as opposed to finding the alias definition and trying to make the connection.&lt;/div&gt;</summary>
		<author><name>Arjones3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1_1_as&amp;diff=4727</id>
		<title>CSC/ECE 517 Fall 2007/wiki1 1 as</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1_1_as&amp;diff=4727"/>
		<updated>2007-09-28T19:39:50Z</updated>

		<summary type="html">&lt;p&gt;Arjones3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Question 1: If multiple methods with the same name are defined, there needs to be some way of determining which method a call refers to. The general rule is given on p. 123 of Programming Ruby. But questions still remain. ==&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''I.) Is it possible to get unexpected behavior if one of the modules you are using is &amp;quot;enhanced&amp;quot; to contain a new method that happens to conflict with a name of an existing method?''' &lt;br /&gt;
&lt;br /&gt;
Yes, it is possible to get unexpected behavior if the user does not use the qualified name when calling the ambiguous method. Ruby will first search the last module included, and continue in a descending order.  The method that is invoked may not be the method that the caller expected to run. &lt;br /&gt;
&lt;br /&gt;
''Source: Programming Ruby textbook''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''II.) Is it possible to refer to these methods using a qualified name?'''&lt;br /&gt;
 &lt;br /&gt;
Yes, by adding ‘require’ statements for the modules being used, and invoking the methods with the qualified name (ModuleName:method), conflict can be avoided.&lt;br /&gt;
&lt;br /&gt;
''Source: http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_modules.html''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''III.) Is it possible to use method aliasing to resolve the ambiguity?''' &lt;br /&gt;
&lt;br /&gt;
Yes, a library is available to allow a class to selectively mixin methods from a module, as opposed to all of the module’s methods, and alias them on the fly to avoid conflicts.&lt;br /&gt;
&lt;br /&gt;
''Source: http://rubyforge.org/docman/view.php/735/309/readme.html''&lt;br /&gt;
&lt;br /&gt;
'''IV.) What approach does good o-o design dictate?'''&lt;br /&gt;
&lt;br /&gt;
Calling the modules’ methods using qualified names is the better OO design approach. With the alias approach, the inheritance is limited and the programmer will need constantly update the list of aliases for methods needed as they come up.&lt;br /&gt;
&lt;br /&gt;
However, inheriting from the entire module and using the qualified names to avoid conflicts is a more efficient OO approach. It is also easier to read and maintain because in viewing the call, a reader will immediately gather the expected behavior of the call, as opposed to finding the alias definition and trying to make the connection.&lt;/div&gt;</summary>
		<author><name>Arjones3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1_1_as&amp;diff=4726</id>
		<title>CSC/ECE 517 Fall 2007/wiki1 1 as</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1_1_as&amp;diff=4726"/>
		<updated>2007-09-28T19:39:09Z</updated>

		<summary type="html">&lt;p&gt;Arjones3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Question 1: If multiple methods with the same name are defined, there needs to be some way of determining which method a call refers to. The general rule is given on p. 123 of Programming Ruby. But questions still remain. &lt;br /&gt;
&lt;br /&gt;
 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''I.) Is it possible to get unexpected behavior if one of the modules you are using is &amp;quot;enhanced&amp;quot; to contain a new method that happens to conflict with a name of an existing method?''' &lt;br /&gt;
&lt;br /&gt;
Yes, it is possible to get unexpected behavior if the user does not use the qualified name when calling the ambiguous method. Ruby will first search the last module included, and continue in a descending order.  The method that is invoked may not be the method that the caller expected to run. &lt;br /&gt;
&lt;br /&gt;
''Source: Programming Ruby textbook''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''II.) Is it possible to refer to these methods using a qualified name?'''&lt;br /&gt;
 &lt;br /&gt;
Yes, by adding ‘require’ statements for the modules being used, and invoking the methods with the qualified name (ModuleName:method), conflict can be avoided.&lt;br /&gt;
&lt;br /&gt;
''Source: http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_modules.html''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''III.) Is it possible to use method aliasing to resolve the ambiguity?''' &lt;br /&gt;
&lt;br /&gt;
Yes, a library is available to allow a class to selectively mixin methods from a module, as opposed to all of the module’s methods, and alias them on the fly to avoid conflicts.&lt;br /&gt;
&lt;br /&gt;
''Source: http://rubyforge.org/docman/view.php/735/309/readme.html''&lt;br /&gt;
&lt;br /&gt;
'''IV.) What approach does good o-o design dictate?'''&lt;br /&gt;
&lt;br /&gt;
Calling the modules’ methods using qualified names is the better OO design approach. With the alias approach, the inheritance is limited and the programmer will need constantly update the list of aliases for methods needed as they come up.&lt;br /&gt;
&lt;br /&gt;
However, inheriting from the entire module and using the qualified names to avoid conflicts is a more efficient OO approach. It is also easier to read and maintain because in viewing the call, a reader will immediately gather the expected behavior of the call, as opposed to finding the alias definition and trying to make the connection.&lt;/div&gt;</summary>
		<author><name>Arjones3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1_1_as&amp;diff=4725</id>
		<title>CSC/ECE 517 Fall 2007/wiki1 1 as</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1_1_as&amp;diff=4725"/>
		<updated>2007-09-28T19:37:40Z</updated>

		<summary type="html">&lt;p&gt;Arjones3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Question 1: If multiple methods with the same name are defined, there needs to be some way of determining which method a call refers to. The general rule is given on p. 123 of Programming Ruby. But questions still remain. &lt;br /&gt;
 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''I.) Is it possible to get unexpected behavior if one of the modules you are using is &amp;quot;enhanced&amp;quot; to contain a new method that happens to conflict with a name of an existing method?''' &lt;br /&gt;
&lt;br /&gt;
Yes, it is possible to get unexpected behavior if the user does not use the qualified name when calling the ambiguous method. Ruby will first search the last module included, and continue in a descending order.  The method that is invoked may not be the method that the caller expected to run. &lt;br /&gt;
&lt;br /&gt;
''Source: Programming Ruby textbook''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''II.) Is it possible to refer to these methods using a qualified name?'''&lt;br /&gt;
 &lt;br /&gt;
Yes, by adding ‘require’ statements for the modules being used, and invoking the methods with the qualified name (ModuleName:method), conflict can be avoided.&lt;br /&gt;
''&lt;br /&gt;
Source: http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_modules.html''''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''III.) Is it possible to use method aliasing to resolve the ambiguity?''' &lt;br /&gt;
&lt;br /&gt;
Yes, a library is available to allow a class to selectively mixin methods from a module, as opposed to all of the module’s methods, and alias them on the fly to avoid conflicts.&lt;br /&gt;
&lt;br /&gt;
''Source: http://rubyforge.org/docman/view.php/735/309/readme.html''&lt;br /&gt;
&lt;br /&gt;
'''IV.) What approach does good o-o design dictate?'''&lt;br /&gt;
&lt;br /&gt;
Calling the modules’ methods using qualified names is the better OO design approach. With the alias approach, the inheritance is limited and the programmer will need constantly update the list of aliases for methods needed as they come up.&lt;br /&gt;
&lt;br /&gt;
However, inheriting from the entire module and using the qualified names to avoid conflicts is a more efficient OO approach. It is also easier to read and maintain because in viewing the call, a reader will immediately gather the expected behavior of the call, as opposed to finding the alias definition and trying to make the connection.&lt;/div&gt;</summary>
		<author><name>Arjones3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1_1_as&amp;diff=4724</id>
		<title>CSC/ECE 517 Fall 2007/wiki1 1 as</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1_1_as&amp;diff=4724"/>
		<updated>2007-09-28T19:37:03Z</updated>

		<summary type="html">&lt;p&gt;Arjones3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== ''Question 1:'' &lt;br /&gt;
If multiple methods with the same name are defined, there needs to be some way of determining which method a call refers to. The general rule is given on p. 123 of Programming Ruby. But questions still remain. &lt;br /&gt;
 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''I.) Is it possible to get unexpected behavior if one of the modules you are using is &amp;quot;enhanced&amp;quot; to contain a new method that happens to conflict with a name of an existing method?''' &lt;br /&gt;
&lt;br /&gt;
Yes, it is possible to get unexpected behavior if the user does not use the qualified name when calling the ambiguous method. Ruby will first search the last module included, and continue in a descending order.  The method that is invoked may not be the method that the caller expected to run. &lt;br /&gt;
&lt;br /&gt;
''Source: Programming Ruby textbook''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''II.) Is it possible to refer to these methods using a qualified name?'''&lt;br /&gt;
 &lt;br /&gt;
Yes, by adding ‘require’ statements for the modules being used, and invoking the methods with the qualified name (ModuleName:method), conflict can be avoided.&lt;br /&gt;
''&lt;br /&gt;
Source: http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_modules.html''''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''III.) Is it possible to use method aliasing to resolve the ambiguity?''' &lt;br /&gt;
&lt;br /&gt;
Yes, a library is available to allow a class to selectively mixin methods from a module, as opposed to all of the module’s methods, and alias them on the fly to avoid conflicts.&lt;br /&gt;
&lt;br /&gt;
''Source: http://rubyforge.org/docman/view.php/735/309/readme.html''&lt;br /&gt;
&lt;br /&gt;
'''IV.) What approach does good o-o design dictate?'''&lt;br /&gt;
&lt;br /&gt;
Calling the modules’ methods using qualified names is the better OO design approach. With the alias approach, the inheritance is limited and the programmer will need constantly update the list of aliases for methods needed as they come up.&lt;br /&gt;
&lt;br /&gt;
However, inheriting from the entire module and using the qualified names to avoid conflicts is a more efficient OO approach. It is also easier to read and maintain because in viewing the call, a reader will immediately gather the expected behavior of the call, as opposed to finding the alias definition and trying to make the connection.&lt;/div&gt;</summary>
		<author><name>Arjones3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1_1_as&amp;diff=4723</id>
		<title>CSC/ECE 517 Fall 2007/wiki1 1 as</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1_1_as&amp;diff=4723"/>
		<updated>2007-09-28T19:35:58Z</updated>

		<summary type="html">&lt;p&gt;Arjones3: /* Question 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Question 1&lt;br /&gt;
If multiple methods with the same name are defined, there needs to be some way of determining which method a call refers to. The general rule is given on p. 123 of Programming Ruby. But questions still remain. &lt;br /&gt;
==&lt;br /&gt;
&lt;br /&gt;
'''I.) Is it possible to get unexpected behavior if one of the modules you are using is &amp;quot;enhanced&amp;quot; to contain a new method that happens to conflict with a name of an existing method?''' &lt;br /&gt;
&lt;br /&gt;
Yes, it is possible to get unexpected behavior if the user does not use the qualified name when calling the ambiguous method. Ruby will first search the last module included, and continue in a descending order.  The method that is invoked may not be the method that the caller expected to run. &lt;br /&gt;
&lt;br /&gt;
''Source: Programming Ruby textbook''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''II.) Is it possible to refer to these methods using a qualified name?'''&lt;br /&gt;
 &lt;br /&gt;
Yes, by adding ‘require’ statements for the modules being used, and invoking the methods with the qualified name (ModuleName:method), conflict can be avoided.&lt;br /&gt;
''&lt;br /&gt;
Source: http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_modules.html''''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''III.) Is it possible to use method aliasing to resolve the ambiguity?''' &lt;br /&gt;
&lt;br /&gt;
Yes, a library is available to allow a class to selectively mixin methods from a module, as opposed to all of the module’s methods, and alias them on the fly to avoid conflicts.&lt;br /&gt;
&lt;br /&gt;
''Source: http://rubyforge.org/docman/view.php/735/309/readme.html''&lt;br /&gt;
&lt;br /&gt;
'''IV.) What approach does good o-o design dictate?'''&lt;br /&gt;
&lt;br /&gt;
Calling the modules’ methods using qualified names is the better OO design approach. With the alias approach, the inheritance is limited and the programmer will need constantly update the list of aliases for methods needed as they come up.&lt;br /&gt;
&lt;br /&gt;
However, inheriting from the entire module and using the qualified names to avoid conflicts is a more efficient OO approach. It is also easier to read and maintain because in viewing the call, a reader will immediately gather the expected behavior of the call, as opposed to finding the alias definition and trying to make the connection.&lt;/div&gt;</summary>
		<author><name>Arjones3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1_1_as&amp;diff=4722</id>
		<title>CSC/ECE 517 Fall 2007/wiki1 1 as</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1_1_as&amp;diff=4722"/>
		<updated>2007-09-28T19:35:25Z</updated>

		<summary type="html">&lt;p&gt;Arjones3: /* Question 1: If multiple methods with the same name are defined, there needs to be some way of determining which method a call refers to. The general rule is given on p. 123 of Programming Ruby. But&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Question 1==&lt;br /&gt;
'''If multiple methods with the same name are defined, there needs to be some way of determining which method a call refers to. The general rule is given on p. 123 of Programming Ruby. But questions still remain. &lt;br /&gt;
''' &lt;br /&gt;
&lt;br /&gt;
'''I.) Is it possible to get unexpected behavior if one of the modules you are using is &amp;quot;enhanced&amp;quot; to contain a new method that happens to conflict with a name of an existing method?''' &lt;br /&gt;
&lt;br /&gt;
Yes, it is possible to get unexpected behavior if the user does not use the qualified name when calling the ambiguous method. Ruby will first search the last module included, and continue in a descending order.  The method that is invoked may not be the method that the caller expected to run. &lt;br /&gt;
&lt;br /&gt;
''Source: Programming Ruby textbook''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''II.) Is it possible to refer to these methods using a qualified name?'''&lt;br /&gt;
 &lt;br /&gt;
Yes, by adding ‘require’ statements for the modules being used, and invoking the methods with the qualified name (ModuleName:method), conflict can be avoided.&lt;br /&gt;
''&lt;br /&gt;
Source: http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_modules.html''''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''III.) Is it possible to use method aliasing to resolve the ambiguity?''' &lt;br /&gt;
&lt;br /&gt;
Yes, a library is available to allow a class to selectively mixin methods from a module, as opposed to all of the module’s methods, and alias them on the fly to avoid conflicts.&lt;br /&gt;
&lt;br /&gt;
''Source: http://rubyforge.org/docman/view.php/735/309/readme.html''&lt;br /&gt;
&lt;br /&gt;
'''IV.) What approach does good o-o design dictate?'''&lt;br /&gt;
&lt;br /&gt;
Calling the modules’ methods using qualified names is the better OO design approach. With the alias approach, the inheritance is limited and the programmer will need constantly update the list of aliases for methods needed as they come up.&lt;br /&gt;
&lt;br /&gt;
However, inheriting from the entire module and using the qualified names to avoid conflicts is a more efficient OO approach. It is also easier to read and maintain because in viewing the call, a reader will immediately gather the expected behavior of the call, as opposed to finding the alias definition and trying to make the connection.&lt;/div&gt;</summary>
		<author><name>Arjones3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1_1_as&amp;diff=4721</id>
		<title>CSC/ECE 517 Fall 2007/wiki1 1 as</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki1_1_as&amp;diff=4721"/>
		<updated>2007-09-28T19:34:18Z</updated>

		<summary type="html">&lt;p&gt;Arjones3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Question 1: If multiple methods with the same name are defined, there needs to be some way of determining which method a call refers to. The general rule is given on p. 123 of Programming Ruby. But questions still remain. ==&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
'''I.) Is it possible to get unexpected behavior if one of the modules you are using is &amp;quot;enhanced&amp;quot; to contain a new method that happens to conflict with a name of an existing method?''' &lt;br /&gt;
&lt;br /&gt;
Yes, it is possible to get unexpected behavior if the user does not use the qualified name when calling the ambiguous method. Ruby will first search the last module included, and continue in a descending order.  The method that is invoked may not be the method that the caller expected to run. &lt;br /&gt;
&lt;br /&gt;
''Source: Programming Ruby textbook''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''II.) Is it possible to refer to these methods using a qualified name?'''&lt;br /&gt;
 &lt;br /&gt;
Yes, by adding ‘require’ statements for the modules being used, and invoking the methods with the qualified name (ModuleName:method), conflict can be avoided.&lt;br /&gt;
''&lt;br /&gt;
Source: http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_modules.html''''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''III.) Is it possible to use method aliasing to resolve the ambiguity?''' &lt;br /&gt;
&lt;br /&gt;
Yes, a library is available to allow a class to selectively mixin methods from a module, as opposed to all of the module’s methods, and alias them on the fly to avoid conflicts.&lt;br /&gt;
&lt;br /&gt;
''Source: http://rubyforge.org/docman/view.php/735/309/readme.html''&lt;br /&gt;
&lt;br /&gt;
'''IV.) What approach does good o-o design dictate?'''&lt;br /&gt;
&lt;br /&gt;
Calling the modules’ methods using qualified names is the better OO design approach. With the alias approach, the inheritance is limited and the programmer will need constantly update the list of aliases for methods needed as they come up.&lt;br /&gt;
&lt;br /&gt;
However, inheriting from the entire module and using the qualified names to avoid conflicts is a more efficient OO approach. It is also easier to read and maintain because in viewing the call, a reader will immediately gather the expected behavior of the call, as opposed to finding the alias definition and trying to make the connection.&lt;/div&gt;</summary>
		<author><name>Arjones3</name></author>
	</entry>
</feed>