<?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=Hkdavis</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=Hkdavis"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Hkdavis"/>
	<updated>2026-05-22T22:02: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_Summer_2008/wiki3_7_shopper&amp;diff=16651</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 7 shopper</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_7_shopper&amp;diff=16651"/>
		<updated>2008-08-01T09:33:34Z</updated>

		<summary type="html">&lt;p&gt;Hkdavis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Shopper pattern =&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The idea of a &amp;quot;shopping cart&amp;quot; is ubiquitous in e-commerce. This idea lends itself to abstraction in the form of a Shopper pattern. Find examples and descriptions that are suitable for teaching this pattern, if possible, including some non-obvious applications. Write up your findings in the form of a narrative. Hint: You will have an easier time of searching if you exclude any pages including the terms &amp;quot;sewing&amp;quot; or &amp;quot;fabric&amp;quot;!&lt;br /&gt;
&lt;br /&gt;
== The Shopping Cart Pattern ==&lt;br /&gt;
&lt;br /&gt;
The idea of a shopping cart in e-commerce comes from the physical shopping cart used in brick and mortar stores. It is used to collect and store the items that the user wants to buy. On a shopping website, the items aren't physical, so the shopping cart can do much more than it's physical counterpart. It can be used to easily add or remove items, change the quantity of an item already in the cart, and quickly total the cost of the chosen items. &lt;br /&gt;
&lt;br /&gt;
It is an extension of the [http://www.welie.com/patterns/showPattern.php?patternID=favourites Collector] pattern. A Collector is simply a temporary collection of generic items, which provides basic functionality such as adding and removing items. &lt;br /&gt;
&lt;br /&gt;
The software typically interfaces with payment and inventory features of sites. In commercial packages, it is often sold as a bundle with secure payment software. The cart is usually aware of the type of inventory it collects, for instance, differentiating between physical goods (books, clothing), and services (software licenses, contract renewal fees). &lt;br /&gt;
&lt;br /&gt;
It's basic design has aided countless websites since the advent of e-commerce. It's a simple concept, but when implemented well, gives a great improvement in user experience [http://www.smashingmagazine.com/2008/02/07/shopping-carts-gallery-examples-and-good-practices/] &lt;br /&gt;
&lt;br /&gt;
From [http://ui-patterns.com/pattern/ShoppingCart ui-patterns.com], websites can benefit from the use of a shopping cart in the following situations:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Use when the user can possibly buy more than one product.&lt;br /&gt;
* Use when the user can possibly buy more than one instance of a product.&lt;br /&gt;
* Use when the user may want to return later to carry on shopping&lt;br /&gt;
* Use when the user may want to return at a later time to conduct payment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Some of the features of shopping carts include:&lt;br /&gt;
&lt;br /&gt;
* Adding new items to the cart&lt;br /&gt;
* Removing items from the cart&lt;br /&gt;
* Changing the quantity of items&lt;br /&gt;
* Totaling the cost of the items&lt;br /&gt;
&lt;br /&gt;
These are the basic requirements that a shopping cart should provide. It makes integration with inventory and purchasing software easy. A list of all the items purchased can be forwarded to the inventory system so that the necessary stock levels can be reduced, and the invoice can be sent to the purchasing software, which can handle the payment itself. &lt;br /&gt;
&lt;br /&gt;
== The Shopper pattern ==&lt;br /&gt;
&lt;br /&gt;
=== Interaction with shopping cart ===&lt;br /&gt;
A Shopper is a model of a user who selects items and makes purchases at an e-commerce site. The pattern incorporates features of the shopping cart, allowing the shopper to interact with the cart in a seamless way. Much like a physical shopping cart is useless without a shopper to push it around and use it, a software shopping cart is useless without the user to drive it. &lt;br /&gt;
&lt;br /&gt;
The Shopper is an extension of the shopping cart pattern. Just like a brick and mortar store, where each shopper has her own cart, each implementation of the shopper pattern has a shopping cart. The shopper interacts with the cart by adding and removing items, changing quantities, and initiating checkout. &lt;br /&gt;
&lt;br /&gt;
A shopper is a user of a shopping cart, and so it makes sense that the Shopper patterns would be designed to interact with those operations. That means it is able to add and remove items from the cart, change quantities of items, and initiate checkout. It represents a user of a e-commerce site, and it's interactions with the site and the shopping cart. &lt;br /&gt;
&lt;br /&gt;
=== Extension of shopping cart pattern ===&lt;br /&gt;
&lt;br /&gt;
The Shopper pattern does more however. From [http://www.cix.co.uk/~smallmemory/almanac/Doble96.html], &amp;quot;A consumer creates a shopper object with a list of requests. The shopper traverses a set of objects and collects the requested items.&amp;quot; The requests are purchasable items that the user wants to place in her cart. The Shopper object traverses the set of requested items, and places them in the cart. In this way, the Shopper provides user interaction with the cart, as well as automated interaction for bulk operations. &lt;br /&gt;
&lt;br /&gt;
Many websites track individual consumers, and use algorithms to recommend items she may be interested in, or to store payment information. The Shopper object can also be used to track past purchases to be used to make those recommendations, and to store user account information. &lt;br /&gt;
&lt;br /&gt;
Past purchases can also be used outside of the typical shopping cart scenario. Oftentimes stores allow items to be return within a certain period, or track applicable warranties. The Shopper uses information about historical purchases, such as the date of the purchase and warranty information about individual items, to provide a streamlined interface for not just purchases, but the interaction with the site across the entire shopping experience. &lt;br /&gt;
&lt;br /&gt;
Many online stores allow users to create an account that stores, among other things, shipping addresses, payments information and billing address, and preferred shipping methods [http://www.internettg.org/newsletter/dec01/article_chaparro.html]. The shopper can return to the site later, and quickly make purchases, or track past purchases. &lt;br /&gt;
&lt;br /&gt;
=== Examples ===&lt;br /&gt;
&lt;br /&gt;
This diagram illustrates the basic design of a Shopper, and it's interactions with other parts of the system. It is linked to the inventory and payment systems, and is composed of the user's account information, her current shopping cart, as well as data about past purchases. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Shopper_Diagram.png]]&lt;br /&gt;
&lt;br /&gt;
Figure 1: High level design of Shopper pattern.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://www.welie.com/patterns/showPattern.php?patternID=shopping-cart Welie.com] gives several good examples of shopping carts form many popular online stores. &lt;br /&gt;
&lt;br /&gt;
[http://davidhayden.com/blog/dave/archive/2005/03/27/895.aspx David Hayden] gives a sample implementation of a shopping cart. &lt;br /&gt;
&lt;br /&gt;
== Related Links ==&lt;br /&gt;
&lt;br /&gt;
Shopping Cart&lt;br /&gt;
* http://ui-patterns.com/pattern/ShoppingCart&lt;br /&gt;
* http://en.wikipedia.org/wiki/Shopping_cart_software&lt;br /&gt;
* http://www.smashingmagazine.com/2008/02/07/shopping-carts-gallery-examples-and-good-practices/&lt;br /&gt;
* http://www.welie.com/patterns/showPattern.php?patternID=shopping-cart&lt;br /&gt;
* http://www.welie.com/patterns/showPattern.php?patternID=favourites&lt;br /&gt;
* http://books.google.com/books?id=-KRQAAAAMAAJ&amp;amp;dq=shopper+software+pattern+-fabric+-sewing&amp;amp;q=shopper+&amp;amp;pgis=1&amp;amp;hl=en&lt;br /&gt;
* http://davidhayden.com/blog/dave/archive/2005/03/27/895.aspx&lt;br /&gt;
* http://uipatternfactory.com/p=shopping-cart/&lt;br /&gt;
&lt;br /&gt;
Shopper &lt;br /&gt;
* http://www.cix.co.uk/~smallmemory/almanac/Doble96.html&lt;/div&gt;</summary>
		<author><name>Hkdavis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_7_shopper&amp;diff=16650</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 7 shopper</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_7_shopper&amp;diff=16650"/>
		<updated>2008-08-01T09:21:59Z</updated>

		<summary type="html">&lt;p&gt;Hkdavis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Shopper pattern =&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The idea of a &amp;quot;shopping cart&amp;quot; is ubiquitous in e-commerce. This idea lends itself to abstraction in the form of a Shopper pattern. Find examples and descriptions that are suitable for teaching this pattern, if possible, including some non-obvious applications. Write up your findings in the form of a narrative. Hint: You will have an easier time of searching if you exclude any pages including the terms &amp;quot;sewing&amp;quot; or &amp;quot;fabric&amp;quot;!&lt;br /&gt;
&lt;br /&gt;
== The Shopping Cart Pattern ==&lt;br /&gt;
&lt;br /&gt;
The idea of a shopping cart in e-commerce comes from the physical shopping cart used in brick and mortar stores. It is used to collect and store the items that the user wants to buy. On a shopping website, the items aren't physical, so the shopping cart can do much more than it's physical counterpart. It can be used to easily add or remove items, change the quantity of an item already in the cart, and quickly total the cost of the chosen items. &lt;br /&gt;
&lt;br /&gt;
The software typically interfaces with payment and inventory features of sites. In commercial packages, it is often sold as a bundle with secure payment software. The cart is usually aware of the type of inventory it collects, for instance, differentiating between physical goods (books, clothing), and services (software licenses, contract renewal fees). &lt;br /&gt;
&lt;br /&gt;
It's basic design has aided countless websites since the advent of e-commerce. It's a simple concept, but when implemented well, gives a great improvement in user experience [http://www.smashingmagazine.com/2008/02/07/shopping-carts-gallery-examples-and-good-practices/] &lt;br /&gt;
&lt;br /&gt;
From [http://ui-patterns.com/pattern/ShoppingCart ui-patterns.com], websites can benefit from the use of a shopping cart in the following situations:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Use when the user can possibly buy more than one product.&lt;br /&gt;
* Use when the user can possibly buy more than one instance of a product.&lt;br /&gt;
* Use when the user may want to return later to carry on shopping&lt;br /&gt;
* Use when the user may want to return at a later time to conduct payment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Some of the features of shopping carts include:&lt;br /&gt;
&lt;br /&gt;
* Adding new items to the cart&lt;br /&gt;
* Removing items from the cart&lt;br /&gt;
* Changing the quantity of items&lt;br /&gt;
* Totaling the cost of the items&lt;br /&gt;
&lt;br /&gt;
These are the basic requirements that a shopping cart should provide. It makes integration with inventory and purchasing software easy. A list of all the items purchased can be forwarded to the inventory system so that the necessary stock levels can be reduced, and the invoice can be sent to the purchasing software, which can handle the payment itself. &lt;br /&gt;
&lt;br /&gt;
== The Shopper pattern ==&lt;br /&gt;
&lt;br /&gt;
=== Interaction with shopping cart ===&lt;br /&gt;
A Shopper is a model of a user who selects items and makes purchases at an e-commerce site. The pattern incorporates features of the shopping cart, allowing the shopper to interact with the cart in a seamless way. Much like a physical shopping cart is useless without a shopper to push it around and use it, a software shopping cart is useless without the user to drive it. &lt;br /&gt;
&lt;br /&gt;
The Shopper is an extension of the shopping cart pattern. Just like a brick and mortar store, where each shopper has her own cart, each implementation of the shopper pattern has a shopping cart. The shopper interacts with the cart by adding and removing items, changing quantities, and initiating checkout. &lt;br /&gt;
&lt;br /&gt;
A shopper is a user of a shopping cart, and so it makes sense that the Shopper patterns would be designed to interact with those operations. That means it is able to add and remove items from the cart, change quantities of items, and initiate checkout. It represents a user of a e-commerce site, and it's interactions with the site and the shopping cart. &lt;br /&gt;
&lt;br /&gt;
=== Extension of shopping cart pattern ===&lt;br /&gt;
&lt;br /&gt;
The Shopper pattern does more however. From [http://www.cix.co.uk/~smallmemory/almanac/Doble96.html], &amp;quot;A consumer creates a shopper object with a list of requests. The shopper traverses a set of objects and collects the requested items.&amp;quot; The requests are purchasable items that the user wants to place in her cart. The Shopper object traverses the set of requested items, and places them in the cart. In this way, the Shopper provides user interaction with the cart, as well as automated interaction for bulk operations. &lt;br /&gt;
&lt;br /&gt;
Many websites track individual consumers, and use algorithms to recommend items she may be interested in, or to store payment information. The Shopper object can also be used to track past purchases to be used to make those recommendations, and to store user account information. &lt;br /&gt;
&lt;br /&gt;
Past purchases can also be used outside of the typical shopping cart scenario. Oftentimes stores allow items to be return within a certain period, or track applicable warranties. The Shopper uses information about historical purchases, such as the date of the purchase and warranty information about individual items, to provide a streamlined interface for not just purchases, but the interaction with the site across the entire shopping experience. &lt;br /&gt;
&lt;br /&gt;
Many online stores allow users to create an account that stores, among other things, shipping addresses, payments information and billing address, and preferred shipping methods [http://www.internettg.org/newsletter/dec01/article_chaparro.html]. The shopper can return to the site later, and quickly make purchases, or track past purchases. &lt;br /&gt;
&lt;br /&gt;
This diagram illustrates the basic design of a Shopper, and it's interactions with other parts of the system. It is linked to the inventory and payment systems, and is composed of the user's account information, her current shopping cart, as well as data about past purchases. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Shopper_Diagram.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Related Links ==&lt;br /&gt;
&lt;br /&gt;
Shopping Cart&lt;br /&gt;
* http://ui-patterns.com/pattern/ShoppingCart&lt;br /&gt;
* http://en.wikipedia.org/wiki/Shopping_cart_software&lt;br /&gt;
* http://www.smashingmagazine.com/2008/02/07/shopping-carts-gallery-examples-and-good-practices/&lt;br /&gt;
* http://www.welie.com/patterns/showPattern.php?patternID=shopping-cart&lt;br /&gt;
* http://books.google.com/books?id=-KRQAAAAMAAJ&amp;amp;dq=shopper+software+pattern+-fabric+-sewing&amp;amp;q=shopper+&amp;amp;pgis=1&amp;amp;hl=en&lt;br /&gt;
* http://davidhayden.com/blog/dave/archive/2005/03/27/895.aspx&lt;br /&gt;
* http://uipatternfactory.com/p=shopping-cart/&lt;br /&gt;
&lt;br /&gt;
Shopper &lt;br /&gt;
* http://www.cix.co.uk/~smallmemory/almanac/Doble96.html&lt;/div&gt;</summary>
		<author><name>Hkdavis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_7_shopper&amp;diff=16649</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 7 shopper</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_7_shopper&amp;diff=16649"/>
		<updated>2008-08-01T09:17:21Z</updated>

		<summary type="html">&lt;p&gt;Hkdavis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Shopper pattern =&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The idea of a &amp;quot;shopping cart&amp;quot; is ubiquitous in e-commerce. This idea lends itself to abstraction in the form of a Shopper pattern. Find examples and descriptions that are suitable for teaching this pattern, if possible, including some non-obvious applications. Write up your findings in the form of a narrative. Hint: You will have an easier time of searching if you exclude any pages including the terms &amp;quot;sewing&amp;quot; or &amp;quot;fabric&amp;quot;!&lt;br /&gt;
&lt;br /&gt;
== The Shopping Cart Pattern ==&lt;br /&gt;
&lt;br /&gt;
The idea of a shopping cart in e-commerce comes from the physical shopping cart used in brick and mortar stores. It is used to collect and store the items that the user wants to buy. On a shopping website, the items aren't physical, so the shopping cart can do much more than it's physical counterpart. It can be used to easily add or remove items, change the quantity of an item already in the cart, and quickly total the cost of the chosen items. &lt;br /&gt;
&lt;br /&gt;
The software typically interfaces with payment and inventory features of sites. In commercial packages, it is often sold as a bundle with secure payment software. The cart is usually aware of the type of inventory it collects, for instance, differentiating between physical goods (books, clothing), and services (software licenses, contract renewal fees). &lt;br /&gt;
&lt;br /&gt;
It's basic design has aided countless websites since the advent of e-commerce. It's a simple concept, but when implemented well, gives a great improvement in user experience [http://www.smashingmagazine.com/2008/02/07/shopping-carts-gallery-examples-and-good-practices/] &lt;br /&gt;
&lt;br /&gt;
From [http://ui-patterns.com/pattern/ShoppingCart ui-patterns.com], websites can benefit from the use of a shopping cart in the following situations:&lt;br /&gt;
&lt;br /&gt;
* Use when the user can possibly buy more than one product.&lt;br /&gt;
* Use when the user can possibly buy more than one instance of a product.&lt;br /&gt;
* Use when the user may want to return later to carry on shopping&lt;br /&gt;
* Use when the user may want to return at a later time to conduct payment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Some of the features of shopping carts include:&lt;br /&gt;
&lt;br /&gt;
* Adding new items to the cart&lt;br /&gt;
* Removing items from the cart&lt;br /&gt;
* Changing the quantity of items&lt;br /&gt;
* Totaling the cost of the items&lt;br /&gt;
&lt;br /&gt;
These are the basic requirements that a shopping cart should provide. It makes integration with inventory and purchasing software easy. A list of all the items purchased can be forwarded to the inventory system so that the necessary stock levels can be reduced, and the invoice can be sent to the purchasing software, which can handle the payment itself. &lt;br /&gt;
&lt;br /&gt;
== The Shopper pattern ==&lt;br /&gt;
&lt;br /&gt;
=== Interaction with shopping cart ===&lt;br /&gt;
A Shopper is a model of a user who selects items and makes purchases at an e-commerce site. The pattern incorporates features of the shopping cart, allowing the shopper to interact with the cart in a seamless way. Much like a physical shopping cart is useless without a shopper to push it around and use it, a software shopping cart is useless without the user to drive it. &lt;br /&gt;
&lt;br /&gt;
The Shopper is an extension of the shopping cart pattern. Just like a brick and mortar store, where each shopper has her own cart, each implementation of the shopper pattern has a shopping cart. The shopper interacts with the cart by adding and removing items, changing quantities, and initiating checkout. &lt;br /&gt;
&lt;br /&gt;
A shopper is a user of a shopping cart, and so it makes sense that the Shopper patterns would be designed to interact with those operations. That means it is able to add and remove items from the cart, change quantities of items, and initiate checkout. It represents a user of a e-commerce site, and it's interactions with the site and the shopping cart. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Extension of shopping cart pattern ===&lt;br /&gt;
&lt;br /&gt;
The Shopper pattern does more however. From [http://www.cix.co.uk/~smallmemory/almanac/Doble96.html], &amp;quot;A consumer creates a shopper object with a list of requests. The shopper traverses a set of objects and collects the requested items.&amp;quot; The requests are purchasable items that the user wants to place in her cart. The Shopper object traverses the set of requested items, and places them in the cart. In this way, the Shopper provides user interaction with the cart, as well as automated interaction for bulk operations. &lt;br /&gt;
&lt;br /&gt;
Many websites track individual consumers, and use algorithms to recommend items she may be interested in, or to store payment information. The Shopper object can also be used to track past purchases to be used to make those recommendations, and to store user account information. &lt;br /&gt;
&lt;br /&gt;
Past purchases can also be used outside of the typical shopping cart scenario. Oftentimes stores allow items to be return within a certain period, or track applicable warranties. The Shopper uses information about past purchases, such as the date of the purchase and warranty information about individual items, to provide a streamlined interface for not just purchases, but the interaction with the site across the entire shopping experience. &lt;br /&gt;
&lt;br /&gt;
Many online stores allow users to create an account that stores, among other things, shipping addresses, payments information and billing address, and preferred shipping methods [http://www.internettg.org/newsletter/dec01/article_chaparro.html]. The shopper &lt;br /&gt;
&lt;br /&gt;
== Related Links ==&lt;br /&gt;
&lt;br /&gt;
Shopping Cart&lt;br /&gt;
* http://ui-patterns.com/pattern/ShoppingCart&lt;br /&gt;
* http://en.wikipedia.org/wiki/Shopping_cart_software&lt;br /&gt;
* http://www.smashingmagazine.com/2008/02/07/shopping-carts-gallery-examples-and-good-practices/&lt;br /&gt;
* http://www.welie.com/patterns/showPattern.php?patternID=shopping-cart&lt;br /&gt;
* http://books.google.com/books?id=-KRQAAAAMAAJ&amp;amp;dq=shopper+software+pattern+-fabric+-sewing&amp;amp;q=shopper+&amp;amp;pgis=1&amp;amp;hl=en&lt;br /&gt;
* http://davidhayden.com/blog/dave/archive/2005/03/27/895.aspx&lt;br /&gt;
* http://uipatternfactory.com/p=shopping-cart/&lt;br /&gt;
&lt;br /&gt;
Shopper &lt;br /&gt;
* http://www.cix.co.uk/~smallmemory/almanac/Doble96.html&lt;/div&gt;</summary>
		<author><name>Hkdavis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Shopper_Diagram.png&amp;diff=16648</id>
		<title>File:Shopper Diagram.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Shopper_Diagram.png&amp;diff=16648"/>
		<updated>2008-08-01T09:16:45Z</updated>

		<summary type="html">&lt;p&gt;Hkdavis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hkdavis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_7_shopper&amp;diff=16647</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 7 shopper</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_7_shopper&amp;diff=16647"/>
		<updated>2008-08-01T08:51:19Z</updated>

		<summary type="html">&lt;p&gt;Hkdavis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Shopper pattern =&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The idea of a &amp;quot;shopping cart&amp;quot; is ubiquitous in e-commerce. This idea lends itself to abstraction in the form of a Shopper pattern. Find examples and descriptions that are suitable for teaching this pattern, if possible, including some non-obvious applications. Write up your findings in the form of a narrative. Hint: You will have an easier time of searching if you exclude any pages including the terms &amp;quot;sewing&amp;quot; or &amp;quot;fabric&amp;quot;!&lt;br /&gt;
&lt;br /&gt;
== The Shopping Cart Pattern ==&lt;br /&gt;
&lt;br /&gt;
The idea of a shopping cart in e-commerce comes from the physical shopping cart used in brick and mortar stores. It is used to collect and store the items that the user wants to buy. On a shopping website, the items aren't physical, so the shopping cart can do much more than it's physical counterpart. It can be used to easily add or remove items, change the quantity of an item already in the cart, and quickly total the cost of the chosen items. &lt;br /&gt;
&lt;br /&gt;
The software typically interfaces with payment and inventory features of sites. In commercial packages, it is often sold as a bundle with secure payment software. The cart is usually aware of the type of inventory it collects, for instance, differentiating between physical goods (books, clothing), and services (software licenses, contract renewal fees). &lt;br /&gt;
&lt;br /&gt;
It's basic design has aided countless websites since the advent of e-commerce. It's a simple concept, but when implemented well, gives a great improvement in user experience [http://www.smashingmagazine.com/2008/02/07/shopping-carts-gallery-examples-and-good-practices/] &lt;br /&gt;
&lt;br /&gt;
From [http://ui-patterns.com/pattern/ShoppingCart ui-patterns.com], websites can benefit from the use of a shopping cart in the following situations:&lt;br /&gt;
&lt;br /&gt;
* Use when the user can possibly buy more than one product.&lt;br /&gt;
* Use when the user can possibly buy more than one instance of a product.&lt;br /&gt;
* Use when the user may want to return later to carry on shopping&lt;br /&gt;
* Use when the user may want to return at a later time to conduct payment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Some of the features of shopping carts include:&lt;br /&gt;
&lt;br /&gt;
* Adding new items to the cart&lt;br /&gt;
* Removing items from the cart&lt;br /&gt;
* Changing the quantity of items&lt;br /&gt;
* Totaling the cost of the items&lt;br /&gt;
&lt;br /&gt;
These are the basic requirements that a shopping cart should provide. It makes integration with inventory and purchasing software easy. A list of all the items purchased can be forwarded to the inventory system so that the necessary stock levels can be reduced, and the invoice can be sent to the purchasing software, which can handle the payment itself. &lt;br /&gt;
&lt;br /&gt;
== The Shopper pattern ==&lt;br /&gt;
&lt;br /&gt;
A Shopper is a model of a user who selects items and makes purchases at an e-commerce site. The pattern incorporates features of the shopping cart, allowing the shopper to interact with the cart in a seamless way. Much like a physical shopping cart is useless without a shopper to push it around and use it, a software shopping cart is useless without the user to drive it. &lt;br /&gt;
&lt;br /&gt;
The Shopper is an extension of the shopping cart pattern. Just like a brick and mortar store, where each shopper has her own cart, each implementation of the shopper pattern has a shopping cart. The shopper interacts with the cart by adding and removing items, changing quantities, and initiating checkout. The Shopper pattern does more however. From [http://www.cix.co.uk/~smallmemory/almanac/Doble96.html], &amp;quot;A consumer creates a shopper object with a list of requests. The shopper traverses a set of objects and collects the requested items.&amp;quot; The requests are purchasable items that the user wants to place in her cart. The Shopper object traverses the set of requested items, and places them in the cart. In this way, the Shopper provides user interaction with the cart, as well as automated interaction for bulk operations. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A shopper is a user of a shopping cart, and so it makes sense that the Shopper patterns would be designed to interact with those operations. That means it is able to add and remove items from the cart, change quantities of items, and initiate checkout. It represents a user of a e-commerce site, and it's interactions with the site and the shopping cart. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Many websites track individual consumers, and use algorithms to recommend items she may be interested in. The Shopper object can also be used to track past purchases to be used to make those recommendations. &lt;br /&gt;
&lt;br /&gt;
Past purchases can also be used outside of the typical shopping cart scenario. Oftentimes stores allow items to be return within a certain period, or track applicable warranties. The Shopper uses information about past purchases, such as the date of the purchase and warranty information about individual items, to provide a streamlined interface for not just purchases, but the interaction with the site across the entire shopping experience. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Related Links ==&lt;br /&gt;
&lt;br /&gt;
Shopping Cart&lt;br /&gt;
* http://ui-patterns.com/pattern/ShoppingCart&lt;br /&gt;
* http://en.wikipedia.org/wiki/Shopping_cart_software&lt;br /&gt;
* http://www.smashingmagazine.com/2008/02/07/shopping-carts-gallery-examples-and-good-practices/&lt;br /&gt;
* http://www.welie.com/patterns/showPattern.php?patternID=shopping-cart&lt;br /&gt;
* http://books.google.com/books?id=-KRQAAAAMAAJ&amp;amp;dq=shopper+software+pattern+-fabric+-sewing&amp;amp;q=shopper+&amp;amp;pgis=1&amp;amp;hl=en&lt;br /&gt;
* http://davidhayden.com/blog/dave/archive/2005/03/27/895.aspx&lt;br /&gt;
* http://uipatternfactory.com/p=shopping-cart/&lt;br /&gt;
&lt;br /&gt;
Shopper &lt;br /&gt;
* http://www.cix.co.uk/~smallmemory/almanac/Doble96.html&lt;/div&gt;</summary>
		<author><name>Hkdavis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_7_shopper&amp;diff=16646</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 7 shopper</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_7_shopper&amp;diff=16646"/>
		<updated>2008-08-01T08:24:37Z</updated>

		<summary type="html">&lt;p&gt;Hkdavis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Shopper pattern =&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The idea of a &amp;quot;shopping cart&amp;quot; is ubiquitous in e-commerce. This idea lends itself to abstraction in the form of a Shopper pattern. Find examples and descriptions that are suitable for teaching this pattern, if possible, including some non-obvious applications. Write up your findings in the form of a narrative. Hint: You will have an easier time of searching if you exclude any pages including the terms &amp;quot;sewing&amp;quot; or &amp;quot;fabric&amp;quot;!&lt;br /&gt;
&lt;br /&gt;
== The Shopping Cart Pattern ==&lt;br /&gt;
&lt;br /&gt;
The idea of a shopping cart in e-commerce comes from the physical shopping cart used in brick and mortar stores. It is used to collect and store the items that the user wants to buy. On a shopping website, the items aren't physical, so the shopping cart can do much more than it's physical counterpart. It can be used to easily add or remove items, change the quantity of an item already in the cart, and quickly total the cost of the chosen items. &lt;br /&gt;
&lt;br /&gt;
The software typically interfaces with payment and inventory features of sites. In commercial packages, it is often sold as a bundle with secure payment software. The cart is usually aware of the type of inventory it collects, for instance, differentiating between physical goods (books, clothing), and services (software licenses, contract renewal fees). &lt;br /&gt;
&lt;br /&gt;
It's basic design has aided countless websites since the advent of e-commerce. It's a simple concept, but when implemented well, gives a great improvement in user experience [http://www.smashingmagazine.com/2008/02/07/shopping-carts-gallery-examples-and-good-practices/] &lt;br /&gt;
&lt;br /&gt;
A shopping cart is useful in the following situations, from [http://ui-patterns.com/pattern/ShoppingCart ui-patterns.com]:&lt;br /&gt;
* Use when the user can possibly buy more than one product.&lt;br /&gt;
* Use when the user can possibly buy more than one instance of a product.&lt;br /&gt;
* Use when the user may want to return later to carry on shopping&lt;br /&gt;
* Use when the user may want to return at a later time to conduct payment&lt;br /&gt;
&lt;br /&gt;
Some of the features of shopping carts are the ability to add and remove items, change the quantities of items, and checkout all the items it contains. &lt;br /&gt;
&lt;br /&gt;
== The Shopper pattern ==&lt;br /&gt;
&lt;br /&gt;
A shopper is a user of a shopping cart, and so it makes sense that the Shopper patterns would be designed to interact with those operations. That means it is able to add and remove items from the cart, change quantities of items, and initiate checkout. It represents a user of a e-commerce site, and it's interactions with the site and the shopping cart. &lt;br /&gt;
&lt;br /&gt;
According to [http://www.cix.co.uk/~smallmemory/almanac/Doble96.html], &amp;quot;A consumer creates a shopper object with a list of requests. The shopper traverses a set of objects and collects the requested items.&amp;quot; The requests are items that the user wants to place it her cart. The Shopper object traverses the set of purchasable items, and collects them in the cart. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Related Links ==&lt;br /&gt;
&lt;br /&gt;
Shopping Cart&lt;br /&gt;
* http://ui-patterns.com/pattern/ShoppingCart&lt;br /&gt;
* http://en.wikipedia.org/wiki/Shopping_cart_software&lt;br /&gt;
* http://www.smashingmagazine.com/2008/02/07/shopping-carts-gallery-examples-and-good-practices/&lt;br /&gt;
* http://www.welie.com/patterns/showPattern.php?patternID=shopping-cart&lt;br /&gt;
* http://books.google.com/books?id=-KRQAAAAMAAJ&amp;amp;dq=shopper+software+pattern+-fabric+-sewing&amp;amp;q=shopper+&amp;amp;pgis=1&amp;amp;hl=en&lt;br /&gt;
* http://davidhayden.com/blog/dave/archive/2005/03/27/895.aspx&lt;br /&gt;
* http://uipatternfactory.com/p=shopping-cart/&lt;br /&gt;
&lt;br /&gt;
Shopper &lt;br /&gt;
* http://www.cix.co.uk/~smallmemory/almanac/Doble96.html&lt;/div&gt;</summary>
		<author><name>Hkdavis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_7_shopper&amp;diff=15852</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 7 shopper</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_7_shopper&amp;diff=15852"/>
		<updated>2008-07-26T21:15:06Z</updated>

		<summary type="html">&lt;p&gt;Hkdavis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Shopper pattern =&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The idea of a &amp;quot;shopping cart&amp;quot; is ubiquitous in e-commerce. This idea lends itself to abstraction in the form of a Shopper pattern. Find examples and descriptions that are suitable for teaching this pattern, if possible, including some non-obvious applications. Write up your findings in the form of a narrative. Hint: You will have an easier time of searching if you exclude any pages including the terms &amp;quot;sewing&amp;quot; or &amp;quot;fabric&amp;quot;!&lt;br /&gt;
&lt;br /&gt;
== The Shopping Cart Pattern ==&lt;br /&gt;
&lt;br /&gt;
Shopping carts are a very useful feature of websites that sell things. They allow users to easily pick out items to purchase. &lt;br /&gt;
&lt;br /&gt;
A shopping cart is useful in the following situations, from [http://ui-patterns.com/pattern/ShoppingCart ui-patterns.com]:&lt;br /&gt;
* Use when the user can possibly buy more than one product.&lt;br /&gt;
* Use when the user can possibly buy more than one instance of a product.&lt;br /&gt;
* Use when the user may want to return later to carry on shopping&lt;br /&gt;
* Use when the user may want to return at a later time to conduct payment&lt;br /&gt;
&lt;br /&gt;
Some of the features of shopping carts are the ability to add and remove items, change the quantities of items, and checkout all the items it contains. &lt;br /&gt;
&lt;br /&gt;
== The Shopper pattern ==&lt;br /&gt;
&lt;br /&gt;
A shopper is a user of a shopping cart, and so it makes sense that the Shopper patterns would be designed to interact with those operations. That means it is able to add and remove items from the cart, change quantities of items, and initiate checkout. It represents a user of a e-commerce site, and it's interactions with the site and the shopping cart. &lt;br /&gt;
&lt;br /&gt;
According to [http://www.cix.co.uk/~smallmemory/almanac/Doble96.html], &amp;quot;A consumer creates a shopper object with a list of requests. The shopper traverses a set of objects and collects the requested items.&amp;quot; The requests are items that the user wants to place it her cart. The Shopper object traverses the set of purchasable items, and collects them in the cart. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Related Links ==&lt;br /&gt;
&lt;br /&gt;
Shopping Cart&lt;br /&gt;
* http://ui-patterns.com/pattern/ShoppingCart&lt;br /&gt;
* http://www.welie.com/patterns/showPattern.php?patternID=shopping-cart&lt;br /&gt;
* http://books.google.com/books?id=-KRQAAAAMAAJ&amp;amp;dq=shopper+software+pattern+-fabric+-sewing&amp;amp;q=shopper+&amp;amp;pgis=1&amp;amp;hl=en&lt;br /&gt;
* http://davidhayden.com/blog/dave/archive/2005/03/27/895.aspx&lt;br /&gt;
* http://uipatternfactory.com/p=shopping-cart/&lt;br /&gt;
&lt;br /&gt;
Shopper &lt;br /&gt;
* http://www.cix.co.uk/~smallmemory/almanac/Doble96.html&lt;/div&gt;</summary>
		<author><name>Hkdavis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_7_shopper&amp;diff=15850</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 7 shopper</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_7_shopper&amp;diff=15850"/>
		<updated>2008-07-26T20:01:58Z</updated>

		<summary type="html">&lt;p&gt;Hkdavis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Shopper pattern =&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The idea of a &amp;quot;shopping cart&amp;quot; is ubiquitous in e-commerce. This idea lends itself to abstraction in the form of a Shopper pattern. Find examples and descriptions that are suitable for teaching this pattern, if possible, including some non-obvious applications. Write up your findings in the form of a narrative. Hint: You will have an easier time of searching if you exclude any pages including the terms &amp;quot;sewing&amp;quot; or &amp;quot;fabric&amp;quot;!&lt;br /&gt;
&lt;br /&gt;
== The Shopping Cart Pattern ==&lt;br /&gt;
&lt;br /&gt;
Shopping carts are a very useful feature of websites that sell things. They allow users to easily pick out items to purchase. &lt;br /&gt;
&lt;br /&gt;
A shopping cart is useful in the following situations, from [http://ui-patterns.com/pattern/ShoppingCart ui-patterns.com]:&lt;br /&gt;
* Use when the user can possibly buy more than one product.&lt;br /&gt;
* Use when the user can possibly buy more than one instance of a product.&lt;br /&gt;
* Use when the user may want to return later to carry on shopping&lt;br /&gt;
* Use when the user may want to return at a later time to conduct payment&lt;br /&gt;
&lt;br /&gt;
Some of the features of shopping carts are the ability to add and remove items, change the quantities of items, and checkout all the items it contains. &lt;br /&gt;
&lt;br /&gt;
== The Shopper pattern ==&lt;br /&gt;
&lt;br /&gt;
A shopper is a user of a shopping cart, and so it makes sense that the Shopper patterns would be designed to interact with those operations. That means it is able to add and remove items from the cart, change quantities of items, and initiate checkout. It represents a user of a e-commerce site, and it's interactions with the site and the shopping cart. &lt;br /&gt;
&lt;br /&gt;
According to [http://www.cix.co.uk/~smallmemory/almanac/Doble96.html], &amp;quot;A consumer creates a shopper object with a list of requests. The shopper traverses a set of objects and collects the requested items.&amp;quot; The requests are items that the user wants to place it her cart. The Shopper object traverses the set of purchasable items, and collects them in the cart. &lt;br /&gt;
&lt;br /&gt;
== Related Links ==&lt;br /&gt;
&lt;br /&gt;
Shopping Cart&lt;br /&gt;
* http://ui-patterns.com/pattern/ShoppingCart&lt;br /&gt;
* http://www.welie.com/patterns/showPattern.php?patternID=shopping-cart&lt;br /&gt;
* http://books.google.com/books?id=-KRQAAAAMAAJ&amp;amp;dq=shopper+software+pattern+-fabric+-sewing&amp;amp;q=shopper+&amp;amp;pgis=1&amp;amp;hl=en&lt;br /&gt;
* http://davidhayden.com/blog/dave/archive/2005/03/27/895.aspx&lt;br /&gt;
* http://uipatternfactory.com/p=shopping-cart/&lt;br /&gt;
&lt;br /&gt;
Shopper &lt;br /&gt;
* http://www.cix.co.uk/~smallmemory/almanac/Doble96.html&lt;/div&gt;</summary>
		<author><name>Hkdavis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_7_shopper&amp;diff=15849</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 7 shopper</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_7_shopper&amp;diff=15849"/>
		<updated>2008-07-26T19:39:56Z</updated>

		<summary type="html">&lt;p&gt;Hkdavis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Shopper pattern =&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The idea of a &amp;quot;shopping cart&amp;quot; is ubiquitous in e-commerce. This idea lends itself to abstraction in the form of a Shopper pattern. Find examples and descriptions that are suitable for teaching this pattern, if possible, including some non-obvious applications. Write up your findings in the form of a narrative. Hint: You will have an easier time of searching if you exclude any pages including the terms &amp;quot;sewing&amp;quot; or &amp;quot;fabric&amp;quot;!&lt;br /&gt;
&lt;br /&gt;
== The Shopping Cart Pattern ==&lt;br /&gt;
&lt;br /&gt;
Shopping carts are a very useful feature of websites that sell things. They allow users to easily pick out items to purchase. &lt;br /&gt;
&lt;br /&gt;
A shopping cart is useful in the following situations, from [http://ui-patterns.com/pattern/ShoppingCart ui-patterns.com]:&lt;br /&gt;
* Use when the user can possibly buy more than one product.&lt;br /&gt;
* Use when the user can possibly buy more than one instance of a product.&lt;br /&gt;
* Use when the user may want to return later to carry on shopping&lt;br /&gt;
* Use when the user may want to return at a later time to conduct payment&lt;br /&gt;
&lt;br /&gt;
Some of the features of shopping carts are the ability to add and remove items, change the quantities of items, and checkout all the items it contains. &lt;br /&gt;
&lt;br /&gt;
== The Shopper pattern ==&lt;br /&gt;
&lt;br /&gt;
A shopper is a user of a shopping cart, and so it makes sense that the Shopper patterns would be designed to interact with those operations. That means it is able to add and remove items from the cart, change quantities of items, and initiate checkout. It represents a user of a e-commerce site, and it's interactions with the site and the shopping cart. &lt;br /&gt;
&lt;br /&gt;
== Related Links ==&lt;br /&gt;
&lt;br /&gt;
Shopping Cart&lt;br /&gt;
* http://ui-patterns.com/pattern/ShoppingCart&lt;br /&gt;
* http://www.welie.com/patterns/showPattern.php?patternID=shopping-cart&lt;br /&gt;
* http://books.google.com/books?id=-KRQAAAAMAAJ&amp;amp;dq=shopper+software+pattern+-fabric+-sewing&amp;amp;q=shopper+&amp;amp;pgis=1&amp;amp;hl=en&lt;br /&gt;
* http://davidhayden.com/blog/dave/archive/2005/03/27/895.aspx&lt;br /&gt;
* http://uipatternfactory.com/p=shopping-cart/&lt;br /&gt;
&lt;br /&gt;
Shopper &lt;br /&gt;
* http://www.cix.co.uk/~smallmemory/almanac/Doble96.html&lt;/div&gt;</summary>
		<author><name>Hkdavis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_7_shopper&amp;diff=15847</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 7 shopper</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_7_shopper&amp;diff=15847"/>
		<updated>2008-07-26T19:13:40Z</updated>

		<summary type="html">&lt;p&gt;Hkdavis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Shopper pattern =&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The idea of a &amp;quot;shopping cart&amp;quot; is ubiquitous in e-commerce. This idea lends itself to abstraction in the form of a Shopper pattern. Find examples and descriptions that are suitable for teaching this pattern, if possible, including some non-obvious applications. Write up your findings in the form of a narrative. Hint: You will have an easier time of searching if you exclude any pages including the terms &amp;quot;sewing&amp;quot; or &amp;quot;fabric&amp;quot;!&lt;br /&gt;
&lt;br /&gt;
== The Shopping Cart Pattern ==&lt;br /&gt;
&lt;br /&gt;
Shopping carts are a very useful feature of websites that sell things. They allow users to easily pick out items to purchase. &lt;br /&gt;
&lt;br /&gt;
A shopping cart is useful in the following situations, from [http://ui-patterns.com/pattern/ShoppingCart ui-patterns.com]:&lt;br /&gt;
* Use when the user can possibly buy more than one product.&lt;br /&gt;
* Use when the user can possibly buy more than one instance of a product.&lt;br /&gt;
* Use when the user may want to return later to carry on shopping&lt;br /&gt;
* Use when the user may want to return at a later time to conduct payment&lt;br /&gt;
&lt;br /&gt;
Some of the features of shopping carts are the ability to add and remove items, change the quantities of items, and checkout all the items it contains. A shopper is a user of a shopping cart, and so it makes sense that the Shopper patterns would be designed to interact with those operations. &lt;br /&gt;
&lt;br /&gt;
== Related Links ==&lt;br /&gt;
&lt;br /&gt;
* http://ui-patterns.com/pattern/ShoppingCart&lt;br /&gt;
* http://www.welie.com/patterns/showPattern.php?patternID=shopping-cart&lt;br /&gt;
* http://books.google.com/books?id=-KRQAAAAMAAJ&amp;amp;dq=shopper+software+pattern+-fabric+-sewing&amp;amp;q=shopper+&amp;amp;pgis=1&amp;amp;hl=en&lt;br /&gt;
* http://davidhayden.com/blog/dave/archive/2005/03/27/895.aspx&lt;br /&gt;
* http://uipatternfactory.com/p=shopping-cart/&lt;/div&gt;</summary>
		<author><name>Hkdavis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_7_shopper&amp;diff=15842</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 7 shopper</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_7_shopper&amp;diff=15842"/>
		<updated>2008-07-26T18:57:15Z</updated>

		<summary type="html">&lt;p&gt;Hkdavis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Shopper pattern =&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The idea of a &amp;quot;shopping cart&amp;quot; is ubiquitous in e-commerce. This idea lends itself to abstraction in the form of a Shopper pattern. Find examples and descriptions that are suitable for teaching this pattern, if possible, including some non-obvious applications. Write up your findings in the form of a narrative. Hint: You will have an easier time of searching if you exclude any pages including the terms &amp;quot;sewing&amp;quot; or &amp;quot;fabric&amp;quot;!&lt;br /&gt;
&lt;br /&gt;
== the pattern ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Related Links ==&lt;br /&gt;
&lt;br /&gt;
* http://ui-patterns.com/pattern/ShoppingCart&lt;br /&gt;
* http://www.welie.com/patterns/showPattern.php?patternID=shopping-cart&lt;br /&gt;
* http://books.google.com/books?id=-KRQAAAAMAAJ&amp;amp;dq=shopper+software+pattern+-fabric+-sewing&amp;amp;q=shopper+&amp;amp;pgis=1&amp;amp;hl=en&lt;br /&gt;
* http://davidhayden.com/blog/dave/archive/2005/03/27/895.aspx&lt;br /&gt;
* http://uipatternfactory.com/p=shopping-cart/&lt;/div&gt;</summary>
		<author><name>Hkdavis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_7_shopper&amp;diff=15501</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 7 shopper</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_7_shopper&amp;diff=15501"/>
		<updated>2008-07-25T04:43:53Z</updated>

		<summary type="html">&lt;p&gt;Hkdavis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Shopper pattern. The idea of a &amp;quot;shopping cart&amp;quot; is ubiquitous in e-commerce. This idea lends itself to abstraction in the form of a Shopper pattern. Find examples and descriptions that are suitable for teaching this pattern, if possible, including some non-obvious applications. Write up your findings in the form of a narrative. Hint: You will have an easier time of searching if you exclude any pages including the terms &amp;quot;sewing&amp;quot; or &amp;quot;fabric&amp;quot;!&lt;/div&gt;</summary>
		<author><name>Hkdavis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_7_shopper&amp;diff=15499</id>
		<title>CSC/ECE 517 Summer 2008/wiki3 7 shopper</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki3_7_shopper&amp;diff=15499"/>
		<updated>2008-07-25T04:43:33Z</updated>

		<summary type="html">&lt;p&gt;Hkdavis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; 	Shopper pattern. The idea of a &amp;quot;shopping cart&amp;quot; is ubiquitous in e-commerce. This idea lends itself to abstraction in the form of a Shopper pattern. Find examples and descriptions that are suitable for teaching this pattern, if possible, including some non-obvious applications. Write up your findings in the form of a narrative. Hint: You will have an easier time of searching if you exclude any pages including the terms &amp;quot;sewing&amp;quot; or &amp;quot;fabric&amp;quot;!&lt;/div&gt;</summary>
		<author><name>Hkdavis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_3_uml&amp;diff=14415</id>
		<title>CSC/ECE 517 Summer 2008/wiki2 3 uml</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_3_uml&amp;diff=14415"/>
		<updated>2008-07-08T08:10:09Z</updated>

		<summary type="html">&lt;p&gt;Hkdavis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
UML. There are literally hundreds of pages describing UML on the Web. If someone wants to learn about it, what should (s)he do? Look at the first few hits in Google? I expect we can do better than that. Write a review of the MVC sites on the Web. Which are best for learning about the concept? Which have the most instructive examples? Which are best for explaining how to apply UML in Ruby and Java? If you &lt;br /&gt;
choose this topic, you should be sure to peruse at least several dozen sites.&lt;br /&gt;
&lt;br /&gt;
== What is UML ==&lt;br /&gt;
&lt;br /&gt;
===Introductions and Overviews===&lt;br /&gt;
These websites function as an introduction to the world of UML modeling.  For someone who doesn't know what the subject is, or has only the most rudimentary understanding of what is being discussed or asked for, these are a good source of starting information.  Several of them serve as basic tutorials into the use and structure of an UML document, going into common components and simple designs.  The seven main types of diagrams it is typically used for are Use-Class, Class, Sequence, State Chart, Activity, Component, and Deployment.  &lt;br /&gt;
&lt;br /&gt;
====[http://en.wikipedia.org/wiki/Unified_Modeling_Language Wikipedia UML Article]====&lt;br /&gt;
A Wikipedia article is typically an informative article which gives a brief definition of a subject and the history that is currently associated with it. While generally a fair source of information, though the veracity on debatable or obscure topics can be questioned, it is not recommended as a learning tool. As only a brief overview, this article lacks more than a few basic examples and does not provide any information that is language specific.  Further links are provided but each provide only more clarification and less instruction. It is a good starting point for those with no knowledge of UML, but not much more than that.&lt;br /&gt;
&lt;br /&gt;
====[http://dn.codegear.com/article/31863 Practical UML: A Hands-On Introduction for Developers]====&lt;br /&gt;
The title is a good summary for the the guide. It starts with a brief description of why UML is important. This is particularly important, as it gives a good idea what UML modeling is used for and what is gained by using it. It has a brief discussions of use cases, classes, sequences, and other objects that can be modeled using UML.  Each includes an illustration and a basic example.  It covers a number of the most important uses of UML and how they are implemented.  While it may not deal with interpretation or any specific language, it does deal with most types of objects that are used in Java and Ruby.&lt;br /&gt;
&lt;br /&gt;
====[http://www.holub.com/goodies/uml/ Allen Holub's UML Quick Reference]====&lt;br /&gt;
This is less of an introduction for those who are unfamiliar and more a reminder for those who are experienced and need to recall specifics.  It covers a large number of specific type of objects and connections you would be using to define the UML.  It has a significant coverage of the design symbols that are associated with object oriented and basic modeling.  If you were familiar with the proper methods of design, this would certainly be a solid reminder for working with UML.  Like the previous site, this covers object oriented design without any real specific language or interpretation. The information it gives could be used with Java or Ruby, but is not tailored to them.&lt;br /&gt;
&lt;br /&gt;
====[http://www.ibm.com/developerworks/rational/library/769.html UML basics: An introduction to the Unified Modeling Language]====&lt;br /&gt;
The article by IBM is a basic overview of UML.  It starts with a basic description of UML and then moves into the seven types of diagrams. It covers each in a simple and straight forward manner.  Each type includes a description, example, and the necessary elements to construct the diagram and the corresponding UML.  The examples are easy to understand, though they lack depth. More complicated examples would prove more useful. There are no object oriented aspects beyond the basic discussion of objects to be diagrammed so this doesn't deal with Ruby or Java specifically.&lt;br /&gt;
&lt;br /&gt;
===Advanced Topics and Examples===&lt;br /&gt;
Once one has a basic understanding of UML has been gained with an introduction, there are more advanced topics and examples that can cover the topics previously introduced. &lt;br /&gt;
&lt;br /&gt;
====[http://www.uml.org/ Unified Modeling Language Resource Page]====&lt;br /&gt;
This is the homepage of the organization that defines the UML standard, the Object Management Group. This site contains all the basic information that you would need to implement UML as well as a number of links to other tutorials that are slightly less dense.  This is the most comprehensive source of information about UML, though it is presented as a technical specification, not a teaching aid, so it is not structured in a easy to digest manner.  There are white papers that detail any aspect of UML that you would wish to know about.  The examples are less straight forward than some of the sources when they are presence or absent entirely.  A number of more straight forward tutorials are linked from this page which helps partially.  No real distinction is drawn between languages for UML, rather focusing on Object Oriented Implementations in general.  This could be said to apply to Ruby and Java as they are primarily object oriented languages.&lt;br /&gt;
&lt;br /&gt;
====[http://atlas.kennesaw.edu/~dbraun/csis4650/A&amp;amp;D/UML_tutorial/index.htm Unified Modeling Language (UML) Tutorial]====&lt;br /&gt;
This site gives a brief overview of the types of UML diagrams, using extremely generic examples. Each example is broken into two parts, and &amp;quot;When to Use&amp;quot; and a &amp;quot;How to Draw&amp;quot; section. The examples are very basic, providing a description of the diagrams, and the elementary components, but without giving any motivation as to why they are helpful, or how to effectively use them. The site's navigation is also very limited, making it hard to move quickly or easily to a specific topic. It gives some links to resources, but most are links to books available for purchase, or companies that specialize in UML services. Overall, this site is not very helpful, as it's information is covered on other sites, with a better presentation. &lt;br /&gt;
&lt;br /&gt;
====[http://www.sparxsystems.com/uml-tutorial.html UML Tutorial]====&lt;br /&gt;
This article focuses on large enterprise projects, with a heavy emphasis on modeling business processes. As a software designer, this isn't as helpful from a technical aspect, but for someone working in the business world, it is a helpful primer for the concerns companies often have when developing large software systems. It goes beyond the technical software design aspect of software modeling, providing a shallow overview of both the business and software engineering side of software design. &lt;br /&gt;
&lt;br /&gt;
====[http://www.visualcase.com/tutorials/uml-tutorial.htm Visual Case Tool - UML Tutorial]====&lt;br /&gt;
Each of these tutorials encompasses the breadth of UML, and provides significantly more details for each sort of diagram and how they are used. Complex examples and subcategories of diagrams are discussed more fully. Once you have a basic understanding of UML, these would serve as a good source of in depth information that would allow you to start using UML proficiently. These would work well for Ruby or Java, though there is little in the way of specializations.&lt;br /&gt;
&lt;br /&gt;
====[http://www.cetus-links.org/oo_uml.html Architecture and Design: Unified Modeling Language (UML)]====&lt;br /&gt;
This site is not recommended for use. It is a collection of articles and resources for UML, though it was primarily concerning an earlier revision of the spec.  It contains a wide range of articles covering the breadth of UML.  While this does provide a significant amount of resources, the site has fallen into disuse and a number of the links are broken.  It would have been the optimal site for discussion of Java and Ruby, but unfortunately it was left to &amp;quot;rot&amp;quot; before Ruby came to the fore and Java seemed only to be mentioned as a metaphor for object-oriented design.&lt;br /&gt;
&lt;br /&gt;
====[http://www-306.ibm.com/software/rational/uml/ IBM Rational - Unified Modeling Language] ====&lt;br /&gt;
This link is the IBM repository for information, articles, and resources regarding UML.  It encompasses a number of white papers and examples, as well as the IBM products that use or interprets UML.  The Rational Developer utilities uses UML for designing software and projects, and transfer that information between instances.  While the Rational suite will work for both Ruby and Java, they are slanted towards Java.  The articles cover Java UML more throughly as well. Although many of the articles are oriented towards using UML with specific IBM products, they are still useful as sources of generic UML information. &lt;br /&gt;
&lt;br /&gt;
====[http://www.agilemodeling.com/artifacts/classDiagram.htm UML 2 Class Diagrams]====&lt;br /&gt;
This is deals primarily with examples and drawing of UML diagrams.  It breaks it down to each of the major components that would go into the diagram.  These provide descriptions for each of the components and how they are used for each of the types of diagrams.  These are some of the most instructive examples that are not language specific. They focus on the theory of why UML is structured the way it is, and what the benefit of using it are. They also lean heavily toward the practical application of creating UML diagrams, starting with crude hand-drawn pictures, and building on them until they are fully functional. This helps the reader understand the process of using UML from beginning to end. &lt;br /&gt;
&lt;br /&gt;
====[http://www.geocities.com/siliconvalley/network/1582/uml-example.htm UML By Examples]====&lt;br /&gt;
The examples on this site are less sophisticated group than the previous site, it does cover many of the different diagrams for the example it provides, as well as psuedo-code that follows from the design. These are less instructive, as they don't cover as much of UML as sites, but provide ample coverage for it's example that there is still information to be learned. This does not have examples that are Java or Ruby specific.&lt;br /&gt;
&lt;br /&gt;
===Discussion and Related Subjects===&lt;br /&gt;
While the discussion and coverage of UML can encompass most of its necessary uses, there can be times when more sophisticated techniques must be used or problems discussed.  These links are handy in those sorts of situations. &lt;br /&gt;
&lt;br /&gt;
====[http://www.ibm.com/developerworks/library/j-jmod0508/index.html Java and UML]====&lt;br /&gt;
This site deals primarily with UML when used with Java. It doesn't provide some of the breadth that a more complex tutorial would have, but it does have a number of Java specific issues and examples. This is the foremost of our reviewed sites that is focused on using UML with Java specifically. If you are programming in Java, this is an excellent resource for Java specific UML. It also focuses on Java terminology, which goes hand in hand with the Java-centric UML descriptions.&lt;br /&gt;
&lt;br /&gt;
====[http://www.uml-forum.com/ UML Forum]====&lt;br /&gt;
This is a discussion forum for dealing with UML issues and other concerns related to UML.  The articles cover a wide variety of topics, but the main feature of the site is the people with whom to discuss difficult or highly custom UML problems and questions. Once of the primary advantages of the internet over other sources is the ability to use other people as resources. They can often be much more useful for specific concerns than a published article that covers a wide topic. &lt;br /&gt;
&lt;br /&gt;
====[http://www.ratio.co.uk/W1.html Object Oriented Training and UML]====&lt;br /&gt;
This site deals with the use of UML and object oriented training, ie. how it focuses one's thinking into objects.  While it is lighter in examples and doesn't focus as much on UML as some of the others, it does provide a number of valuable insights into combining one's knowledge of object oriented programming with UML. Though the primary language used is C++ the code examples are certainly still valid, and easy enough to apply to another object oriented language. It is an excellent resource for someone who wants to learn more about object oriented programming concepts, as well as software design. &lt;br /&gt;
&lt;br /&gt;
==Conclusions==&lt;br /&gt;
The links provided give a significant breadth and depth when it comes to learning about UML, providing degrees of mastery as needed as well as additional resources once the concepts are understood. The forums and other interactive resources show how a medium like the Internet can supply additional information and interaction that we could not get from simply obtaining a book on UML and allows us to seek examples or discussion that are meaningful to the task being performed. Some sites focus in depth on a particular facet of the technology, while some provide a shallow overview of the entire range of subjects. This variety is extremely useful as one's knowledge and experience with UML grows, and information more suited to one's skill level is needed.&lt;/div&gt;</summary>
		<author><name>Hkdavis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_3_uml&amp;diff=14414</id>
		<title>CSC/ECE 517 Summer 2008/wiki2 3 uml</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_3_uml&amp;diff=14414"/>
		<updated>2008-07-08T07:59:27Z</updated>

		<summary type="html">&lt;p&gt;Hkdavis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
UML. There are literally hundreds of pages describing UML on the Web. If someone wants to learn about it, what should (s)he do? Look at the first few hits in Google? I expect we can do better than that. Write a review of the MVC sites on the Web. Which are best for learning about the concept? Which have the most instructive examples? Which are best for explaining how to apply UML in Ruby and Java? If you &lt;br /&gt;
choose this topic, you should be sure to peruse at least several dozen sites.&lt;br /&gt;
&lt;br /&gt;
== What is UML ==&lt;br /&gt;
&lt;br /&gt;
===Introductions and Overviews===&lt;br /&gt;
These websites function as an introduction to the world of UML modeling.  For someone who doesn't know what the subject is, or has only the most rudimentary understanding of what is being discussed or asked for, these are a good source of starting information.  Several of them serve as basic tutorials into the use and structure of an UML document, going into common components and simple designs.  The seven main types of diagrams it is typically used for are Use-Class, Class, Sequence, State Chart, Activity, Component, and Deployment.  &lt;br /&gt;
&lt;br /&gt;
====[http://en.wikipedia.org/wiki/Unified_Modeling_Language Wikipedia UML Article]====&lt;br /&gt;
A Wikipedia article is typically an informative article which gives a brief definition of a subject and the history that is currently associated with it. While generally a fair source of information, though the veracity on debatable or obscure topics can be questioned, it is not recommended as a learning tool. As only a brief overview, this article lacks more than a few basic examples and does not provide any information that is language specific.  Further links are provided but each provide only more clarification and less instruction. It is a good starting point for those with no knowledge of UML, but not much more than that.&lt;br /&gt;
&lt;br /&gt;
====[http://dn.codegear.com/article/31863 Practical UML: A Hands-On Introduction for Developers]====&lt;br /&gt;
The title is a good summary for the the guide. It starts with a brief description of why UML is important. This is particularly important, as it gives a good idea what UML modeling is used for and what is gained by using it. It has a brief discussions of use cases, classes, sequences, and other objects that can be modeled using UML.  Each includes an illustration and a basic example.  It covers a number of the most important uses of UML and how they are implemented.  While it may not deal with interpretation or any specific language, it does deal with most types of objects that are used in Java and Ruby.&lt;br /&gt;
&lt;br /&gt;
====[http://www.holub.com/goodies/uml/ Allen Holub's UML Quick Reference]====&lt;br /&gt;
This is less of an introduction for those who are unfamiliar and more a reminder for those who are experienced and need to recall specifics.  It covers a large number of specific type of objects and connections you would be using to define the UML.  It has a significant coverage of the design symbols that are associated with object oriented and basic modeling.  If you were familiar with the proper methods of design, this would certainly be a solid reminder for working with UML.  Like the previous site, this covers object oriented design without any real specific language or interpretation. The information it gives could be used with Java or Ruby, but is not tailored to them.&lt;br /&gt;
&lt;br /&gt;
====[http://www.ibm.com/developerworks/rational/library/769.html UML basics: An introduction to the Unified Modeling Language]====&lt;br /&gt;
The article by IBM is a basic overview of UML.  It starts with a basic description of UML and then moves into the seven types of diagrams. It covers each in a simple and straight forward manner.  Each type includes a description, example, and the necessary elements to construct the diagram and the corresponding UML.  The examples are easy to understand, though they lack depth. More complicated examples would prove more useful. There are no object oriented aspects beyond the basic discussion of objects to be diagrammed so this doesn't deal with Ruby or Java specifically.&lt;br /&gt;
&lt;br /&gt;
===Advanced Topics and Examples===&lt;br /&gt;
Once one has a basic understanding of UML has been gained with an introduction, there are more advanced topics and examples that can cover the topics previously introduced. &lt;br /&gt;
&lt;br /&gt;
====[http://www.uml.org/ Unified Modeling Language Resource Page]====&lt;br /&gt;
This is the homepage of the organization that defines the UML standard, the Object Management Group. This site contains all the basic information that you would need to implement UML as well as a number of links to other tutorials that are slightly less dense.  This is the most comprehensive source of information about UML, though it is presented as a technical specification, not a teaching aid, so it is not structured in a easy to digest manner.  There are white papers that detail any aspect of UML that you would wish to know about.  The examples are less straight forward than some of the sources when they are presence or absent entirely.  A number of more straight forward tutorials are linked from this page which helps partially.  No real distinction is drawn between languages for UML, rather focusing on Object Oriented Implementations in general.  This could be said to apply to Ruby and Java as they are primarily object oriented languages.&lt;br /&gt;
&lt;br /&gt;
[http://atlas.kennesaw.edu/~dbraun/csis4650/A&amp;amp;D/UML_tutorial/index.htm Unified Modeling Language (UML) Tutorial]&lt;br /&gt;
&lt;br /&gt;
[http://www.sparxsystems.com/uml-tutorial.html UML Tutorial]&lt;br /&gt;
&lt;br /&gt;
====[http://www.visualcase.com/tutorials/uml-tutorial.htm Visual Case Tool - UML Tutorial]====&lt;br /&gt;
Each of these tutorials encompasses the breadth of UML, and provides significantly more details for each sort of diagram and how they are used. Complex examples and subcategories of diagrams are discussed more fully. Once you have a basic understanding of UML, these would serve as a good source of in depth information that would allow you to start using UML proficiently. These would work well for Ruby or Java, though there is little in the way of specializations.&lt;br /&gt;
&lt;br /&gt;
====[http://www.cetus-links.org/oo_uml.html Architecture and Design: Unified Modeling Language (UML)]====&lt;br /&gt;
This site is not recommended for use. It is a collection of articles and resources for UML, though it was primarily concerning an earlier revision of the spec.  It contains a wide range of articles covering the breadth of UML.  While this does provide a significant amount of resources, the site has fallen into disuse and a number of the links are broken.  It would have been the optimal site for discussion of Java and Ruby, but unfortunately it was left to &amp;quot;rot&amp;quot; before Ruby came to the fore and Java seemed only to be mentioned as a metaphor for object-oriented design.&lt;br /&gt;
&lt;br /&gt;
====[http://www-306.ibm.com/software/rational/uml/ IBM Rational - Unified Modeling Language] ====&lt;br /&gt;
This link is the IBM repository for information, articles, and resources regarding UML.  It encompasses a number of white papers and examples, as well as the IBM products that use or interprets UML.  The Rational Developer utilities uses UML for designing software and projects, and transfer that information between instances.  While the Rational suite will work for both Ruby and Java, they are slanted towards Java.  The articles cover Java UML more throughly as well. Although many of the articles are oriented towards using UML with specific IBM products, they are still useful as sources of generic UML information. &lt;br /&gt;
&lt;br /&gt;
====[http://www.agilemodeling.com/artifacts/classDiagram.htm UML 2 Class Diagrams]====&lt;br /&gt;
This is deals primarily with examples and drawing of UML diagrams.  It breaks it down to each of the major components that would go into the diagram.  These provide descriptions for each of the components and how they are used for each of the types of diagrams.  These are some of the most instructive examples that are not language specific. They focus on the theory of why UML is structured the way it is, and what the benefit of using it are. They also lean heavily toward the practical application of creating UML diagrams, starting with crude hand-drawn pictures, and building on them until they are fully functional. This helps the reader understand the process of using UML from beginning to end. &lt;br /&gt;
&lt;br /&gt;
====[http://www.geocities.com/siliconvalley/network/1582/uml-example.htm UML By Examples]====&lt;br /&gt;
The examples on this site are less sophisticated group than the previous site, it does cover many of the different diagrams for the example it provides, as well as psuedo-code that follows from the design. These are less instructive, as they don't cover as much of UML as sites, but provide ample coverage for it's example that there is still information to be learned. This does not have examples that are Java or Ruby specific.&lt;br /&gt;
&lt;br /&gt;
===Discussion and Related Subjects===&lt;br /&gt;
While the discussion and coverage of UML can encompass most of its necessary uses, there can be times when more sophisticated techniques must be used or problems discussed.  These links are handy in those sorts of situations. &lt;br /&gt;
&lt;br /&gt;
====[http://www.ibm.com/developerworks/library/j-jmod0508/index.html Java and UML]====&lt;br /&gt;
This site deals primarily with UML when used with Java. It doesn't provide some of the breadth that a more complex tutorial would have, but it does have a number of Java specific issues and examples. This is the foremost of our reviewed sites that is focused on using UML with Java specifically. If you are programming in Java, this is an excellent resource for Java specific UML. It also focuses on Java terminology, which goes hand in hand with the Java-centric UML descriptions.&lt;br /&gt;
&lt;br /&gt;
====[http://www.uml-forum.com/ UML Forum]====&lt;br /&gt;
This is a discussion forum for dealing with UML issues and other concerns related to UML.  The articles cover a wide variety of topics, but the main feature of the site is the people with whom to discuss difficult or highly custom UML problems and questions. Once of the primary advantages of the internet over other sources is the ability to use other people as resources. They can often be much more useful for specific concerns than a published article that covers a wide topic. &lt;br /&gt;
&lt;br /&gt;
====[http://www.ratio.co.uk/W1.html Object Oriented Training and UML]====&lt;br /&gt;
This site deals with the use of UML and object oriented training, ie. how it focuses one's thinking into objects.  While it is lighter in examples and doesn't focus as much on UML as some of the others, it does provide a number of valuable insights into combining one's knowledge of object oriented programming with UML. Though the primary language used is C++ the code examples are certainly still valid, and easy enough to apply to another object oriented language. It is an excellent resource for someone who wants to learn more about object oriented programming concepts, as well as software design. &lt;br /&gt;
&lt;br /&gt;
===Conclusions===&lt;br /&gt;
The links provided give a significant breadth and depth when it comes to learning about UML, providing degrees of mastery as needed as well as additional resources once the concepts are understood. The forums and other interactive resources show how a medium like the Internet can supply additional information and interaction that we could not get from simply obtaining a book on UML and allows us to seek examples or discussion that are meaningful to the task being performed. Some sites focus in depth on a particular facet of the technology, while some provide a shallow overview of the entire range of subjects. This variety is extremely useful as one's knowledge and experience with UML grows, and information more suited to one's skill level is needed.&lt;/div&gt;</summary>
		<author><name>Hkdavis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_3_uml&amp;diff=14413</id>
		<title>CSC/ECE 517 Summer 2008/wiki2 3 uml</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_3_uml&amp;diff=14413"/>
		<updated>2008-07-08T07:46:28Z</updated>

		<summary type="html">&lt;p&gt;Hkdavis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
UML. There are literally hundreds of pages describing UML on the Web. If someone wants to learn about it, what should (s)he do? Look at the first few hits in Google? I expect we can do better than that. Write a review of the MVC sites on the Web. Which are best for learning about the concept? Which have the most instructive examples? Which are best for explaining how to apply UML in Ruby and Java? If you &lt;br /&gt;
choose this topic, you should be sure to peruse at least several dozen sites.&lt;br /&gt;
&lt;br /&gt;
== What is UML ==&lt;br /&gt;
&lt;br /&gt;
===Introductions and Overviews===&lt;br /&gt;
These websites function as an introduction to the world of UML modeling.  For someone who doesn't know what the subject is, or has only the most rudimentary understanding of what is being discussed or asked for, these are a good source of starting information.  Several of them serve as basic tutorials into the use and structure of an UML document, going into common components and simple designs.  The seven main types of diagrams it is typically used for are Use-Class, Class, Sequence, State Chart, Activity, Component, and Deployment.  &lt;br /&gt;
&lt;br /&gt;
====[http://en.wikipedia.org/wiki/Unified_Modeling_Language Wikipedia UML Article]====&lt;br /&gt;
A Wikipedia article is typically an informative article which gives a brief definition of a subject and the history that is currently associated with it. While generally a fair source of information, though the veracity on debatable or obscure topics can be questioned, it is not recommended as a learning tool. As only a brief overview, this article lacks more than a few basic examples and does not provide any information that is language specific.  Further links are provided but each provide only more clarification and less instruction. It is a good starting point for those with no knowledge of UML, but not much more than that.&lt;br /&gt;
&lt;br /&gt;
====[http://dn.codegear.com/article/31863 Practical UML: A Hands-On Introduction for Developers]====&lt;br /&gt;
The title is a good summary for the the guide. It starts with a brief description of why UML is important. This is particularly important, as it gives a good idea what UML modeling is used for and what is gained by using it. It has a brief discussions of use cases, classes, sequences, and other objects that can be modeled using UML.  Each includes an illustration and a basic example.  It covers a number of the most important uses of UML and how they are implemented.  While it may not deal with interpretation or any specific language, it does deal with most types of objects that are used in Java and Ruby.&lt;br /&gt;
&lt;br /&gt;
====[http://www.holub.com/goodies/uml/ Allen Holub's UML Quick Reference]====&lt;br /&gt;
This is less of an introduction for those who are unfamiliar and more a reminder for those who are experienced and need to recall specifics.  It covers a large number of specific type of objects and connections you would be using to define the UML.  It has a significant coverage of the design symbols that are associated with object oriented and basic modeling.  If you were familiar with the proper methods of design, this would certainly be a solid reminder for working with UML.  Like the previous site, this covers object oriented design without any real specific language or interpretation. The information it gives could be used with Java or Ruby, but is not tailored to them.&lt;br /&gt;
&lt;br /&gt;
====[http://www.ibm.com/developerworks/rational/library/769.html UML basics: An introduction to the Unified Modeling Language]====&lt;br /&gt;
The article by IBM is a basic overview of UML.  It starts with a basic description of UML and then moves into the seven types of diagrams. It covers each in a simple and straight forward manner.  Each type includes a description, example, and the necessary elements to construct the diagram and the corresponding UML.  The examples are easy to understand, though they lack depth. More complicated examples would prove more useful. There are no object oriented aspects beyond the basic discussion of objects to be diagrammed so this doesn't deal with Ruby or Java specifically.&lt;br /&gt;
&lt;br /&gt;
===Advanced Topics and Examples===&lt;br /&gt;
Once one has a basic understanding of UML has been gained with an introduction, there are more advanced topics and examples that can cover the topics previously introduced. &lt;br /&gt;
&lt;br /&gt;
====[http://www.uml.org/ Unified Modeling Language Resource Page]====&lt;br /&gt;
This is the homepage of the organization that defines the UML standard, the Object Management Group. This site contains all the basic information that you would need to implement UML as well as a number of links to other tutorials that are slightly less dense.  This is the most comprehensive source of information about UML, though it is presented as a technical specification, not a teaching aid, so it is not structured in a easy to digest manner.  There are white papers that detail any aspect of UML that you would wish to know about.  The examples are less straight forward than some of the sources when they are presence or absent entirely.  A number of more straight forward tutorials are linked from this page which helps partially.  No real distinction is drawn between languages for UML, rather focusing on Object Oriented Implementations in general.  This could be said to apply to Ruby and Java as they are primarily object oriented languages.&lt;br /&gt;
&lt;br /&gt;
[http://atlas.kennesaw.edu/~dbraun/csis4650/A&amp;amp;D/UML_tutorial/index.htm Unified Modeling Language (UML) Tutorial]&lt;br /&gt;
&lt;br /&gt;
[http://www.sparxsystems.com/uml-tutorial.html UML Tutorial]&lt;br /&gt;
&lt;br /&gt;
====[http://www.visualcase.com/tutorials/uml-tutorial.htm Visual Case Tool - UML Tutorial]====&lt;br /&gt;
Each of these tutorials encompasses the breadth of UML, and provides significantly more details for each sort of diagram and how they are used. Complex examples and subcategories of diagrams are discussed more fully. Once you have a basic understanding of UML, these would serve as a good source of in depth information that would allow you to start using UML proficiently. These would work well for Ruby or Java, though there is little in the way of specializations.&lt;br /&gt;
&lt;br /&gt;
====[http://www.cetus-links.org/oo_uml.html Architecture and Design: Unified Modeling Language (UML)]====&lt;br /&gt;
This site is not recommended for use. It is a collection of articles and resources for UML, though it was primarily concerning an earlier revision of the spec.  It contains a wide range of articles covering the breadth of UML.  While this does provide a significant amount of resources, the site has fallen into disuse and a number of the links are broken.  It would have been the optimal site for discussion of Java and Ruby, but unfortunately it was left to &amp;quot;rot&amp;quot; before Ruby came to the fore and Java seemed only to be mentioned as a metaphor for object-oriented design.&lt;br /&gt;
&lt;br /&gt;
====[http://www-306.ibm.com/software/rational/uml/ IBM Rational - Unified Modeling Language] ====&lt;br /&gt;
This link is the IBM repository for information, articles, and resources regarding UML.  It encompasses a number of white papers and examples, as well as the IBM products that use or interprets UML.  The Rational Developer utilities uses UML for designing software and projects, and transfer that information between instances.  While the Rational suite will work for both Ruby and Java, they are slanted towards Java.  The articles cover Java UML more throughly as well. Although many of the articles are oriented towards using UML with specific IBM products, they are still useful as sources of generic UML information. &lt;br /&gt;
&lt;br /&gt;
====[http://www.agilemodeling.com/artifacts/classDiagram.htm UML 2 Class Diagrams]====&lt;br /&gt;
This is deals primarily with examples and drawing of UML diagrams.  It breaks it down to each of the major components that would go into the diagram.  These provide descriptions for each of the components and how they are used for each of the types of diagrams.  These are some of the most instructive examples that are not language specific. They focus on the theory of why UML is structured the way it is, and what the benefit of using it are. They also lean heavily toward the practical application of creating UML diagrams, starting with crude hand-drawn pictures, and building on them until they are fully functional. This helps the reader understand the process of using UML from beginning to end. &lt;br /&gt;
&lt;br /&gt;
====[http://www.geocities.com/siliconvalley/network/1582/uml-example.htm UML By Examples]====&lt;br /&gt;
The examples on this site are less sophisticated group than the previous site, it does cover many of the different diagrams for the example it provides, as well as psuedo-code that follows from the design. These are less instructive, as they don't cover as much of UML as sites, but provide ample coverage for it's example that there is still information to be learned. This does not have examples that are Java or Ruby specific.&lt;br /&gt;
&lt;br /&gt;
===Discussion and Related Subjects===&lt;br /&gt;
While the discussion and coverage of UML can encompass most of its necessary uses, there can be times when more sophisticated techniques must be used or problems discussed.  These links are handy in those sorts of situations. &lt;br /&gt;
&lt;br /&gt;
====[http://www.ibm.com/developerworks/library/j-jmod0508/index.html Java and UML]====&lt;br /&gt;
This site deals primarily with UML when used with Java. It doesn't provide some of the breadth that a more complex tutorial would have, but it does have a number of Java specific issues and examples. This is the foremost of our reviewed sites that is focused on using UML with Java specifically. If you are programming in Java, this is an excellent resource for Java specific UML. It also focuses on Java terminology, which goes hand in hand with the Java-centric UML descriptions.&lt;br /&gt;
&lt;br /&gt;
====[http://www.uml-forum.com/ UML Forum]====&lt;br /&gt;
This is a discussion forum for dealing with UML issues and other concerns related to UML.  While articles may cover what information you need, if you would prefer someone with whom to discuss what you are thinking or working through a difficult custom UML problem this would be the place for it.  Once of the primary advantages of the internet of other sources like books is that fact that you can reach interactive and recorders of interactive discussion.  Often a problem is far more simple to solve when two people approach it.&lt;br /&gt;
&lt;br /&gt;
[http://www.ratio.co.uk/W1.html Object Oriented Training and UML]&lt;br /&gt;
&lt;br /&gt;
This site deals with the use of UML and object oriented training, ie. how it focuses one's thinking into objects.  While it is lighter in examples than some of the others, it does provide a number of valuable insights for object oriented programming languages using UML like Ruby or Java.  Though the primary language used is C++ the code examples are certainly still valid.&lt;br /&gt;
&lt;br /&gt;
===Conclusions===&lt;br /&gt;
&lt;br /&gt;
The links provided give a significant breadth and depth when it comes to learning about UML, providing degrees of mastery as needed as well as additional resources once the concepts are understood. The forums and other interactive resources show how a medium like the Internet can supply additional information and interaction that we could not get from simply obtaining a book on UML and allows us to seek examples or discussion that are meaningful to the task being performed.&lt;/div&gt;</summary>
		<author><name>Hkdavis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_3_uml&amp;diff=14412</id>
		<title>CSC/ECE 517 Summer 2008/wiki2 3 uml</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_3_uml&amp;diff=14412"/>
		<updated>2008-07-08T07:29:44Z</updated>

		<summary type="html">&lt;p&gt;Hkdavis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
UML. There are literally hundreds of pages describing UML on the Web. If someone wants to learn about it, what should (s)he do? Look at the first few hits in Google? I expect we can do better than that. Write a review of the MVC sites on the Web. Which are best for learning about the concept? Which have the most instructive examples? Which are best for explaining how to apply UML in Ruby and Java? If you &lt;br /&gt;
choose this topic, you should be sure to peruse at least several dozen sites.&lt;br /&gt;
&lt;br /&gt;
== What is UML ==&lt;br /&gt;
&lt;br /&gt;
===Introductions and Overviews===&lt;br /&gt;
These websites function as an introduction to the world of UML modeling.  For someone who doesn't know what the subject is, or has only the most rudimentary understanding of what is being discussed or asked for, these are a good source of starting information.  Several of them serve as basic tutorials into the use and structure of an UML document, going into common components and simple designs.  The seven main types of diagrams it is typically used for are Use-Class, Class, Sequence, State Chart, Activity, Component, and Deployment.  &lt;br /&gt;
&lt;br /&gt;
====[http://en.wikipedia.org/wiki/Unified_Modeling_Language Wikipedia UML Article]====&lt;br /&gt;
A Wikipedia article is typically an informative article which gives a brief definition of a subject and the history that is currently associated with it. While generally a fair source of information, though the veracity on debatable or obscure topics can be questioned, it is not recommended as a learning tool. As only a brief overview, this article lacks more than a few basic examples and does not provide any information that is language specific.  Further links are provided but each provide only more clarification and less instruction. It is a good starting point for those with no knowledge of UML, but not much more than that.&lt;br /&gt;
&lt;br /&gt;
====[http://dn.codegear.com/article/31863 Practical UML: A Hands-On Introduction for Developers]====&lt;br /&gt;
The title is a good summary for the the guide. It starts with a brief description of why UML is important. This is particularly important, as it gives a good idea what UML modeling is used for and what is gained by using it. It has a brief discussions of use cases, classes, sequences, and other objects that can be modeled using UML.  Each includes an illustration and a basic example.  It covers a number of the most important uses of UML and how they are implemented.  While it may not deal with interpretation or any specific language, it does deal with most types of objects that are used in Java and Ruby.&lt;br /&gt;
&lt;br /&gt;
====[http://www.holub.com/goodies/uml/ Allen Holub's UML Quick Reference]====&lt;br /&gt;
This is less of an introduction for those who are unfamiliar and more a reminder for those who are experienced and need to recall specifics.  It covers a large number of specific type of objects and connections you would be using to define the UML.  It has a significant coverage of the design symbols that are associated with object oriented and basic modeling.  If you were familiar with the proper methods of design, this would certainly be a solid reminder for working with UML.  Like the previous site, this covers object oriented design without any real specific language or interpretation. The information it gives could be used with Java or Ruby, but is not tailored to them.&lt;br /&gt;
&lt;br /&gt;
====[http://www.ibm.com/developerworks/rational/library/769.html UML basics: An introduction to the Unified Modeling Language]====&lt;br /&gt;
The article by IBM is a basic overview of UML.  It starts with a basic description of UML and then moves into the seven types of diagrams. It covers each in a simple and straight forward manner.  Each type includes a description, example, and the necessary elements to construct the diagram and the corresponding UML.  The examples are easy to understand, though they lack depth. More complicated examples would prove more useful. There are no object oriented aspects beyond the basic discussion of objects to be diagrammed so this doesn't deal with Ruby or Java specifically.&lt;br /&gt;
&lt;br /&gt;
===Advanced Topics and Examples===&lt;br /&gt;
Once one has a basic understanding of UML has been gained with an introduction, there are more advanced topics and examples that can cover the topics previously introduced. &lt;br /&gt;
&lt;br /&gt;
====[http://www.uml.org/ Unified Modeling Language Resource Page]====&lt;br /&gt;
This is the homepage of the organization that defines the UML standard, the Object Management Group. This site contains all the basic information that you would need to implement UML as well as a number of links to other tutorials that are slightly less dense.  This is the most comprehensive source of information about UML, though it is presented as a technical specification, not a teaching aid, so it is not structured in a easy to digest manner.  There are white papers that detail any aspect of UML that you would wish to know about.  The examples are less straight forward than some of the sources when they are presence or absent entirely.  A number of more straight forward tutorials are linked from this page which helps partially.  No real distinction is drawn between languages for UML, rather focusing on Object Oriented Implementations in general.  This could be said to apply to Ruby and Java as they are primarily object oriented languages.&lt;br /&gt;
&lt;br /&gt;
[http://atlas.kennesaw.edu/~dbraun/csis4650/A&amp;amp;D/UML_tutorial/index.htm Unified Modeling Language (UML) Tutorial]&lt;br /&gt;
&lt;br /&gt;
[http://www.sparxsystems.com/uml-tutorial.html UML Tutorial]&lt;br /&gt;
&lt;br /&gt;
[http://www.visualcase.com/tutorials/uml-tutorial.htm Visual Case Tool - UML Tutorial]&lt;br /&gt;
&lt;br /&gt;
Each of these tutorials encompass the breadth of UML.  Providing significantly more details for each sort of diagrams and how they are used.  Complex examples and subcategories of diagrams are discussed more fully.  These would serve as a good breadth of knowledge in order to start using UML.  These would work well for Ruby or Java, though there is little in the way of specializations.&lt;br /&gt;
&lt;br /&gt;
[http://www.cetus-links.org/oo_uml.html Architecture and Design: Unified Modeling Language (UML)] &lt;br /&gt;
&lt;br /&gt;
This link is a collection of articles and resources for UML, though it was primarily concerning an earlier revision of the spec.  It contains a wide range of articles covering the breadth of UML.  While this does provide a significant amount of resources, the site has fallen into disuse and a number of the links are broken.  It would have been the optimal site for discussion of Java and Ruby, but unfortunately it was left to &amp;quot;rot&amp;quot; before Ruby came to the fore and Java seemed only to be mentioned as a metaphor for object-oriented design.&lt;br /&gt;
&lt;br /&gt;
[http://www-306.ibm.com/software/rational/uml/ IBM Rational - Unified Modeling Language] &lt;br /&gt;
&lt;br /&gt;
This link is the IBM repository for information, articles, and resources regarding UML.  It encompasses a number of white papers and examples, as well as the IBM products that use or interprets UML.  The Rational Developer utilities uses UML for designing software and projects, and transfer that information between instances.  While the rational suite will work for both Ruby and Java, they are slanted towards Java.  The articles cover Java UML more throughly as well.&lt;br /&gt;
&lt;br /&gt;
[http://www.agilemodeling.com/artifacts/classDiagram.htm UML 2 Class Diagrams]&lt;br /&gt;
&lt;br /&gt;
This is deals primarily with examples and drawing of UML diagrams.  It breaks it down to each of the major components that would go into the diagram.  These provide descriptions for each of the components and how they are used for each of the types of diagrams.  These are some of the most instructive examples that are not language specific. &lt;br /&gt;
&lt;br /&gt;
[http://www.geocities.com/siliconvalley/network/1582/uml-example.htm UML By Examples]&lt;br /&gt;
&lt;br /&gt;
While a less sophisticated group of examples than the link before it, it does take psuedo-code and other more esoteric examples are included.  These are less instructive but can cover corner causes.  This does not have examples that are Java or Ruby specific.&lt;br /&gt;
&lt;br /&gt;
===Discussion and Related Subjects===&lt;br /&gt;
While the discussion and coverage of UML can encompass most of its necessary uses, there can be times when more sophisticated techniques must be used or problems discussed.  These links are handy in those sorts of situations. &lt;br /&gt;
&lt;br /&gt;
[http://www.ibm.com/developerworks/library/j-jmod0508/index.html Java and UML]&lt;br /&gt;
&lt;br /&gt;
This site deals primarily with UML when used with Java.  It doesn't provide some of the breadth that a more complex tutorial would have, but it does have a number of Java specific issues and examples. This is the primary site that is focused on using UML with Java specifically and should you only need to use UML in that manner it would suffice.  It also focuses on Java terminology, which shares much with the more focused UML descriptors.&lt;br /&gt;
&lt;br /&gt;
[http://www.uml-forum.com/ UML Forum]&lt;br /&gt;
&lt;br /&gt;
This is a discussion forum for dealing with UML issues and other concerns related to UML.  While articles may cover what information you need, if you would prefer someone with whom to discuss what you are thinking or working through a difficult custom UML problem this would be the place for it.  Once of the primary advantages of the internet of other sources like books is that fact that you can reach interactive and recorders of interactive discussion.  Often a problem is far more simple to solve when two people approach it.&lt;br /&gt;
&lt;br /&gt;
[http://www.ratio.co.uk/W1.html Object Oriented Training and UML]&lt;br /&gt;
&lt;br /&gt;
This site deals with the use of UML and object oriented training, ie. how it focuses one's thinking into objects.  While it is lighter in examples than some of the others, it does provide a number of valuable insights for object oriented programming languages using UML like Ruby or Java.  Though the primary language used is C++ the code examples are certainly still valid.&lt;br /&gt;
&lt;br /&gt;
===Conclusions===&lt;br /&gt;
&lt;br /&gt;
The links provided give a significant breadth and depth when it comes to learning about UML, providing degrees of mastery as needed as well as additional resources once the concepts are understood. The forums and other interactive resources show how a medium like the Internet can supply additional information and interaction that we could not get from simply obtaining a book on UML and allows us to seek examples or discussion that are meaningful to the task being performed.&lt;/div&gt;</summary>
		<author><name>Hkdavis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_3_uml&amp;diff=13679</id>
		<title>CSC/ECE 517 Summer 2008/wiki2 3 uml</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_3_uml&amp;diff=13679"/>
		<updated>2008-06-25T03:22:33Z</updated>

		<summary type="html">&lt;p&gt;Hkdavis: /* What is UML */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
UML. There are literally hundreds of pages describing UML on the Web. If someone wants to learn about it, what should (s)he do? Look at the first few hits in Google? I expect we can do better than that. Write a review of the MVC sites on the Web. Which are best for learning about the concept? Which have the most instructive examples? Which are best for explaining how to apply UML in Ruby and Java? If you &lt;br /&gt;
choose this topic, you should be sure to peruse at least several dozen sites.&lt;br /&gt;
&lt;br /&gt;
== What is UML ==&lt;br /&gt;
&lt;br /&gt;
[http://www.uml.org/ Unified Modeling Language Resource Page]&lt;br /&gt;
This is the homepage of the organization that defines the UML standard, the Object Management Group. &lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Unified_Modeling_Language Wikipedia UML Article]&lt;br /&gt;
&lt;br /&gt;
[http://dn.codegear.com/article/31863 Practical UML: A Hands-On Introduction for Developers]&lt;br /&gt;
&lt;br /&gt;
[http://www.holub.com/goodies/uml/ Allen Holub's UML Quick Reference]&lt;br /&gt;
&lt;br /&gt;
[http://www.cetus-links.org/oo_uml.html Architecture and Design: Unified Modeling Language (UML)] Possibly out of date&lt;br /&gt;
&lt;br /&gt;
[http://www-306.ibm.com/software/rational/uml/ IBM Rational - Unified Modeling Language] &lt;br /&gt;
&lt;br /&gt;
[http://www.agilemodeling.com/artifacts/classDiagram.htm UML 2 Class Diagrams]&lt;br /&gt;
&lt;br /&gt;
[http://atlas.kennesaw.edu/~dbraun/csis4650/A&amp;amp;D/UML_tutorial/index.htm Unified Modeling Language (UML) Tutorial]&lt;br /&gt;
&lt;br /&gt;
[http://www.sparxsystems.com/uml-tutorial.html UML Tutorial]&lt;br /&gt;
&lt;br /&gt;
[http://www.uml-forum.com/ UML Forum]&lt;br /&gt;
&lt;br /&gt;
[http://www.ibm.com/developerworks/rational/library/769.html UML basics: An introduction to the Unified Modeling Language]&lt;br /&gt;
&lt;br /&gt;
[http://www.visualcase.com/tutorials/uml-tutorial.htm Visual Case Tool - UML Tutorial]&lt;br /&gt;
&lt;br /&gt;
[http://www.geocities.com/siliconvalley/network/1582/uml-example.htm UML By Examples]&lt;/div&gt;</summary>
		<author><name>Hkdavis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_3_uml&amp;diff=13674</id>
		<title>CSC/ECE 517 Summer 2008/wiki2 3 uml</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_3_uml&amp;diff=13674"/>
		<updated>2008-06-25T03:01:22Z</updated>

		<summary type="html">&lt;p&gt;Hkdavis: /* What is UML */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
UML. There are literally hundreds of pages describing UML on the Web. If someone wants to learn about it, what should (s)he do? Look at the first few hits in Google? I expect we can do better than that. Write a review of the MVC sites on the Web. Which are best for learning about the concept? Which have the most instructive examples? Which are best for explaining how to apply UML in Ruby and Java? If you &lt;br /&gt;
choose this topic, you should be sure to peruse at least several dozen sites.&lt;br /&gt;
&lt;br /&gt;
== What is UML ==&lt;br /&gt;
&lt;br /&gt;
[http://www.uml.org/ Unified Modeling Language Resource Page]&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Unified_Modeling_Language Wikipedia UML Article]&lt;br /&gt;
&lt;br /&gt;
[http://dn.codegear.com/article/31863 Practical UML: A Hands-On Introduction for Developers]&lt;br /&gt;
&lt;br /&gt;
[http://www.holub.com/goodies/uml/ Allen Holub's UML Quick Reference]&lt;br /&gt;
&lt;br /&gt;
[http://www.cetus-links.org/oo_uml.html Architecture and Design: Unified Modeling Language (UML)] Possibly out of date&lt;br /&gt;
&lt;br /&gt;
[http://www-306.ibm.com/software/rational/uml/ IBM Rational - Unified Modeling Language] &lt;br /&gt;
&lt;br /&gt;
[http://www.agilemodeling.com/artifacts/classDiagram.htm UML 2 Class Diagrams]&lt;br /&gt;
&lt;br /&gt;
[http://atlas.kennesaw.edu/~dbraun/csis4650/A&amp;amp;D/UML_tutorial/index.htm Unified Modeling Language (UML) Tutorial]&lt;br /&gt;
&lt;br /&gt;
[http://www.sparxsystems.com/uml-tutorial.html UML Tutorial]&lt;br /&gt;
&lt;br /&gt;
[http://www.uml-forum.com/ UML Forum]&lt;br /&gt;
&lt;br /&gt;
[http://www.ibm.com/developerworks/rational/library/769.html UML basics: An introduction to the Unified Modeling Language]&lt;br /&gt;
&lt;br /&gt;
[http://www.visualcase.com/tutorials/uml-tutorial.htm Visual Case Tool - UML Tutorial]&lt;br /&gt;
&lt;br /&gt;
[http://www.geocities.com/siliconvalley/network/1582/uml-example.htm UML By Examples]&lt;/div&gt;</summary>
		<author><name>Hkdavis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_3_uml&amp;diff=13668</id>
		<title>CSC/ECE 517 Summer 2008/wiki2 3 uml</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_3_uml&amp;diff=13668"/>
		<updated>2008-06-25T02:51:42Z</updated>

		<summary type="html">&lt;p&gt;Hkdavis: /* What is UML */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
UML. There are literally hundreds of pages describing UML on the Web. If someone wants to learn about it, what should (s)he do? Look at the first few hits in Google? I expect we can do better than that. Write a review of the MVC sites on the Web. Which are best for learning about the concept? Which have the most instructive examples? Which are best for explaining how to apply UML in Ruby and Java? If you &lt;br /&gt;
choose this topic, you should be sure to peruse at least several dozen sites.&lt;br /&gt;
&lt;br /&gt;
== What is UML ==&lt;br /&gt;
&lt;br /&gt;
[http://www.uml.org/ Unified Modeling Language Resource Page]&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Unified_Modeling_Language Wikipedia UML Article]&lt;br /&gt;
&lt;br /&gt;
[http://dn.codegear.com/article/31863 Practical UML: A Hands-On Introduction for Developers]&lt;br /&gt;
&lt;br /&gt;
[http://www.holub.com/goodies/uml/ Allen Holub's UML Quick Reference]&lt;br /&gt;
&lt;br /&gt;
[http://www.cetus-links.org/oo_uml.html Architecture and Design: Unified Modeling Language (UML)] Possibly out of date&lt;br /&gt;
&lt;br /&gt;
[http://www-306.ibm.com/software/rational/uml/ IBM Rational - Unified Modeling Language] &lt;br /&gt;
&lt;br /&gt;
[http://www.agilemodeling.com/artifacts/classDiagram.htm UML 2 Class Diagrams]&lt;br /&gt;
&lt;br /&gt;
[http://atlas.kennesaw.edu/~dbraun/csis4650/A&amp;amp;D/UML_tutorial/index.htm Unified Modeling Language (UML) Tutorial]&lt;br /&gt;
&lt;br /&gt;
[http://www.sparxsystems.com/uml-tutorial.html UML Tutorial]&lt;br /&gt;
&lt;br /&gt;
[http://www.uml-forum.com/ UML Forum]&lt;br /&gt;
&lt;br /&gt;
[http://www.ibm.com/developerworks/rational/library/769.html UML basics: An introduction to the Unified Modeling Language]&lt;br /&gt;
&lt;br /&gt;
[http://www.visualcase.com/tutorials/uml-tutorial.htm Visual Case Tool - UML Tutorial]&lt;/div&gt;</summary>
		<author><name>Hkdavis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_3_uml&amp;diff=13667</id>
		<title>CSC/ECE 517 Summer 2008/wiki2 3 uml</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_3_uml&amp;diff=13667"/>
		<updated>2008-06-25T02:48:40Z</updated>

		<summary type="html">&lt;p&gt;Hkdavis: /* What is UML */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
UML. There are literally hundreds of pages describing UML on the Web. If someone wants to learn about it, what should (s)he do? Look at the first few hits in Google? I expect we can do better than that. Write a review of the MVC sites on the Web. Which are best for learning about the concept? Which have the most instructive examples? Which are best for explaining how to apply UML in Ruby and Java? If you &lt;br /&gt;
choose this topic, you should be sure to peruse at least several dozen sites.&lt;br /&gt;
&lt;br /&gt;
== What is UML ==&lt;br /&gt;
&lt;br /&gt;
[http://www.uml.org/ Unified Modeling Language Resource Page]&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Unified_Modeling_Language Wikipedia UML Article]&lt;br /&gt;
&lt;br /&gt;
[http://dn.codegear.com/article/31863 Practical UML: A Hands-On Introduction for Developers]&lt;br /&gt;
&lt;br /&gt;
[http://www.holub.com/goodies/uml/ Allen Holub's UML Quick Reference]&lt;br /&gt;
&lt;br /&gt;
[http://www.cetus-links.org/oo_uml.html Architecture and Design: Unified Modeling Language (UML)] Possibly out of date&lt;br /&gt;
&lt;br /&gt;
[http://www-306.ibm.com/software/rational/uml/ IBM Rational - Unified Modeling Language] &lt;br /&gt;
&lt;br /&gt;
[http://www.agilemodeling.com/artifacts/classDiagram.htm UML 2 Class Diagrams]&lt;br /&gt;
&lt;br /&gt;
[http://atlas.kennesaw.edu/~dbraun/csis4650/A&amp;amp;D/UML_tutorial/index.htm Unified Modeling Language (UML) Tutorial]&lt;br /&gt;
&lt;br /&gt;
[http://www.sparxsystems.com/uml-tutorial.html UML Tutorial]&lt;/div&gt;</summary>
		<author><name>Hkdavis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_3_uml&amp;diff=13665</id>
		<title>CSC/ECE 517 Summer 2008/wiki2 3 uml</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki2_3_uml&amp;diff=13665"/>
		<updated>2008-06-25T02:42:51Z</updated>

		<summary type="html">&lt;p&gt;Hkdavis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
UML. There are literally hundreds of pages describing UML on the Web. If someone wants to learn about it, what should (s)he do? Look at the first few hits in Google? I expect we can do better than that. Write a review of the MVC sites on the Web. Which are best for learning about the concept? Which have the most instructive examples? Which are best for explaining how to apply UML in Ruby and Java? If you &lt;br /&gt;
choose this topic, you should be sure to peruse at least several dozen sites.&lt;br /&gt;
&lt;br /&gt;
== What is UML ==&lt;br /&gt;
&lt;br /&gt;
[http://www.uml.org/ Unified Modeling Language Resource Page]&lt;/div&gt;</summary>
		<author><name>Hkdavis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki1_3_ref&amp;diff=13145</id>
		<title>CSC/ECE 517 Summer 2008/wiki1 3 ref</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki1_3_ref&amp;diff=13145"/>
		<updated>2008-06-12T03:15:00Z</updated>

		<summary type="html">&lt;p&gt;Hkdavis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
Reflection is built into Ruby, but in Java, it's a special API. Does this make Ruby code easier to write than Java code? Give examples of reflection sequences in both languages, and analyze which is clearer, and also, if possible, which is more efficient.&lt;br /&gt;
&lt;br /&gt;
== What is Reflection? ==&lt;br /&gt;
[http://en.wikipedia.org/wiki/Reflection_%28computer_science%29 Reflection] is the a programming paradigm that allows a program to examine it's own code, and modify itself or execute code generated dynamically. Wikipedia's description of Reflection says &amp;quot;Reflection is the process by which a computer program can observe and modify its own structure and behavior.&amp;quot; It provides a way for a program to change it's behavior and state based on it's current behavior and state. &lt;br /&gt;
&lt;br /&gt;
In the paper [[http://www.cs.indiana.edu/~jsobel/rop.html An Introduction to Reflection-Oriented Programming]], it is explained with a real-world analogy:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;The concept of reflection is best understood by reaching back to the study of self-awareness in artificial intelligence: &amp;quot;Here I am walking down the street in the rain. Since I'm starting to get drenched, I should open my umbrella.&amp;quot; This thought fragment reveals a self-awareness of behavior and state, one that leads to a change in that selfsame behavior and state. It would be desirable for computations to avail themselves of these reflective capabilities, examining themselves in order to make use of meta-level information in decisions about what to do next.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ruby Reflection ==&lt;br /&gt;
In Ruby, [http://en.wikipedia.org/wiki/Metaprogramming metaprogramming] is an important feature. Because it is also a dynamically typed language, it's very useful to be able to examine the type of a given object at runtime, since it's type is not always known at compile time. Thus, a mechanism to change the program's behavior at runtime is needed. This is the reasoning behind Ruby's strong support of reflection.  Ruby allows a program to examine the properties of any given object to determine it's supported methods, members, etc. It also provides mechanisms to examine the class structure of a method, including it's class heirarchy and meta information such as access modifiers. &lt;br /&gt;
&lt;br /&gt;
Since objects in Ruby are dynamically typed, any method can be called on any object. Because the compiler doesn't impose restrictions on types, the runtime doesn't either, so Ruby code is able to call methods on objects dynamically at runtime. &lt;br /&gt;
&lt;br /&gt;
== Java Reflection API ==&lt;br /&gt;
In Java, reflection capabilities are available, but they are not built into the language. The java.lang.reflect package provides the API for reflection, along with the another important class, java.lang.Class. Metaprogramming is writing code that writes and executes other code at runtime, and reflection is one way to implement that. Since metaprogramming is not a feature or Java, reflection in Java typically requires more code than Ruby does, and thus is not as easy to use. It also has several drawbacks, such as security restrictions and performance overhead [[http://java.sun.com/docs/books/tutorial/reflect/index.html Sun Java Reflection tutorial]]. It is also more limited than Ruby's reflection capabilities, as demonstrated below.&lt;br /&gt;
&lt;br /&gt;
== Java Limitations ==&lt;br /&gt;
Something Ruby can do that Java can't is to iterate over the collection all of the objects of a certain type or simply all objects that exist in the runtime. The ObjectSpace class in Ruby has a method each_object(), which iterates over each object that matches the type of it's parameter. This example from [[http://www.ruby-doc.org/docs/ProgrammingRuby/ Programming Ruby: The Pragmatic Programmer's Guide]] illustrates it's use.&lt;br /&gt;
&lt;br /&gt;
        a = 102.7 &lt;br /&gt;
        b = 95.1 &lt;br /&gt;
        ObjectSpace.each_object(Numeric) {|x| p x }&lt;br /&gt;
&lt;br /&gt;
This prints out the value of each Numeric type object that exists in the Ruby environment. Java's reflection API doesn't provide a mechanism to iterate over Objects that you don't already have a reference to. While this functionality could be provided by an extension to the JVM or a third party library, in Ruby, it is built into the language from the ground up. &lt;br /&gt;
&lt;br /&gt;
== Ruby vs. Java Examples ==&lt;br /&gt;
Here are some original examples of Java and Ruby code that demonstrate how each language accomplishes the same task using it's reflection capabilities.&lt;br /&gt;
&lt;br /&gt;
=== List Methods of a Class ===&lt;br /&gt;
What follows are the implementations of listing all the methods of an array class in both languages. As you can see, the Ruby example is much simpler, since reflection is built into the array class itself.&lt;br /&gt;
&lt;br /&gt;
==== Java ====&lt;br /&gt;
In java, to print the names of all the methods an Object[] has, the following code is needed:&lt;br /&gt;
        Object[] objArray = new Object[]{&amp;quot;Hello World&amp;quot;};&lt;br /&gt;
        Method[] methods = objArray.getClass().getMethods();&lt;br /&gt;
        for (Method m : methods) {&lt;br /&gt;
            System.out.println(m.getName());&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
==== Ruby ====&lt;br /&gt;
In Ruby, the same functionality is a single line:&lt;br /&gt;
        puts Array.methods&lt;br /&gt;
&lt;br /&gt;
=== Invoke a Method on an Instance ===&lt;br /&gt;
In this section I demonstrate how to make a simple method call in each language using reflection. &lt;br /&gt;
&lt;br /&gt;
==== Java ====&lt;br /&gt;
In Java, the indexOf(String) method is used to find the index of a substring in a given String&lt;br /&gt;
        &amp;quot;Hello World&amp;quot;.indexOf(&amp;quot;W&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
To use reflection to make that method call requires the following code:&lt;br /&gt;
        String s = &amp;quot;Hello World&amp;quot;;&lt;br /&gt;
        Method method;&lt;br /&gt;
        try {&lt;br /&gt;
            method = s.getClass().getMethod(&amp;quot;indexOf&amp;quot;, new Class[]{String.class});&lt;br /&gt;
            Object result = method.invoke(s, &amp;quot;W&amp;quot;);&lt;br /&gt;
            System.out.println(result);&lt;br /&gt;
        }&lt;br /&gt;
        catch(NoSuchMethodException nsme) {&lt;br /&gt;
            nsme.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
        catch(IllegalAccessException iae) {&lt;br /&gt;
            iae.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
        catch(InvocationTargetException ite) {&lt;br /&gt;
            ite.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
As you can see, this requires creating arrays of Class objects to specify parameter types, and possibly casting the result of the method call from Object to the correct type. It also requires you to catch 3 possible Exceptions that may occur. Ruby's reflections mechanisms don't require exception handling. &lt;br /&gt;
&lt;br /&gt;
==== Ruby ====&lt;br /&gt;
In Ruby, the same method call is:&lt;br /&gt;
        &amp;quot;Hello World&amp;quot;.index(&amp;quot;W&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Using reflection, this is reduced to a simple 3 lines of code&lt;br /&gt;
        s = &amp;quot;Hello World&amp;quot;&lt;br /&gt;
        method = s.method(&amp;quot;index&amp;quot;)&lt;br /&gt;
        method.call(&amp;quot;W&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
As you can see from the examples, both languages are capable of much of the same functionality. The major advantage for Ruby's reflection is it's holistic inclusion into the language, instead of an addition as a library. It requires less code and has simpler syntax, and thus takes less work to write and maintain. It increases code flexibility by encouraging programmers to dive right into it's features, instead of having to learn another library and overcome security and performance problems as in Java. &lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
*[http://java.sun.com/docs/books/tutorial/reflect/index.html Java Reflection Tutorial]&lt;br /&gt;
*[http://java.sun.com/javase/6/docs/api/java/lang/reflect/package-summary.html java.lang.reflect Package API]&lt;br /&gt;
*[http://java.sun.com/javase/6/docs/api/java/lang/Class.html java.lang.Class API]&lt;br /&gt;
*[http://phrogz.net/programmingruby/ospace.html Reflection, ObjectSpace, and Distributed Ruby]&lt;/div&gt;</summary>
		<author><name>Hkdavis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki1_3_ref&amp;diff=13144</id>
		<title>CSC/ECE 517 Summer 2008/wiki1 3 ref</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki1_3_ref&amp;diff=13144"/>
		<updated>2008-06-12T03:14:16Z</updated>

		<summary type="html">&lt;p&gt;Hkdavis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
Reflection is built into Ruby, but in Java, it's a special API. Does this make Ruby code easier to write than Java code? Give examples of reflection sequences in both languages, and analyze which is clearer, and also, if possible, which is more efficient.&lt;br /&gt;
&lt;br /&gt;
== What is Reflection? ==&lt;br /&gt;
[http://en.wikipedia.org/wiki/Reflection_%28computer_science%29 Reflection] is the a programming paradigm that allows a program to examine it's own code, and modify itself or execute code generated dynamically. Wikipedia's description of Reflection says &amp;quot;Reflection is the process by which a computer program can observe and modify its own structure and behavior.&amp;quot; It provides a way for a program to change it's behavior and state based on it's current behavior and state. &lt;br /&gt;
&lt;br /&gt;
In the paper [[http://www.cs.indiana.edu/~jsobel/rop.html An Introduction to Reflection-Oriented Programming]], it is explained with a real-world analogy:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;The concept of reflection is best understood by reaching back to the study of self-awareness in artificial intelligence: &amp;quot;Here I am walking down the street in the rain. Since I'm starting to get drenched, I should open my umbrella.&amp;quot; This thought fragment reveals a self-awareness of behavior and state, one that leads to a change in that selfsame behavior and state. It would be desirable for computations to avail themselves of these reflective capabilities, examining themselves in order to make use of meta-level information in decisions about what to do next.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ruby Reflection ==&lt;br /&gt;
In Ruby, [http://en.wikipedia.org/wiki/Metaprogramming metaprogramming] is an important feature. Because it is also a dynamically typed language, it's very useful to be able to examine the type of a given object at runtime, since it's type is not always known at compile time. Thus, a mechanism to change the program's behavior at runtime is needed. This is the reasoning behind Ruby's strong support of reflection.  Ruby allows a program to examine the properties of any given object to determine it's supported methods, members, etc. It also provides mechanisms to examine the class structure of a method, including it's class heirarchy and meta information such as access modifiers. &lt;br /&gt;
&lt;br /&gt;
Since objects in Ruby are dynamically typed, any method can be called on any object. Because the compiler doesn't impose restrictions on types, the runtime doesn't either, so Ruby code is able to call methods on objects dynamically at runtime. &lt;br /&gt;
&lt;br /&gt;
== Java Reflection API ==&lt;br /&gt;
In Java, reflection capabilities are available, but they are not built into the language. The java.lang.reflect package provides the API for reflection, along with the another important class, java.lang.Class. Metaprogramming is writing code that writes and executes other code at runtime, and reflection is one way to implement that. Since metaprogramming is not a feature or Java, reflection in Java typically requires more code than Ruby does, and thus is not as easy to use. It also has several drawbacks, such as security restrictions and performance overhead [[http://java.sun.com/docs/books/tutorial/reflect/index.html Sun Java Reflection tutorial]]. It is also more limited than Ruby's reflection capabilities, as demonstrated below.&lt;br /&gt;
&lt;br /&gt;
== Java Limitations ==&lt;br /&gt;
Something Ruby can do that Java can't is to iterate over the collection all of the objects of a certain type or simply all objects that exist in the runtime. The ObjectSpace class in Ruby has a method each_object(), which iterates over each object that matches the type of it's parameter. This example from [[http://www.ruby-doc.org/docs/ProgrammingRuby/ Programming Ruby: The Pragmatic Programmer's Guide]] illustrates it's use.&lt;br /&gt;
&lt;br /&gt;
        a = 102.7 &lt;br /&gt;
        b = 95.1 &lt;br /&gt;
        ObjectSpace.each_object(Numeric) {|x| p x }&lt;br /&gt;
&lt;br /&gt;
This prints out the value of each Numeric type object that exists in the Ruby environment. Java's reflection API doesn't provide a mechanism to iterate over Objects that you don't already have a reference to. While this functionality could be provided by an extension to the JVM or a third party library, in Ruby, it is built into the language from the ground up. &lt;br /&gt;
&lt;br /&gt;
== Ruby v. Java Examples ==&lt;br /&gt;
Here are some examples of Java and Ruby code that demonstrate how each language accomplishes the same task using it's reflection capabilities.&lt;br /&gt;
&lt;br /&gt;
=== List Methods of a Class ===&lt;br /&gt;
What follows are the implementations of listing all the methods of an array class in both languages. As you can see, the Ruby example is much simpler, since reflection is built into the array class itself.&lt;br /&gt;
&lt;br /&gt;
==== Java ====&lt;br /&gt;
In java, to print the names of all the methods an Object[] has, the following code is needed:&lt;br /&gt;
        Object[] objArray = new Object[]{&amp;quot;Hello World&amp;quot;};&lt;br /&gt;
        Method[] methods = objArray.getClass().getMethods();&lt;br /&gt;
        for (Method m : methods) {&lt;br /&gt;
            System.out.println(m.getName());&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
==== Ruby ====&lt;br /&gt;
In Ruby, the same functionality is a single line:&lt;br /&gt;
        puts Array.methods&lt;br /&gt;
&lt;br /&gt;
=== Invoke a Method on an Instance ===&lt;br /&gt;
In this section I demonstrate how to make a simple method call in each language using reflection. &lt;br /&gt;
&lt;br /&gt;
==== Java ====&lt;br /&gt;
In Java, the indexOf(String) method is used to find the index of a substring in a given String&lt;br /&gt;
        &amp;quot;Hello World&amp;quot;.indexOf(&amp;quot;W&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
To use reflection to make that method call requires the following code:&lt;br /&gt;
        String s = &amp;quot;Hello World&amp;quot;;&lt;br /&gt;
        Method method;&lt;br /&gt;
        try {&lt;br /&gt;
            method = s.getClass().getMethod(&amp;quot;indexOf&amp;quot;, new Class[]{String.class});&lt;br /&gt;
            Object result = method.invoke(s, &amp;quot;W&amp;quot;);&lt;br /&gt;
            System.out.println(result);&lt;br /&gt;
        }&lt;br /&gt;
        catch(NoSuchMethodException nsme) {&lt;br /&gt;
            nsme.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
        catch(IllegalAccessException iae) {&lt;br /&gt;
            iae.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
        catch(InvocationTargetException ite) {&lt;br /&gt;
            ite.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
As you can see, this requires creating arrays of Class objects to specify parameter types, and possibly casting the result of the method call from Object to the correct type. It also requires you to catch 3 possible Exceptions that may occur. Ruby's reflections mechanisms don't require exception handling. &lt;br /&gt;
&lt;br /&gt;
==== Ruby ====&lt;br /&gt;
In Ruby, the same method call is:&lt;br /&gt;
        &amp;quot;Hello World&amp;quot;.index(&amp;quot;W&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Using reflection, this is reduced to a simple 3 lines of code&lt;br /&gt;
        s = &amp;quot;Hello World&amp;quot;&lt;br /&gt;
        method = s.method(&amp;quot;index&amp;quot;)&lt;br /&gt;
        method.call(&amp;quot;W&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
As you can see from the examples, both languages are capable of much of the same functionality. The major advantage for Ruby's reflection is it's holistic inclusion into the language, instead of an addition as a library. It requires less code and has simpler syntax, and thus takes less work to write and maintain. It increases code flexibility by encouraging programmers to dive right into it's features, instead of having to learn another library and overcome security and performance problems as in Java. &lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
*[http://java.sun.com/docs/books/tutorial/reflect/index.html Java Reflection Tutorial]&lt;br /&gt;
*[http://java.sun.com/javase/6/docs/api/java/lang/reflect/package-summary.html java.lang.reflect Package API]&lt;br /&gt;
*[http://java.sun.com/javase/6/docs/api/java/lang/Class.html java.lang.Class API]&lt;br /&gt;
*[http://phrogz.net/programmingruby/ospace.html Reflection, ObjectSpace, and Distributed Ruby]&lt;/div&gt;</summary>
		<author><name>Hkdavis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki1_3_ref&amp;diff=13142</id>
		<title>CSC/ECE 517 Summer 2008/wiki1 3 ref</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki1_3_ref&amp;diff=13142"/>
		<updated>2008-06-12T03:10:40Z</updated>

		<summary type="html">&lt;p&gt;Hkdavis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
Reflection is built into Ruby, but in Java, it's a special API. Does this make Ruby code easier to write than Java code? Give examples of reflection sequences in both languages, and analyze which is clearer, and also, if possible, which is more efficient.&lt;br /&gt;
&lt;br /&gt;
== What is Reflection? ==&lt;br /&gt;
[http://en.wikipedia.org/wiki/Reflection_%28computer_science%29 Reflection] is the a programming paradigm that allows a program to examine it's own code, and modify itself or execute code generated dynamically. Wikipedia's description of Reflection says &amp;quot;Reflection is the process by which a computer program can observe and modify its own structure and behavior.&amp;quot; It provides a way for a program to change it's behavior and state based on it's current behavior and state. &lt;br /&gt;
&lt;br /&gt;
In the paper [[http://www.cs.indiana.edu/~jsobel/rop.html An Introduction to Reflection-Oriented Programming]], it is explained with a real-world analogy:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;The concept of reflection is best understood by reaching back to the study of self-awareness in artificial intelligence: &amp;quot;Here I am walking down the street in the rain. Since I'm starting to get drenched, I should open my umbrella.&amp;quot; This thought fragment reveals a self-awareness of behavior and state, one that leads to a change in that selfsame behavior and state. It would be desirable for computations to avail themselves of these reflective capabilities, examining themselves in order to make use of meta-level information in decisions about what to do next.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ruby Reflection ==&lt;br /&gt;
In Ruby, [http://en.wikipedia.org/wiki/Metaprogramming metaprogramming] is an important feature. Because it is also a dynamically typed language, it's very useful to be able to examine the type of a given object at runtime, since it's type is not always known at compile time. Thus, a mechanism to change the program's behavior at runtime is needed. This is the reasoning behind Ruby's strong support of reflection.  Ruby allows a program to examine the properties of any given object to determine it's supported methods, members, etc. It also provides mechanisms to examine the class structure of a method, including it's class heirarchy and meta information such as access modifiers. &lt;br /&gt;
&lt;br /&gt;
Since objects in Ruby are dynamically typed, any method can be called on any object. Because the compiler doesn't impose restrictions on types, the runtime doesn't either, so Ruby code is able to call methods on objects dynamically at runtime. &lt;br /&gt;
&lt;br /&gt;
== Java Reflection API ==&lt;br /&gt;
In Java, reflection capabilities are available, but they are not built into the language. The java.lang.reflect package provides the API for reflection, along with the another important class, java.lang.Class. Metaprogramming is writing code that writes and executes other code at runtime, and reflection is one way to implement that. Since metaprogramming is not a feature or Java, reflection in Java typically requires more code than Ruby does, and thus is not as easy to use. It also has several drawbacks, such as security restrictions and performance overhead [[http://java.sun.com/docs/books/tutorial/reflect/index.html Sun Java Reflection tutorial]]. It is also more limited than Ruby's reflection capabilities, as demonstrated below.&lt;br /&gt;
&lt;br /&gt;
== Java Limitations ==&lt;br /&gt;
Something Ruby can do that Java can't is to iterate over the collection all of the objects of a certain type or simply all objects that exist in the runtime. The ObjectSpace class in Ruby has a method each_object(), which iterates over each object that matches the type of it's parameter. This example from [[http://www.ruby-doc.org/docs/ProgrammingRuby/ Programming Ruby: The Pragmatic Programmer's Guide]] illustrates it's use.&lt;br /&gt;
&lt;br /&gt;
        a = 102.7 &lt;br /&gt;
        b = 95.1 &lt;br /&gt;
        ObjectSpace.each_object(Numeric) {|x| p x }&lt;br /&gt;
&lt;br /&gt;
This prints out the value of each Numeric type object that exists in the Ruby environment. Java's reflection API doesn't provide a mechanism to iterate over Objects that you don't already have a reference to. While this functionality could be provided by an extension to the JVM or a third party library, in Ruby, it is built into the language from the ground up. &lt;br /&gt;
&lt;br /&gt;
== Ruby v. Java Examples ==&lt;br /&gt;
Here are some examples of Java and Ruby code that demonstrate how each language accomplishes the same task using it's reflection capabilities.&lt;br /&gt;
&lt;br /&gt;
=== List Methods of a Class ===&lt;br /&gt;
&lt;br /&gt;
==== Java ====&lt;br /&gt;
In java, to print the names of all the methods an Object[] has, the following code is needed:&lt;br /&gt;
        Object[] objArray = new Object[]{&amp;quot;Hello World&amp;quot;};&lt;br /&gt;
        Method[] methods = objArray.getClass().getMethods();&lt;br /&gt;
        for (Method m : methods) {&lt;br /&gt;
            System.out.println(m.getName());&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
==== Ruby ====&lt;br /&gt;
In Ruby, the same functionality is a single line:&lt;br /&gt;
        puts Array.methods&lt;br /&gt;
&lt;br /&gt;
=== Invoke a Method on an Instance ===&lt;br /&gt;
&lt;br /&gt;
==== Java ====&lt;br /&gt;
In Java, the indexOf(String) method is used to find the index of a substring in a given String&lt;br /&gt;
        &amp;quot;Hello World&amp;quot;.indexOf(&amp;quot;W&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
To use reflection to make this method call requires the following code:&lt;br /&gt;
        String s = &amp;quot;Hello World&amp;quot;;&lt;br /&gt;
        Method method;&lt;br /&gt;
        try {&lt;br /&gt;
            method = s.getClass().getMethod(&amp;quot;indexOf&amp;quot;, new Class[]{String.class});&lt;br /&gt;
            Object result = method.invoke(s, &amp;quot;W&amp;quot;);&lt;br /&gt;
            System.out.println(result);&lt;br /&gt;
        }&lt;br /&gt;
        catch(NoSuchMethodException nsme) {&lt;br /&gt;
            nsme.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
        catch(IllegalAccessException iae) {&lt;br /&gt;
            iae.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
        catch(InvocationTargetException ite) {&lt;br /&gt;
            ite.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
As you can see, this requires creating arrays of Class objects to specify parameter types, and possibly casting the result of the method call from Object to the correct type. It also requires you to catch 3 possible Exceptions that may occur. Ruby's reflections mechanisms don't require exception handling. &lt;br /&gt;
&lt;br /&gt;
==== Ruby ====&lt;br /&gt;
In Ruby, the same method call is:&lt;br /&gt;
        &amp;quot;Hello World&amp;quot;.index(&amp;quot;W&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Using reflection, this is reduced to a simple 3 lines of code&lt;br /&gt;
        s = &amp;quot;Hello World&amp;quot;&lt;br /&gt;
        method = s.method(&amp;quot;index&amp;quot;)&lt;br /&gt;
        method.call(&amp;quot;W&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
As you can see from the examples, both languages are capable of much of the same functionality. The major advantage for Ruby's reflection is it's holistic inclusion into the language, instead of an addition as a library. It requires less code and has simpler syntax, and thus takes less work to write and maintain. It increases code flexibility by encouraging programmers to dive right into it's features, instead of having to learn another library and overcome security and performance problems as in Java. &lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
*[http://java.sun.com/docs/books/tutorial/reflect/index.html Java Reflection Tutorial]&lt;br /&gt;
*[http://java.sun.com/javase/6/docs/api/java/lang/reflect/package-summary.html java.lang.reflect Package API]&lt;br /&gt;
*[http://java.sun.com/javase/6/docs/api/java/lang/Class.html java.lang.Class API]&lt;br /&gt;
*[http://phrogz.net/programmingruby/ospace.html Reflection, ObjectSpace, and Distributed Ruby]&lt;/div&gt;</summary>
		<author><name>Hkdavis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki1_3_ref&amp;diff=13139</id>
		<title>CSC/ECE 517 Summer 2008/wiki1 3 ref</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki1_3_ref&amp;diff=13139"/>
		<updated>2008-06-12T03:03:40Z</updated>

		<summary type="html">&lt;p&gt;Hkdavis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
Reflection is built into Ruby, but in Java, it's a special API. Does this make Ruby code easier to write than Java code? Give examples of reflection sequences in both languages, and analyze which is clearer, and also, if possible, which is more efficient.&lt;br /&gt;
&lt;br /&gt;
== What is Reflection? ==&lt;br /&gt;
[http://en.wikipedia.org/wiki/Reflection_%28computer_science%29 Reflection] is the a programming paradigm that allows a program to examine it's own code, and modify itself or execute code generated dynamically. Wikipedia's description of Reflection says &amp;quot;Reflection is the process by which a computer program can observe and modify its own structure and behavior.&amp;quot; It provides a way for a program to change it's behavior and state based on it's current behavior and state. &lt;br /&gt;
&lt;br /&gt;
In the paper [[http://www.cs.indiana.edu/~jsobel/rop.html An Introduction to Reflection-Oriented Programming]], it is explained with a real-world analogy:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;The concept of reflection is best understood by reaching back to the study of self-awareness in artificial intelligence: &amp;quot;Here I am walking down the street in the rain. Since I'm starting to get drenched, I should open my umbrella.&amp;quot; This thought fragment reveals a self-awareness of behavior and state, one that leads to a change in that selfsame behavior and state. It would be desirable for computations to avail themselves of these reflective capabilities, examining themselves in order to make use of meta-level information in decisions about what to do next.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ruby Reflection ==&lt;br /&gt;
In Ruby, [http://en.wikipedia.org/wiki/Metaprogramming metaprogramming] is an important feature. Because it is also a dynamically typed language, it's very useful to be able to examine the type of a given object at runtime, since it's type is not always known at compile time. Thus, a mechanism to change the program's behavior at runtime is needed. This is the reasoning behind Ruby's strong support of reflection.  Ruby allows a program to examine the properties of any given object to determine it's supported methods, members, etc. It also provides mechanisms to examine the class structure of a method, including it's class heirarchy and meta information such as access modifiers. &lt;br /&gt;
&lt;br /&gt;
Since objects in Ruby are dynamically typed, any method can be called on any object. Because the compiler doesn't impose restrictions on types, the runtime doesn't either, so Ruby code is able to call methods on objects dynamically at runtime. &lt;br /&gt;
&lt;br /&gt;
== Java Reflection API ==&lt;br /&gt;
In Java, reflection capabilities are available, but they are not built into the language. The java.lang.reflect package provides the API for reflection, along with the another important class, java.lang.Class. Metaprogramming is writing code that writes and executes other code at runtime, and reflection is one way to implement that. Since metaprogramming is not a feature or Java, reflection in Java typically requires more code than Ruby does, and thus is not as easy to use. It also has several drawbacks, such as security restrictions and performance overhead [[http://java.sun.com/docs/books/tutorial/reflect/index.html Sun Java Reflection tutorial]]. It is also more limited than Ruby's reflection capabilities, as demonstrated below.&lt;br /&gt;
&lt;br /&gt;
== Java Limitations ==&lt;br /&gt;
Something Ruby can do that Java can't is to iterate over the collection all of the objects of a certain type or simply all objects that exist in the runtime. The ObjectSpace class in Ruby has a method each_object(), which iterates over each object that matches the type of it's parameter. This example from [[http://www.ruby-doc.org/docs/ProgrammingRuby/ Programming Ruby: The Pragmatic Programmer's Guide]] illustrates it's use.&lt;br /&gt;
&lt;br /&gt;
        a = 102.7 &lt;br /&gt;
        b = 95.1 &lt;br /&gt;
        ObjectSpace.each_object(Numeric) {|x| p x }&lt;br /&gt;
&lt;br /&gt;
This prints out the value of each Numeric type object that exists in the Ruby environment. Java's reflection API doesn't provide a mechanism to iterate over Objects that you don't already have a reference to. While this functionality could be provided by an extension to the JVM or a third party library, in Ruby, it is built into the language from the ground up. &lt;br /&gt;
&lt;br /&gt;
== Ruby v. Java Examples ==&lt;br /&gt;
Here are some examples of Java and Ruby code that demonstrate how each language accomplishes the same task using it's reflection capabilities.&lt;br /&gt;
&lt;br /&gt;
=== List methods of a class - Java ===&lt;br /&gt;
In java, to print the names of all the methods an Object[] has, the following code is needed:&lt;br /&gt;
        Object[] objArray = new Object[]{&amp;quot;Hello World&amp;quot;};&lt;br /&gt;
        Method[] methods = objArray.getClass().getMethods();&lt;br /&gt;
        for (Method m : methods) {&lt;br /&gt;
            System.out.println(m.getName());&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
=== List methods of a class - Ruby ===&lt;br /&gt;
In Ruby, the same functionality is a single line:&lt;br /&gt;
        puts Array.methods&lt;br /&gt;
&lt;br /&gt;
=== Invoke method on an instance - Java ===&lt;br /&gt;
In Java, the indexOf(String) method is used to find the index of a substring in a given String&lt;br /&gt;
        &amp;quot;Hello World&amp;quot;.indexOf(&amp;quot;W&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
To use reflection to make this method call requires the following code:&lt;br /&gt;
        String s = &amp;quot;Hello World&amp;quot;;&lt;br /&gt;
        Method method;&lt;br /&gt;
        try {&lt;br /&gt;
            method = s.getClass().getMethod(&amp;quot;indexOf&amp;quot;, new Class[]{String.class});&lt;br /&gt;
            Object result = method.invoke(s, &amp;quot;W&amp;quot;);&lt;br /&gt;
            System.out.println(result);&lt;br /&gt;
        }&lt;br /&gt;
        catch(NoSuchMethodException nsme) {&lt;br /&gt;
            nsme.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
        catch(IllegalAccessException iae) {&lt;br /&gt;
            iae.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
        catch(InvocationTargetException ite) {&lt;br /&gt;
            ite.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
As you can see, this requires creating arrays of Class objects to specify parameter types, and possibly casting the result of the method call from Object to the correct type. It also requires you to catch 3 possible Exceptions that may occur. Ruby's reflections mechanisms don't require exception handling. &lt;br /&gt;
&lt;br /&gt;
=== Invoke method on an instance - Ruby ===&lt;br /&gt;
In Ruby, the same method call is:&lt;br /&gt;
        &amp;quot;Hello World&amp;quot;.index(&amp;quot;W&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Using reflection, this is reduced to a simple 3 lines of code&lt;br /&gt;
        s = &amp;quot;Hello World&amp;quot;&lt;br /&gt;
        method = s.method(&amp;quot;index&amp;quot;)&lt;br /&gt;
        method.call(&amp;quot;W&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://java.sun.com/docs/books/tutorial/reflect/index.html Java Reflection Tutorial]&lt;br /&gt;
*[http://java.sun.com/javase/6/docs/api/java/lang/reflect/package-summary.html java.lang.reflect Package API]&lt;br /&gt;
*[http://java.sun.com/javase/6/docs/api/java/lang/Class.html java.lang.Class API]&lt;br /&gt;
*[http://phrogz.net/programmingruby/ospace.html Reflection, ObjectSpace, and Distributed Ruby]&lt;/div&gt;</summary>
		<author><name>Hkdavis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki1_3_ref&amp;diff=13129</id>
		<title>CSC/ECE 517 Summer 2008/wiki1 3 ref</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki1_3_ref&amp;diff=13129"/>
		<updated>2008-06-12T02:58:18Z</updated>

		<summary type="html">&lt;p&gt;Hkdavis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
Reflection is built into Ruby, but in Java, it's a special API. Does this make Ruby code easier to write than Java code? Give examples of reflection sequences in both languages, and analyze which is clearer, and also, if possible, which is more efficient.&lt;br /&gt;
&lt;br /&gt;
== What is Reflection? ==&lt;br /&gt;
Reflection is the a programming paradigm that allows a program to examine it's own code, and modify itself or execute code generated dynamically. The definition of Reflection from the [[http://en.wikipedia.org/wiki/Reflection_%28computer_science%29 Wikipedia Reflection article]] says &amp;quot;Reflection is the process by which a computer program can observe and modify its own structure and behavior.&amp;quot; It provides a way for a program to change it's behavior and state based on it's current behavior and state. &lt;br /&gt;
&lt;br /&gt;
In the paper [[http://www.cs.indiana.edu/~jsobel/rop.html An Introduction to Reflection-Oriented Programming]], it is explained with a real-world analogy:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;The concept of reflection is best understood by reaching back to the study of self-awareness in artificial intelligence: &amp;quot;Here I am walking down the street in the rain. Since I'm starting to get drenched, I should open my umbrella.&amp;quot; This thought fragment reveals a self-awareness of behavior and state, one that leads to a change in that selfsame behavior and state. It would be desirable for computations to avail themselves of these reflective capabilities, examining themselves in order to make use of meta-level information in decisions about what to do next.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ruby Reflection ==&lt;br /&gt;
In Ruby, metaprogramming is an important feature. Because it is also a dynamically typed language, it's very useful to be able to examine the type of a given object at runtime, since it's type is not always known at compile time. Thus, a mechanism to change the program's behavior at runtime is needed. This is the reasoning behind Ruby's strong support of reflection.  Ruby allows a program to examine the properties of any given object to determine it's supported methods, members, etc. It also provides mechanisms to examine the class structure of a method, including it's class heirarchy and meta information such as access modifiers. &lt;br /&gt;
&lt;br /&gt;
Since objects in Ruby are dynamically typed, any method can be called on any object. Because the compiler doesn't impose restrictions on types, the runtime doesn't either, so Ruby code is able to call methods on objects dynamically at runtime. &lt;br /&gt;
&lt;br /&gt;
== Java Reflection API ==&lt;br /&gt;
In Java, reflection capabilities are available, but they are not built into the language. The java.lang.reflect package provides the API for reflection, along with the another important class, java.lang.Class. [[http://en.wikipedia.org/wiki/Metaprogramming Metaprogramming]] is writing code that writes and executes other code at runtime, and reflection is one way to implement that. Since metaprogramming is not a feature or Java, reflection in Java typically requires more code than Ruby does, and thus is not as easy to use. It is also more limited than Ruby's reflection capabilities, as demonstrated below.&lt;br /&gt;
&lt;br /&gt;
== Java Limitations ==&lt;br /&gt;
Something Ruby can do that Java can't is to iterate over the collection all of the objects of a certain type or simply all objects that exist in the runtime. The ObjectSpace class in Ruby has a method each_object(), which iterates over each object that matches the type of it's parameter. This example from [[http://www.ruby-doc.org/docs/ProgrammingRuby/ Programming Ruby: The Pragmatic Programmer's Guide]] illustrates it's use.&lt;br /&gt;
&lt;br /&gt;
        a = 102.7 &lt;br /&gt;
        b = 95.1 &lt;br /&gt;
        ObjectSpace.each_object(Numeric) {|x| p x }&lt;br /&gt;
&lt;br /&gt;
This prints out the value of each Numeric type object that exists in the Ruby environment. Java's reflection API doesn't provide a mechanism to iterate over Objects that you don't already have a reference to. While this functionality could be provided by an extension to the JVM or a third party library, in Ruby, it is built into the language from the ground up. &lt;br /&gt;
&lt;br /&gt;
== Ruby v. Java Examples ==&lt;br /&gt;
Here are some examples of Java and Ruby code that demonstrate how each language accomplishes the same task using it's reflection capabilities.&lt;br /&gt;
&lt;br /&gt;
=== List methods of a class - Java ===&lt;br /&gt;
In java, to print the names of all the methods an Object[] has, the following code is needed:&lt;br /&gt;
        Object[] objArray = new Object[]{&amp;quot;Hello World&amp;quot;};&lt;br /&gt;
        Method[] methods = objArray.getClass().getMethods();&lt;br /&gt;
        for (Method m : methods) {&lt;br /&gt;
            System.out.println(m.getName());&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
=== List methods of a class - Ruby ===&lt;br /&gt;
In Ruby, the same functionality is a single line:&lt;br /&gt;
        puts Array.methods&lt;br /&gt;
&lt;br /&gt;
=== Invoke method on an instance - Java ===&lt;br /&gt;
In Java, the indexOf(String) method is used to find the index of a substring in a given String&lt;br /&gt;
        &amp;quot;Hello World&amp;quot;.indexOf(&amp;quot;W&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
To use reflection to make this method call requires the following code:&lt;br /&gt;
        String s = &amp;quot;Hello World&amp;quot;;&lt;br /&gt;
        Method method;&lt;br /&gt;
        try {&lt;br /&gt;
            method = s.getClass().getMethod(&amp;quot;indexOf&amp;quot;, new Class[]{String.class});&lt;br /&gt;
            Object result = method.invoke(s, &amp;quot;W&amp;quot;);&lt;br /&gt;
            System.out.println(result);&lt;br /&gt;
        }&lt;br /&gt;
        catch(NoSuchMethodException nsme) {&lt;br /&gt;
            nsme.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
        catch(IllegalAccessException iae) {&lt;br /&gt;
            iae.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
        catch(InvocationTargetException ite) {&lt;br /&gt;
            ite.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
As you can see, this requires creating arrays of Class objects to specify parameter types, and possibly casting the result of the method call from Object to the correct type. It also requires you to catch 3 possible Exceptions that may occur. Ruby's reflections mechanisms don't require exception handling. &lt;br /&gt;
&lt;br /&gt;
=== Invoke method on an instance - Ruby ===&lt;br /&gt;
In Ruby, the same method call is:&lt;br /&gt;
        &amp;quot;Hello World&amp;quot;.index(&amp;quot;W&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Using reflection, this is reduced to a simple 3 lines of code&lt;br /&gt;
        s = &amp;quot;Hello World&amp;quot;&lt;br /&gt;
        method = s.method(&amp;quot;index&amp;quot;)&lt;br /&gt;
        method.call(&amp;quot;W&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://java.sun.com/docs/books/tutorial/reflect/index.html Java Reflection Tutorial]&lt;br /&gt;
*[http://java.sun.com/javase/6/docs/api/java/lang/reflect/package-summary.html java.lang.reflect Package API]&lt;br /&gt;
*[http://java.sun.com/javase/6/docs/api/java/lang/Class.html java.lang.Class API]&lt;br /&gt;
*[http://phrogz.net/programmingruby/ospace.html Reflection, ObjectSpace, and Distributed Ruby]&lt;/div&gt;</summary>
		<author><name>Hkdavis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki1_3_ref&amp;diff=13120</id>
		<title>CSC/ECE 517 Summer 2008/wiki1 3 ref</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki1_3_ref&amp;diff=13120"/>
		<updated>2008-06-12T02:51:39Z</updated>

		<summary type="html">&lt;p&gt;Hkdavis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
Reflection is built into Ruby, but in Java, it's a special API. Does this make Ruby code easier to write than Java code? Give examples of reflection sequences in both languages, and analyze which is clearer, and also, if possible, which is more efficient.&lt;br /&gt;
&lt;br /&gt;
== What is Reflection? ==&lt;br /&gt;
Reflection is the a programming paradigm that allows a program to examine it's own code, and modify itself or execute code generated dynamically. The definition of Reflection from the [[http://en.wikipedia.org/wiki/Reflection_%28computer_science%29 Wikipedia Reflection article]] says &amp;quot;Reflection is the process by which a computer program can observe and modify its own structure and behavior.&amp;quot; It provides a way for a program to change it's behavior and state based on it's current behavior and state. &lt;br /&gt;
&lt;br /&gt;
In the paper [[http://www.cs.indiana.edu/~jsobel/rop.html An Introduction to Reflection-Oriented Programming]], it is explained with a real-world analogy:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;The concept of reflection is best understood by reaching back to the study of self-awareness in artificial intelligence: &amp;quot;Here I am walking down the street in the rain. Since I'm starting to get drenched, I should open my umbrella.&amp;quot; This thought fragment reveals a self-awareness of behavior and state, one that leads to a change in that selfsame behavior and state. It would be desirable for computations to avail themselves of these reflective capabilities, examining themselves in order to make use of meta-level information in decisions about what to do next.&amp;quot; &lt;br /&gt;
&lt;br /&gt;
== Ruby Reflection ==&lt;br /&gt;
In Ruby, metaprogramming is an important feature. Because it is also a dynamically typed language, it's very useful to be able to examine the type of a given object at runtime, since it's type is not always known at compile time. Thus, a mechanism to change the program's behavior at runtime is needed. This is the reasoning behind Ruby's strong support of reflection.  Ruby allows a program to examine the properties of any given object to determine it's supported methods, members, etc. It also provides mechanisms to examine the class structure of a method, including it's class heirarchy and meta information such as access modifiers. &lt;br /&gt;
&lt;br /&gt;
Since objects in Ruby are dynamically typed, any method can be called on any object. Because the compiler doesn't impose restrictions on types, the runtime doesn't either, so Ruby code is able to call methods on objects dynamically at runtime. &lt;br /&gt;
&lt;br /&gt;
== Java Reflection API ==&lt;br /&gt;
In Java, reflection capabilities are available, but they are not built into the language. The java.lang.reflect package provides the API for reflection, along with the another important class, java.lang.Class. [[http://en.wikipedia.org/wiki/Metaprogramming Metaprogramming]] is writing code that writes and executes other code at runtime, and reflection is one way to implement that. Since metaprogramming is not a feature or Java, reflection in Java typically requires more code than Ruby does, and thus is not as easy to use. It is also more limited than Ruby's reflection capabilities, as demonstrated below.&lt;br /&gt;
&lt;br /&gt;
== Java Limitations ==&lt;br /&gt;
Something Ruby can do that Java can't is to iterate over the collection all of the objects of a certain type or simply all objects that exist in the runtime. The ObjectSpace class in Ruby has a method each_object(), which iterates over each object that matches the type of it's parameter. This example from [[http://www.ruby-doc.org/docs/ProgrammingRuby/ Programming Ruby: The Pragmatic Programmer's Guide]] illustrates it's use.&lt;br /&gt;
&lt;br /&gt;
        a = 102.7 &lt;br /&gt;
        b = 95.1 &lt;br /&gt;
        ObjectSpace.each_object(Numeric) {|x| p x }&lt;br /&gt;
&lt;br /&gt;
This prints out the value of each Numeric type object that exists in the Ruby environment. Java's reflection API doesn't provide a mechanism to iterate over Objects that you don't already have a reference to. While this functionality could be provided by an extension to the JVM or a third party library, in Ruby, it is built into the language from the ground up. &lt;br /&gt;
&lt;br /&gt;
== Ruby v. Java Examples ==&lt;br /&gt;
Here are some examples of Java and Ruby code that demonstrate how each language accomplishes the same task using it's reflection capabilities.&lt;br /&gt;
&lt;br /&gt;
=== List methods of a class - Java ===&lt;br /&gt;
In java, to print the names of all the methods an Object[] has, the following code is needed:&lt;br /&gt;
        Object[] objArray = new Object[]{&amp;quot;Hello World&amp;quot;};&lt;br /&gt;
        Method[] methods = objArray.getClass().getMethods();&lt;br /&gt;
        for (Method m : methods) {&lt;br /&gt;
            System.out.println(m.getName());&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
=== List methods of a class - Ruby ===&lt;br /&gt;
In Ruby, the same functionality is a single line:&lt;br /&gt;
        puts Array.methods&lt;br /&gt;
&lt;br /&gt;
=== Invoke method on an instance - Java ===&lt;br /&gt;
In Java, the indexOf(String) method is used to find the index of a substring in a given String&lt;br /&gt;
        &amp;quot;Hello World&amp;quot;.indexOf(&amp;quot;W&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
To use reflection to make this method call requires the following code:&lt;br /&gt;
        String s = &amp;quot;Hello World&amp;quot;;&lt;br /&gt;
        Method method;&lt;br /&gt;
        try {&lt;br /&gt;
            method = s.getClass().getMethod(&amp;quot;indexOf&amp;quot;, new Class[]{String.class});&lt;br /&gt;
            Object result = method.invoke(s, &amp;quot;W&amp;quot;);&lt;br /&gt;
            System.out.println(result);&lt;br /&gt;
        }&lt;br /&gt;
        catch(NoSuchMethodException nsme) {&lt;br /&gt;
            nsme.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
        catch(IllegalAccessException iae) {&lt;br /&gt;
            iae.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
        catch(InvocationTargetException ite) {&lt;br /&gt;
            ite.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
As you can see, this requires creating arrays of Class objects to specify parameter types, and possibly casting the result of the method call from Object to the correct type. It also requires you to catch 3 possible Exceptions that may occur. Ruby's reflections mechanisms don't require exception handling. &lt;br /&gt;
&lt;br /&gt;
=== Invoke method on an instance - Ruby ===&lt;br /&gt;
In Ruby, the same method call is:&lt;br /&gt;
        &amp;quot;Hello World&amp;quot;.index(&amp;quot;W&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Using reflection, this is reduced to a simple 3 lines of code&lt;br /&gt;
        s = &amp;quot;Hello World&amp;quot;&lt;br /&gt;
        method = s.method(&amp;quot;index&amp;quot;)&lt;br /&gt;
        method.call(&amp;quot;W&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://java.sun.com/docs/books/tutorial/reflect/index.html Java Reflection Tutorial]&lt;br /&gt;
*[http://java.sun.com/javase/6/docs/api/java/lang/reflect/package-summary.html java.lang.reflect Package API]&lt;br /&gt;
*[http://java.sun.com/javase/6/docs/api/java/lang/Class.html java.lang.Class API]&lt;br /&gt;
*[http://phrogz.net/programmingruby/ospace.html Reflection, ObjectSpace, and Distributed Ruby]&lt;/div&gt;</summary>
		<author><name>Hkdavis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki1_3_ref&amp;diff=13096</id>
		<title>CSC/ECE 517 Summer 2008/wiki1 3 ref</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki1_3_ref&amp;diff=13096"/>
		<updated>2008-06-12T02:33:31Z</updated>

		<summary type="html">&lt;p&gt;Hkdavis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
Reflection is built into Ruby, but in Java, it's a special API. Does this make Ruby code easier to write than Java code? Give examples of reflection sequences in both languages, and analyze which is clearer, and also, if possible, which is more efficient.&lt;br /&gt;
&lt;br /&gt;
== What is Reflection? ==&lt;br /&gt;
Reflection is the a programming paradigm that allows a program to examine it's own code, and modify itself or execute code generated dynamically. The definition of Reflection from the [[http://en.wikipedia.org/wiki/Reflection_%28computer_science%29 Wikipedia Reflection article]] says &amp;quot;Reflection is the process by which a computer program can observe and modify its own structure and behavior.&amp;quot; It provides a way for a program to change it's behavior and state based on it's current behavior and state. &lt;br /&gt;
&lt;br /&gt;
In the paper [[http://www.cs.indiana.edu/~jsobel/rop.html An Introduction to Reflection-Oriented Programming]], it is explained with a real-world analogy:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;The concept of reflection is best understood by reaching back to the study of self-awareness in artificial intelligence: &amp;quot;Here I am walking down the street in the rain. Since I'm starting to get drenched, I should open my umbrella.&amp;quot; This thought fragment reveals a self-awareness of behavior and state, one that leads to a change in that selfsame behavior and state. It would be desirable for computations to avail themselves of these reflective capabilities, examining themselves in order to make use of meta-level information in decisions about what to do next.&amp;quot; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Java Reflection API ==&lt;br /&gt;
In Java, reflection capabilities are available, but they are not built into the language. The java.lang.reflect package provides the API for reflection, along with the another important class, java.lang.Class. [[http://en.wikipedia.org/wiki/Metaprogramming Metaprogramming]] is writing code that writes and executes other code at runtime, and reflection is one way to implement that. Since metaprogramming is not a feature or Java, reflection in Java typically requires more code than Ruby does, and thus is not as easy to use. It is also more limited than Ruby's reflection capabilities, as demonstrated below.&lt;br /&gt;
&lt;br /&gt;
== Ruby Reflection ==&lt;br /&gt;
In Ruby, metaprogramming is an important feature. Because it is also a dynamically typed language, it's very useful to be able to examine the type of a given object at runtime, since it's type is not always known at compile time. Thus, a mechanism to change the program's behavior at runtime is needed. This is the reasoning behind Ruby's strong support of reflection.  Ruby allows a program to examine the properties of any given object to determine it's supported methods, members, etc. It also provides mechanisms to examine the class structure of a method, including it's class heirarchy and meta information such as access modifiers. &lt;br /&gt;
&lt;br /&gt;
Since objects in Ruby are dynamically typed, any method can be called on any object. Because the compiler doesn't impose restrictions on types, the runtime doesn't either, so Ruby code is able to call methods on objects dynamically at runtime. &lt;br /&gt;
&lt;br /&gt;
== Java Limitations ==&lt;br /&gt;
Something Ruby can do is to iterate over all of the objects of a certain type. The ObjectSpace class in Ruby has a method each_object(), which iterates over each object that matches the type of it's parameter. &lt;br /&gt;
&lt;br /&gt;
        a = 102.7 &lt;br /&gt;
        b = 95.1 &lt;br /&gt;
        ObjectSpace.each_object(Numeric) {|x| p x }&lt;br /&gt;
&lt;br /&gt;
This prints out the value of each Numeric type object that exists in the Ruby environment. Java's reflection API doesn't provide a mechanism to iterate over Objects that you don't already have a reference to. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Ruby v. Java Examples ==&lt;br /&gt;
Here are some examples of Java and Ruby code that demonstrate how each language accomplishes the same task using it's reflection capabilities.&lt;br /&gt;
&lt;br /&gt;
=== List methods of a class - Java ===&lt;br /&gt;
In java, to print the names of all the methods an Object[] has, the following code is needed:&lt;br /&gt;
        Object[] objArray = new Object[]{&amp;quot;Hello World&amp;quot;};&lt;br /&gt;
        Method[] methods = objArray.getClass().getMethods();&lt;br /&gt;
        for (Method m : methods) {&lt;br /&gt;
            System.out.println(m.getName());&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
=== List methods of a class - Ruby ===&lt;br /&gt;
In Ruby, the same functionality is a single line:&lt;br /&gt;
        puts Array.methods&lt;br /&gt;
&lt;br /&gt;
=== Invoke method on an instance - Java ===&lt;br /&gt;
In Java, the indexOf(String) method is used to find the index of a substring in a given String&lt;br /&gt;
        &amp;quot;Hello World&amp;quot;.indexOf(&amp;quot;W&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
To use reflection to make this method call requires the following code:&lt;br /&gt;
        String s = &amp;quot;Hello World&amp;quot;;&lt;br /&gt;
        Method method;&lt;br /&gt;
        try {&lt;br /&gt;
            method = s.getClass().getMethod(&amp;quot;indexOf&amp;quot;, new Class[]{String.class});&lt;br /&gt;
            Object result = method.invoke(s, &amp;quot;W&amp;quot;);&lt;br /&gt;
            System.out.println(result);&lt;br /&gt;
        }&lt;br /&gt;
        catch(NoSuchMethodException nsme) {&lt;br /&gt;
            nsme.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
        catch(IllegalAccessException iae) {&lt;br /&gt;
            iae.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
        catch(InvocationTargetException ite) {&lt;br /&gt;
            ite.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
As you can see, this requires creating arrays of Class objects to specify parameter types, and possibly casting the result of the method call from Object to the correct type. It also requires you to catch 3 possible Exceptions that may occur. Ruby's reflections mechanisms don't require exception handling. &lt;br /&gt;
&lt;br /&gt;
=== Invoke method on an instance - Ruby ===&lt;br /&gt;
In Ruby, the same method call is:&lt;br /&gt;
        &amp;quot;Hello World&amp;quot;.index(&amp;quot;W&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Using reflection, this is reduced to a simple 3 lines of code&lt;br /&gt;
        s = &amp;quot;Hello World&amp;quot;&lt;br /&gt;
        method = s.method(&amp;quot;index&amp;quot;)&lt;br /&gt;
        method.call(&amp;quot;W&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://java.sun.com/docs/books/tutorial/reflect/index.html Java Reflection Tutorial]&lt;br /&gt;
*[http://java.sun.com/javase/6/docs/api/java/lang/reflect/package-summary.html java.lang.reflect Package API]&lt;br /&gt;
*[http://java.sun.com/javase/6/docs/api/java/lang/Class.html java.lang.Class API]&lt;br /&gt;
*[http://phrogz.net/programmingruby/ospace.html Reflection, ObjectSpace, and Distributed Ruby]&lt;/div&gt;</summary>
		<author><name>Hkdavis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki1_Assignment&amp;diff=12830</id>
		<title>CSC/ECE 517 Summer 2008/wiki1 Assignment</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki1_Assignment&amp;diff=12830"/>
		<updated>2008-06-07T02:56:32Z</updated>

		<summary type="html">&lt;p&gt;Hkdavis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#[[CSC/ECE_517_Summer_2008/wiki1_1_rp | Regular-expression support]]&lt;br /&gt;
#[[CSC/ECE_517_Summer_2008/wiki1_2_itr | Iterators and generators]]&lt;br /&gt;
#[[CSC/ECE_517_Summer_2008/wiki1_3_ref | Reflection]]&lt;br /&gt;
#Threads&lt;br /&gt;
#[[CSC/ECE_517_Summer_2008/wiki1_5_a5 | Hooks ]]&lt;br /&gt;
#[[CSC/ECE_517_Summer_2008/wiki1_6_arraysandhashes | Arrays and Hashes]]&lt;br /&gt;
#[[CSC/ECE_517_Summer_2008/wiki1_7_ev | Eval]]&lt;br /&gt;
#[[CSC/ECE_517_Summer_2008/wiki1_8_smr | Prototype-based programming]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
[[CSC/ECE 517 Summer 2008]]&lt;/div&gt;</summary>
		<author><name>Hkdavis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki1_3_ref&amp;diff=12822</id>
		<title>CSC/ECE 517 Summer 2008/wiki1 3 ref</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki1_3_ref&amp;diff=12822"/>
		<updated>2008-06-07T02:44:16Z</updated>

		<summary type="html">&lt;p&gt;Hkdavis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Reflection is built into Ruby, but in Java, it's a special API. Does this make Ruby code easier to write than Java code? Give examples of reflection sequences in both languages, and analyze which is clearer, and also, if possible, which is more efficient.&lt;br /&gt;
&lt;br /&gt;
== Java Reflection ==&lt;br /&gt;
 &lt;br /&gt;
The Java package for reflection is java.lang.reflect. Another important class for reflection is java.lang.Class. Java's reflection has limitations that Ruby's doesn't. An example of something Ruby can do is to iterate over all of the objects of a certain type. The ObjectSpace class in Ruby has a method each_object(), which iterates over each object that matches the type of it's parameter. &lt;br /&gt;
&lt;br /&gt;
        a = 102.7 &lt;br /&gt;
        b = 95.1 &lt;br /&gt;
        ObjectSpace.each_object(Numeric) {|x| p x }&lt;br /&gt;
&lt;br /&gt;
This prints out the value of each Numeric type object that exists in the Ruby environment. Java's reflection API doesn't provide a mechanism to iterate over Objects that you don't already have a reference to. &lt;br /&gt;
&lt;br /&gt;
== Ruby v. Java Example ==&lt;br /&gt;
=== List methods of a class - Java ===&lt;br /&gt;
In java, to print the names of all the methods an Object[] has, the following code is needed:&lt;br /&gt;
        Object[] objArray = new Object[]{&amp;quot;Hello World&amp;quot;};&lt;br /&gt;
        Method[] methods = objArray.getClass().getMethods();&lt;br /&gt;
        for (Method m : methods) {&lt;br /&gt;
            System.out.println(m.getName());&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
=== List methods of a class - Ruby ===&lt;br /&gt;
In Ruby, the same functionality is a single line:&lt;br /&gt;
        puts Array.methods&lt;br /&gt;
&lt;br /&gt;
=== Invoke method on an instance - Java ===&lt;br /&gt;
In Java, the indexOf(String) method is used to find the index of a substring in a given String&lt;br /&gt;
        &amp;quot;Hello World&amp;quot;.indexOf(&amp;quot;W&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
To use reflection to make this method call requires the following code:&lt;br /&gt;
        String s = &amp;quot;Hello World&amp;quot;;&lt;br /&gt;
        Method method;&lt;br /&gt;
        try {&lt;br /&gt;
            method = s.getClass().getMethod(&amp;quot;indexOf&amp;quot;, new Class[]{String.class});&lt;br /&gt;
            Object result = method.invoke(s, &amp;quot;W&amp;quot;);&lt;br /&gt;
            System.out.println(result);&lt;br /&gt;
        }&lt;br /&gt;
        catch(NoSuchMethodException nsme) {&lt;br /&gt;
            nsme.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
        catch(IllegalAccessException iae) {&lt;br /&gt;
            iae.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
        catch(InvocationTargetException ite) {&lt;br /&gt;
            ite.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
As you can see, this requires creating arrays of Class objects to specify parameter types, and possibly casting the result of the method call from Object to the correct type. It also requires you to catch 3 possible Exceptions that may occur. Ruby's reflections mechanisms don't require exception handling. &lt;br /&gt;
&lt;br /&gt;
=== Invoke method on an instance - Ruby ===&lt;br /&gt;
In Ruby, the same method call is:&lt;br /&gt;
        &amp;quot;Hello World&amp;quot;.index(&amp;quot;W&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Using reflection, this is reduced to a simple 3 lines of code&lt;br /&gt;
        s = &amp;quot;Hello World&amp;quot;&lt;br /&gt;
        method = s.method(&amp;quot;index&amp;quot;)&lt;br /&gt;
        method.call(&amp;quot;W&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://java.sun.com/docs/books/tutorial/reflect/index.html Java Reflection Tutorial]&lt;br /&gt;
*[http://java.sun.com/javase/6/docs/api/java/lang/reflect/package-summary.html java.lang.reflect Package API]&lt;br /&gt;
*[http://java.sun.com/javase/6/docs/api/java/lang/Class.html java.lang.Class API]&lt;br /&gt;
*[http://phrogz.net/programmingruby/ospace.html Reflection, ObjectSpace, and Distributed Ruby]&lt;/div&gt;</summary>
		<author><name>Hkdavis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki1_3_ref&amp;diff=12818</id>
		<title>CSC/ECE 517 Summer 2008/wiki1 3 ref</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki1_3_ref&amp;diff=12818"/>
		<updated>2008-06-07T02:39:37Z</updated>

		<summary type="html">&lt;p&gt;Hkdavis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Reflection is built into Ruby, but in Java, it's a special API. Does this make Ruby code easier to write than Java code? Give examples of reflection sequences in both languages, and analyze which is clearer, and also, if possible, which is more efficient.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Java Reflection ==&lt;br /&gt;
 &lt;br /&gt;
The Java package for reflection is java.lang.reflect. Another important class for reflection is java.lang.Class. Java's reflection has limitations that Ruby's doesn't. An example of something Ruby can do is to iterate over all of the objects of a certain type. The ObjectSpace class in Ruby has a method each_object(), which iterates over each object that matches the type of it's parameter. &lt;br /&gt;
&lt;br /&gt;
        a = 102.7 &lt;br /&gt;
        b = 95.1 &lt;br /&gt;
        ObjectSpace.each_object(Numeric) {|x| p x }&lt;br /&gt;
&lt;br /&gt;
This prints out the value of each Numeric type object that exists in the Ruby environment. Java's reflection api doesn't provide a mechanism to iterate over Objects that you don't already have a reference to. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Ruby v. Java Example ==&lt;br /&gt;
=== List methods of a class - Java ===&lt;br /&gt;
In java, to print the names of all the methods an Object[] has, the following code is needed:&lt;br /&gt;
        Object[] objArray = new Object[]{&amp;quot;Hello World&amp;quot;};&lt;br /&gt;
        Method[] methods = objArray.getClass().getMethods();&lt;br /&gt;
        for (Method m : methods) {&lt;br /&gt;
            System.out.println(m.getName());&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
=== List methods of a class - Ruby ===&lt;br /&gt;
In Ruby, the same functionality is a single line:&lt;br /&gt;
&lt;br /&gt;
        puts Array.methods&lt;br /&gt;
&lt;br /&gt;
=== Invoke method on an instance - Java ===&lt;br /&gt;
In Java, the indexOf(String) method is used to find the index of a substring in a given String&lt;br /&gt;
        &amp;quot;Hello World&amp;quot;.indexOf(&amp;quot;W&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
To use reflection to make this method call requires the following code:&lt;br /&gt;
        String s = &amp;quot;Hello World&amp;quot;;&lt;br /&gt;
        Method method;&lt;br /&gt;
        try {&lt;br /&gt;
            method = s.getClass().getMethod(&amp;quot;indexOf&amp;quot;, new Class[]{String.class});&lt;br /&gt;
            Object result = method.invoke(s, &amp;quot;W&amp;quot;);&lt;br /&gt;
            System.out.println(result);&lt;br /&gt;
        }&lt;br /&gt;
        catch(NoSuchMethodException nsme) {&lt;br /&gt;
            nsme.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
        catch(IllegalAccessException iae) {&lt;br /&gt;
            iae.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
        catch(InvocationTargetException ite) {&lt;br /&gt;
            ite.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
As you can see, this requires creating arrays of Class objects to specify parameter types, and possibly casting the result of the method call from Object to the correct type. &lt;br /&gt;
&lt;br /&gt;
=== Invoke method on an instance - Ruby ===&lt;br /&gt;
In Ruby, the same method call is:&lt;br /&gt;
        &amp;quot;Hello World&amp;quot;.index(&amp;quot;W&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Using reflection, this is reduced to a simple 3 lines of code&lt;br /&gt;
&lt;br /&gt;
        s = &amp;quot;Hello World&amp;quot;&lt;br /&gt;
        method = s.method(&amp;quot;index&amp;quot;)&lt;br /&gt;
        method.call(&amp;quot;W&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
[http://java.sun.com/docs/books/tutorial/reflect/index.html Java Reflection Tutorial]&lt;br /&gt;
&lt;br /&gt;
[http://java.sun.com/javase/6/docs/api/java/lang/reflect/package-summary.html java.lang.reflect Package API]&lt;br /&gt;
&lt;br /&gt;
[http://java.sun.com/javase/6/docs/api/java/lang/Class.html java.lang.Class API]&lt;br /&gt;
&lt;br /&gt;
[http://phrogz.net/programmingruby/ospace.html Reflection, ObjectSpace, and Distributed Ruby]&lt;/div&gt;</summary>
		<author><name>Hkdavis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki1_3_ref&amp;diff=12816</id>
		<title>CSC/ECE 517 Summer 2008/wiki1 3 ref</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki1_3_ref&amp;diff=12816"/>
		<updated>2008-06-07T02:36:56Z</updated>

		<summary type="html">&lt;p&gt;Hkdavis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Reflection is built into Ruby, but in Java, it's a special API. Does this make Ruby code easier to write than Java code? Give examples of reflection sequences in both languages, and analyze which is clearer, and also, if possible, which is more efficient.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Java Reflection ==&lt;br /&gt;
 &lt;br /&gt;
The Java package for reflection is java.lang.reflect. Another important class for reflection is java.lang.Class. Java's reflection has limitations that Ruby's doesn't. An example of something Ruby can do is to iterate over all of the objects of a certain type. The ObjectSpace class in Ruby has a method each_object(), which iterates over each object that matches the type of it's parameter. &lt;br /&gt;
&lt;br /&gt;
        a = 102.7 &lt;br /&gt;
        b = 95.1 &lt;br /&gt;
        ObjectSpace.each_object(Numeric) {|x| p x }&lt;br /&gt;
&lt;br /&gt;
This prints out the value of each Numeric type object that exists in the Ruby environment. Java's reflection api doesn't provide a mechanism to iterate over Objects that you don't already have a reference to. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Ruby v. Java Example ==&lt;br /&gt;
 &lt;br /&gt;
In java, to print the names of all the methods an Object[] has, the following code is needed:&lt;br /&gt;
        Object[] objArray = new Object[]{&amp;quot;Hello World&amp;quot;};&lt;br /&gt;
        Method[] methods = objArray.getClass().getMethods();&lt;br /&gt;
        for (Method m : methods) {&lt;br /&gt;
            System.out.println(m.getName());&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
In Ruby, the same functionality is a single line:&lt;br /&gt;
&lt;br /&gt;
        puts Array.methods&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Java, the indexOf(String) method is used to find the index of a substring in a given String&lt;br /&gt;
        &amp;quot;Hello World&amp;quot;.indexOf(&amp;quot;W&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
To use reflection to make this method call requires the following code:&lt;br /&gt;
        String s = &amp;quot;Hello World&amp;quot;;&lt;br /&gt;
        Method method;&lt;br /&gt;
        try {&lt;br /&gt;
            method = s.getClass().getMethod(&amp;quot;indexOf&amp;quot;, new Class[]{String.class});&lt;br /&gt;
            Object result = method.invoke(s, &amp;quot;W&amp;quot;);&lt;br /&gt;
            System.out.println(result);&lt;br /&gt;
        }&lt;br /&gt;
        catch(NoSuchMethodException nsme) {&lt;br /&gt;
            nsme.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
        catch(IllegalAccessException iae) {&lt;br /&gt;
            iae.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
        catch(InvocationTargetException ite) {&lt;br /&gt;
            ite.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
As you can see, this requires creating arrays of Class objects to specify parameter types, and possibly casting the result of the method call from Object to the correct type. &lt;br /&gt;
&lt;br /&gt;
In Ruby, the same method call is:&lt;br /&gt;
        &amp;quot;Hello World&amp;quot;.index(&amp;quot;W&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Using reflection, this is reduced to a simple 3 lines of code&lt;br /&gt;
&lt;br /&gt;
        s = &amp;quot;Hello World&amp;quot;&lt;br /&gt;
        method = s.method(&amp;quot;index&amp;quot;)&lt;br /&gt;
        method.call(&amp;quot;W&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://java.sun.com/docs/books/tutorial/reflect/index.html Java reflection tutorial]&lt;br /&gt;
&lt;br /&gt;
[http://java.sun.com/javase/6/docs/api/java/lang/reflect/package-summary.html java.lang.reflect package api]&lt;br /&gt;
[http://java.sun.com/javase/6/docs/api/java/lang/Class.html java.lang.Class api]&lt;br /&gt;
[http://phrogz.net/programmingruby/ospace.html Reflection, ObjectSpace, and Distributed Ruby]&lt;/div&gt;</summary>
		<author><name>Hkdavis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki1_3_ref&amp;diff=12815</id>
		<title>CSC/ECE 517 Summer 2008/wiki1 3 ref</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki1_3_ref&amp;diff=12815"/>
		<updated>2008-06-07T02:33:14Z</updated>

		<summary type="html">&lt;p&gt;Hkdavis: /* Ruby v. Java Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Reflection is built into Ruby, but in Java, it's a special API. Does this make Ruby code easier to write than Java code? Give examples of reflection sequences in both languages, and analyze which is clearer, and also, if possible, which is more efficient.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Java Reflection ==&lt;br /&gt;
 &lt;br /&gt;
The Java package for reflection is java.lang.reflect. Another important class for reflection is java.lang.Class. Java's reflection has limitations that Ruby's doesn't. An example of something Ruby can do is to iterate over all of the objects of a certain type. The ObjectSpace class in Ruby has a method each_object(), which iterates over each object that matches the type of it's parameter. &lt;br /&gt;
&lt;br /&gt;
        a = 102.7 &lt;br /&gt;
        b = 95.1 &lt;br /&gt;
        ObjectSpace.each_object(Numeric) {|x| p x }&lt;br /&gt;
&lt;br /&gt;
This prints out the value of each Numeric type object that exists in the Ruby environment. Java's reflection api doesn't provide a mechanism to iterate over Objects that you don't already have a reference to. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Ruby v. Java Example ==&lt;br /&gt;
 &lt;br /&gt;
In java, to print the names of all the methods an Object[] has, the following code is needed:&lt;br /&gt;
        Object[] objArray = new Object[]{&amp;quot;Hello World&amp;quot;};&lt;br /&gt;
        Method[] methods = objArray.getClass().getMethods();&lt;br /&gt;
        for (Method m : methods) {&lt;br /&gt;
            System.out.println(m.getName());&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
In Ruby, the same functionality is a single line:&lt;br /&gt;
&lt;br /&gt;
        puts Array.methods&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Java, the indexOf(String) method is used to find the index of a substring in a given String&lt;br /&gt;
        &amp;quot;Hello World&amp;quot;.indexOf(&amp;quot;W&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
To use reflection to make this method call requires the following code:&lt;br /&gt;
        String s = &amp;quot;Hello World&amp;quot;;&lt;br /&gt;
        Method method;&lt;br /&gt;
        try {&lt;br /&gt;
            method = s.getClass().getMethod(&amp;quot;indexOf&amp;quot;, new Class[]{String.class});&lt;br /&gt;
            Object result = method.invoke(s, &amp;quot;W&amp;quot;);&lt;br /&gt;
            System.out.println(result);&lt;br /&gt;
        }&lt;br /&gt;
        catch(NoSuchMethodException nsme) {&lt;br /&gt;
            nsme.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
        catch(IllegalAccessException iae) {&lt;br /&gt;
            iae.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
        catch(InvocationTargetException ite) {&lt;br /&gt;
            ite.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
As you can see, this requires creating arrays of Class objects to specify parameter types, and possibly casting the result of the method call from Object to the correct type. &lt;br /&gt;
&lt;br /&gt;
In Ruby, the same method call is:&lt;br /&gt;
        &amp;quot;Hello World&amp;quot;.index(&amp;quot;W&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Using reflection, this is reduced to a simple 3 lines of code&lt;br /&gt;
&lt;br /&gt;
        s = &amp;quot;Hello World&amp;quot;&lt;br /&gt;
        method = s.method(&amp;quot;index&amp;quot;)&lt;br /&gt;
        method.call(&amp;quot;W&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://java.sun.com/docs/books/tutorial/reflect/index.html]&lt;br /&gt;
&lt;br /&gt;
http://java.sun.com/javase/6/docs/api/java/lang/reflect/package-summary.html&lt;br /&gt;
http://java.sun.com/javase/6/docs/api/java/lang/Class.html&lt;br /&gt;
http://phrogz.net/programmingruby/ospace.html&lt;/div&gt;</summary>
		<author><name>Hkdavis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki1_3_ref&amp;diff=12814</id>
		<title>CSC/ECE 517 Summer 2008/wiki1 3 ref</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki1_3_ref&amp;diff=12814"/>
		<updated>2008-06-07T02:30:31Z</updated>

		<summary type="html">&lt;p&gt;Hkdavis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Reflection is built into Ruby, but in Java, it's a special API. Does this make Ruby code easier to write than Java code? Give examples of reflection sequences in both languages, and analyze which is clearer, and also, if possible, which is more efficient.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Java Reflection ==&lt;br /&gt;
 &lt;br /&gt;
The Java package for reflection is java.lang.reflect. Another important class for reflection is java.lang.Class. Java's reflection has limitations that Ruby's doesn't. An example of something Ruby can do is to iterate over all of the objects of a certain type. The ObjectSpace class in Ruby has a method each_object(), which iterates over each object that matches the type of it's parameter. &lt;br /&gt;
&lt;br /&gt;
        a = 102.7 &lt;br /&gt;
        b = 95.1 &lt;br /&gt;
        ObjectSpace.each_object(Numeric) {|x| p x }&lt;br /&gt;
&lt;br /&gt;
This prints out the value of each Numeric type object that exists in the Ruby environment. Java's reflection api doesn't provide a mechanism to iterate over Objects that you don't already have a reference to. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Ruby v. Java Example ==&lt;br /&gt;
 &lt;br /&gt;
In java, to print the names of all the methods an Object[] has, the following code is needed:&lt;br /&gt;
        Object[] objArray = new Object[]{&amp;quot;Hello World&amp;quot;};&lt;br /&gt;
        Method[] methods = objArray.getClass().getMethods();&lt;br /&gt;
        for (Method m : methods) {&lt;br /&gt;
            System.out.println(m.getName());&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
In Ruby, the same functionality is a single line:&lt;br /&gt;
        puts Array.methods&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Java, the indexOf(String) method is used to find the index of a substring in a given String&lt;br /&gt;
&amp;quot;Hello World&amp;quot;.indexOf(&amp;quot;W&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
To use reflection to make this method call requires the following code:&lt;br /&gt;
        String s = &amp;quot;Hello World&amp;quot;;&lt;br /&gt;
        Method method;&lt;br /&gt;
        try {&lt;br /&gt;
            method = s.getClass().getMethod(&amp;quot;indexOf&amp;quot;, new Class[]{String.class});&lt;br /&gt;
            Object result = method.invoke(s, &amp;quot;W&amp;quot;);&lt;br /&gt;
            System.out.println(result);&lt;br /&gt;
        }&lt;br /&gt;
        catch(NoSuchMethodException nsme) {&lt;br /&gt;
            nsme.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
        catch(IllegalAccessException iae) {&lt;br /&gt;
            iae.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
        catch(InvocationTargetException ite) {&lt;br /&gt;
            ite.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
As you can see, this requires creating arrays of Class objects to specify parameter types, and possibly casting the result of the method call from Object to the correct type. &lt;br /&gt;
&lt;br /&gt;
In Ruby, the same method call is:&lt;br /&gt;
&amp;quot;Hello World&amp;quot;.index(&amp;quot;W&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Using reflection, this is reduced to a simple 3 lines of code&lt;br /&gt;
&lt;br /&gt;
s = &amp;quot;Hello World&amp;quot;&lt;br /&gt;
method = s.method(&amp;quot;index&amp;quot;)&lt;br /&gt;
method.call(&amp;quot;W&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://java.sun.com/docs/books/tutorial/reflect/index.html]&lt;br /&gt;
&lt;br /&gt;
http://java.sun.com/javase/6/docs/api/java/lang/reflect/package-summary.html&lt;br /&gt;
http://java.sun.com/javase/6/docs/api/java/lang/Class.html&lt;br /&gt;
http://phrogz.net/programmingruby/ospace.html&lt;/div&gt;</summary>
		<author><name>Hkdavis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki1_3_ref&amp;diff=12813</id>
		<title>CSC/ECE 517 Summer 2008/wiki1 3 ref</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki1_3_ref&amp;diff=12813"/>
		<updated>2008-06-07T02:28:44Z</updated>

		<summary type="html">&lt;p&gt;Hkdavis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Reflection is built into Ruby, but in Java, it's a special API. Does this make Ruby code easier to write than Java code? Give examples of reflection sequences in both languages, and analyze which is clearer, and also, if possible, which is more efficient.&lt;br /&gt;
&lt;br /&gt;
Java Reflection - &lt;br /&gt;
The Java package for reflection is java.lang.reflect. Another important class for reflection is java.lang.Class. Java's reflection has limitations that Ruby's doesn't. An example of something Ruby can do is to iterate over all of the objects of a certain type. The ObjectSpace class in Ruby has a method each_object(), which iterates over each object that matches the type of it's parameter. &lt;br /&gt;
&lt;br /&gt;
        a = 102.7 &lt;br /&gt;
        b = 95.1 &lt;br /&gt;
        ObjectSpace.each_object(Numeric) {|x| p x }&lt;br /&gt;
&lt;br /&gt;
This prints out the value of each Numeric type object that exists in the Ruby environment. Java's reflection api doesn't provide a mechanism to iterate over Objects that you don't already have a reference to. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ruby v. Java Example - &lt;br /&gt;
In java, to print the names of all the methods an Object[] has, the following code is needed:&lt;br /&gt;
        Object[] objArray = new Object[]{&amp;quot;Hello World&amp;quot;};&lt;br /&gt;
        Method[] methods = objArray.getClass().getMethods();&lt;br /&gt;
        for (Method m : methods) {&lt;br /&gt;
            System.out.println(m.getName());&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
In Ruby, the same functionality is a single line:&lt;br /&gt;
        puts Array.methods&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Java, the indexOf(String) method is used to find the index of a substring in a given String&lt;br /&gt;
&amp;quot;Hello World&amp;quot;.indexOf(&amp;quot;W&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
To use reflection to make this method call requires the following code:&lt;br /&gt;
        String s = &amp;quot;Hello World&amp;quot;;&lt;br /&gt;
        Method method;&lt;br /&gt;
        try {&lt;br /&gt;
            method = s.getClass().getMethod(&amp;quot;indexOf&amp;quot;, new Class[]{String.class});&lt;br /&gt;
            Object result = method.invoke(s, &amp;quot;W&amp;quot;);&lt;br /&gt;
            System.out.println(result);&lt;br /&gt;
        }&lt;br /&gt;
        catch(NoSuchMethodException nsme) {&lt;br /&gt;
            nsme.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
        catch(IllegalAccessException iae) {&lt;br /&gt;
            iae.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
        catch(InvocationTargetException ite) {&lt;br /&gt;
            ite.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
As you can see, this requires creating arrays of Class objects to specify parameter types, and possibly casting the result of the method call from Object to the correct type. &lt;br /&gt;
&lt;br /&gt;
In Ruby, the same method call is:&lt;br /&gt;
&amp;quot;Hello World&amp;quot;.index(&amp;quot;W&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Using reflection, this is reduced to a simple 3 lines of code&lt;br /&gt;
&lt;br /&gt;
s = &amp;quot;Hello World&amp;quot;&lt;br /&gt;
method = s.method(&amp;quot;index&amp;quot;)&lt;br /&gt;
method.call(&amp;quot;W&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
http://java.sun.com/docs/books/tutorial/reflect/index.html&lt;br /&gt;
&lt;br /&gt;
http://java.sun.com/javase/6/docs/api/java/lang/reflect/package-summary.html&lt;br /&gt;
http://java.sun.com/javase/6/docs/api/java/lang/Class.html&lt;br /&gt;
http://phrogz.net/programmingruby/ospace.html&lt;/div&gt;</summary>
		<author><name>Hkdavis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki1_3_ref&amp;diff=12798</id>
		<title>CSC/ECE 517 Summer 2008/wiki1 3 ref</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki1_3_ref&amp;diff=12798"/>
		<updated>2008-06-07T02:18:59Z</updated>

		<summary type="html">&lt;p&gt;Hkdavis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Reflection is built into Ruby, but in Java, it's a special API. Does this make Ruby code easier to write than Java code? Give examples of reflection sequences in both languages, and analyze which is clearer, and also, if possible, which is more efficient.&lt;br /&gt;
&lt;br /&gt;
Java Reflection - &lt;br /&gt;
The Java package for reflection is java.lang.reflect. Another important class for reflection is java.lang.Class. Java's reflection has limitations that Ruby's doesn't. An example of something Ruby can do is to iterate over all of the objects of a certain type. The ObjectSpace class in Ruby has a method each_object(), which iterates over each object that matches the type of it's parameter. &lt;br /&gt;
&lt;br /&gt;
        a = 102.7 &lt;br /&gt;
        b = 95.1 &lt;br /&gt;
        ObjectSpace.each_object(Numeric) {|x| p x }&lt;br /&gt;
&lt;br /&gt;
This prints out the value of each Numeric type object that exists in the Ruby environment. Java's reflection api doesn't provide a mechanism to iterate over Objects that you don't already have a reference to. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example - &lt;br /&gt;
In java, to print the names of all the methods an Object[] has, the following code is needed:&lt;br /&gt;
        Object[] objArray = new Object[]{&amp;quot;Hello World&amp;quot;};&lt;br /&gt;
        Method[] methods = objArray.getClass().getMethods();&lt;br /&gt;
        for (Method m : methods) {&lt;br /&gt;
            System.out.println(m.getName());&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
In Ruby, the same functionality is a single line:&lt;br /&gt;
        puts Array.methods&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this example, I use reflection to make this method call:&lt;br /&gt;
&amp;quot;Hello World&amp;quot;.indexOf(&amp;quot;W&amp;quot;);&lt;br /&gt;
which returns 6.&lt;br /&gt;
&lt;br /&gt;
        String s = &amp;quot;Hello World&amp;quot;;&lt;br /&gt;
        Method method;&lt;br /&gt;
        try {&lt;br /&gt;
            method = s.getClass().getMethod(&amp;quot;indexOf&amp;quot;, new Class[]{String.class});&lt;br /&gt;
            Object result = method.invoke(s, &amp;quot;W&amp;quot;);&lt;br /&gt;
            System.out.println(result);&lt;br /&gt;
        }&lt;br /&gt;
        catch(NoSuchMethodException nsme) {&lt;br /&gt;
            nsme.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
        catch(IllegalAccessException iae) {&lt;br /&gt;
            iae.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
        catch(InvocationTargetException ite) {&lt;br /&gt;
            ite.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
http://java.sun.com/docs/books/tutorial/reflect/index.html&lt;br /&gt;
&lt;br /&gt;
http://java.sun.com/javase/6/docs/api/java/lang/reflect/package-summary.html&lt;br /&gt;
http://java.sun.com/javase/6/docs/api/java/lang/Class.html&lt;br /&gt;
http://phrogz.net/programmingruby/ospace.html&lt;/div&gt;</summary>
		<author><name>Hkdavis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki1_3_ref&amp;diff=12783</id>
		<title>CSC/ECE 517 Summer 2008/wiki1 3 ref</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki1_3_ref&amp;diff=12783"/>
		<updated>2008-06-07T01:46:24Z</updated>

		<summary type="html">&lt;p&gt;Hkdavis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Reflection is built into Ruby, but in Java, it's a special API. Does this make Ruby code easier to write than Java code? Give examples of reflection sequences in both languages, and analyze which is clearer, and also, if possible, which is more efficient.&lt;br /&gt;
&lt;br /&gt;
Java Reflection - &lt;br /&gt;
The Java package for reflection is java.lang.reflect. Another important class for reflection is java.lang.Class. Java's reflection has limitations that Ruby's doesn't. An example of something Ruby can do is to iterate over all of the objects of a certain type. The ObjectSpace class in Ruby has a method each_object(), which iterates over each object that matches the type of it's parameter. &lt;br /&gt;
&lt;br /&gt;
a = 102.7 &lt;br /&gt;
b = 95.1 &lt;br /&gt;
ObjectSpace.each_object(Numeric) {|x| p x }&lt;br /&gt;
&lt;br /&gt;
This prints out the value of each Numeric type object that exists in the Ruby environment. Java's reflection api doesn't provide a mechanism to iterate over Objects that you don't already have a reference to. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example - &lt;br /&gt;
In java, to print the names of all the methods an Object[] has, the following code is needed:&lt;br /&gt;
        Object[] objArray = new Object[]{};&lt;br /&gt;
        Method[] methods = objArray.getClass().getMethods();&lt;br /&gt;
        for (Method m : methods) {&lt;br /&gt;
            System.out.println(m.getName());&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
In Ruby, the same functionality is a single line:&lt;br /&gt;
puts Array.methods&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
http://java.sun.com/javase/6/docs/api/java/lang/reflect/package-summary.html&lt;br /&gt;
http://java.sun.com/javase/6/docs/api/java/lang/Class.html&lt;br /&gt;
http://phrogz.net/programmingruby/ospace.html&lt;/div&gt;</summary>
		<author><name>Hkdavis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki1_3_ref&amp;diff=12774</id>
		<title>CSC/ECE 517 Summer 2008/wiki1 3 ref</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki1_3_ref&amp;diff=12774"/>
		<updated>2008-06-07T01:32:31Z</updated>

		<summary type="html">&lt;p&gt;Hkdavis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Reflection is built into Ruby, but in Java, it's a special API. Does this make Ruby code easier to write than Java code? Give examples of reflection sequences in both languages, and analyze which is clearer, and also, if possible, which is more efficient.&lt;br /&gt;
&lt;br /&gt;
Java Reflection - &lt;br /&gt;
The Java package for reflection is java.lang.reflect. Another important class for reflection is java.lang.Class. Java's reflection has limitations that Ruby's doesn't. An example of something Ruby can do is to iterate over all of the objects of a certain type. The ObjectSpace class in Ruby has a method each_object(), which iterates over each object that matches the type of it's parameter. &lt;br /&gt;
&lt;br /&gt;
   a = 102.7&lt;br /&gt;
   b = 95       # Won't be returned&lt;br /&gt;
   c = 12345678987654321&lt;br /&gt;
   count = ObjectSpace.each_object(Numeric) {|x| p x }&lt;br /&gt;
   puts &amp;quot;Total count: #{count}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This prints out the value of each Numeric type object that exists in the Ruby environment, and then the count. Java's reflection api doesn't provide a mechanism to iterate over &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
http://java.sun.com/javase/6/docs/api/java/lang/reflect/package-summary.html&lt;br /&gt;
http://java.sun.com/javase/6/docs/api/java/lang/Class.html&lt;/div&gt;</summary>
		<author><name>Hkdavis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki1_3_ref&amp;diff=12480</id>
		<title>CSC/ECE 517 Summer 2008/wiki1 3 ref</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Summer_2008/wiki1_3_ref&amp;diff=12480"/>
		<updated>2008-06-06T18:44:58Z</updated>

		<summary type="html">&lt;p&gt;Hkdavis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;placeholder&lt;/div&gt;</summary>
		<author><name>Hkdavis</name></author>
	</entry>
</feed>