<?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=Ajain9</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=Ajain9"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Ajain9"/>
	<updated>2026-09-13T03:26:21Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7a_AV&amp;diff=43471</id>
		<title>CSC/ECE 517 Fall 2010/ch7 7a AV</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7a_AV&amp;diff=43471"/>
		<updated>2010-12-12T23:55:09Z</updated>

		<summary type="html">&lt;p&gt;Ajain9: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Novel implementations of design patterns in dynamic languages=&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
&lt;br /&gt;
It is a template that provides a description of good design alternatives for the benefit of programmers. It is used to provide recurring solutions to design patterns in both static and dynamic object oriented languages. [http://www.site.uottawa.ca/school/research/lloseng/supportMaterial/slides/ 5] [http://en.wikipedia.org/wiki/Design_pattern_(computer_science)?utm_source=twitterfeed&amp;amp;utm_medium=twitter 2] &lt;br /&gt;
&lt;br /&gt;
==Importance of design patterns in programming languages==&lt;br /&gt;
&lt;br /&gt;
i.	In a given context, design patterns can be a reusable solution for a general problem. [http://sourcemaking.com/design_patterns 1]  &amp;lt;br&amp;gt;&lt;br /&gt;
ii.	For the benefit of novice programmers, design patterns are usually documented systematically. &amp;lt;br&amp;gt;&lt;br /&gt;
iii.	Design patterns help us to learn from the experience of other software developers. &amp;lt;br&amp;gt;&lt;br /&gt;
iv.	Design patterns are a framework for evolution and improvement of existing patterns. &amp;lt;br&amp;gt;&lt;br /&gt;
v.	It provides better abstraction for program organization. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How to choose a particular design pattern?==&lt;br /&gt;
&lt;br /&gt;
i.	Identify the different classes and methods for a given problem. [http://c2.com/cgi/wiki?DesignPatterns 3] &amp;lt;br&amp;gt;&lt;br /&gt;
ii.	Recognize the different solutions that can be used to solve the problem.&amp;lt;br&amp;gt;&lt;br /&gt;
iii.	Compare and contrast the trade offs between the design patterns that can be used for that particular context.&amp;lt;br&amp;gt;&lt;br /&gt;
iv.	Recognize the language limitations for each of the design patterns.&amp;lt;br&amp;gt;&lt;br /&gt;
v.	Finally choose the most suitable and efficient design.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Design patterns in dynamic programming languages=&lt;br /&gt;
&lt;br /&gt;
As dynamic languages need less overhead for bookkeeping (classes, methods) therefore design patterns are easier to use in dynamic languages. Dynamic o-o languages do not have class-restricted design, Hence design patterns are simpler and flexible. [http://www.site.uottawa.ca:4321/oose/index.html#designpattern_table 11] [http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2010/ch1_1e_az chapter1]&lt;br /&gt;
&lt;br /&gt;
Some design patterns have novel implementation in dynamic languages. The alternative ways of implementing design patterns ( such as observer, decorator, iterator) is being discussed here. [http://www.irisa.fr/prive/jezequel/enseignement/dp.pdf 4]&lt;br /&gt;
&lt;br /&gt;
=Observer Pattern=     &lt;br /&gt;
This pattern is used in the context, where frequent updates of different states take place.&lt;br /&gt;
It becomes an overhead if each object has to check whether the state has been updated or not. Hence all such objects (called the “observers”) register themselves to another object (“subject”). The subject is responsible to keep check on the object, and notify the observers when a change of state takes place. [http://c2.com/cgi/wiki?ObserverPattern 6]&lt;br /&gt;
&lt;br /&gt;
[[Image:Fig5_1.png]]&lt;br /&gt;
&lt;br /&gt;
Fig 5.1 Use Case diagram for Observer pattern &lt;br /&gt;
&lt;br /&gt;
This pattern is used in the context, where frequent updates of different states take place.&lt;br /&gt;
It becomes an overhead if each object has to check whether the state has been updated or not. Hence all such objects (called the “observers”) register themselves to another object (“subject”). The subject is responsible to keep check on the object, and notify the observers when a change of state takes place. [http://www.oreillynet.com/ruby/.../ruby_design_patterns_observer.htm 8]&lt;br /&gt;
&lt;br /&gt;
==Implementation of observer pattern in ruby==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module Observable #subject module which checks for update and notifies&lt;br /&gt;
def ModifyPrice( &amp;amp;callObservers )&lt;br /&gt;
@observers = [] &lt;br /&gt;
@observers &amp;lt;&amp;lt; callObservers&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def notify_observers&lt;br /&gt;
@observers.each { |o| o.call } &lt;br /&gt;
end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Seller             #state that is checked frequently is price.&lt;br /&gt;
include Observable&lt;br /&gt;
attr :price&lt;br /&gt;
def initialize( price = 10 )&lt;br /&gt;
@price = price&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def increasePrice       &lt;br /&gt;
@price = @price +  2.5&lt;br /&gt;
notify_observers&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
def decreasePrice&lt;br /&gt;
@price = @price -  0.5&lt;br /&gt;
notify_observers&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
StoreKeeper = Seller.new&lt;br /&gt;
StoreKeeper.ModifyPrice do        #updates price and then notifies &lt;br /&gt;
puts &amp;quot;The new price of the product is #{StoreKeeper.price}&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
StoreKeeper.increasePrice&lt;br /&gt;
StoreKeeper.decreasePrice&lt;br /&gt;
StoreKeeper.increasePrice&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Output==&lt;br /&gt;
&lt;br /&gt;
The new price of the product is 12.5&lt;br /&gt;
The new price of the product is 12.0&lt;br /&gt;
The new price of the product is 14.5&lt;br /&gt;
&lt;br /&gt;
In the above example, we have the observable module that checks if a particular state is being updated or not. When the update happens the notify function is immediately called. &lt;br /&gt;
We maintain a seller class that uses the observable module, when the seller increases or decreases the price of a product the notify_observers is called which then calls the &lt;br /&gt;
modify_price which prints the new price. &lt;br /&gt;
This program uses observer pattern in a novel way using closures which differs from its implementation in any other static language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Decorator Pattern=&lt;br /&gt;
&lt;br /&gt;
This design pattern is used when additional functionalities have to be given to a particular class in a dynamic manner. It is an alternative for subclassing and inheritance (which is done statically). The most common application of decorator patterns is in designing of GUI toolkit. [http://www.oodesign.com/decorator-pattern.html 7]&lt;br /&gt;
&lt;br /&gt;
[[Image:Fig6_1.png]]&lt;br /&gt;
&lt;br /&gt;
Fig 6.1 Use Case diagram for Observer pattern&lt;br /&gt;
&lt;br /&gt;
==Implementation of Decorator pattern in ruby==&lt;br /&gt;
&amp;lt;pre&amp;gt;	&lt;br /&gt;
module Decorator&lt;br /&gt;
 def initialize(decorated)&lt;br /&gt;
    @decorated = decorated&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SimplePizza&lt;br /&gt;
  def price&lt;br /&gt;
    @price = 5&lt;br /&gt;
     end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class OnionTopping&lt;br /&gt;
 include Decorator&lt;br /&gt;
&lt;br /&gt;
  def price&lt;br /&gt;
    @price = @decorated.price+ 1.1&lt;br /&gt;
   end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class CheeseTopping&lt;br /&gt;
  include Decorator&lt;br /&gt;
&lt;br /&gt;
  def price&lt;br /&gt;
    @decorated.price + 1.0&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#Price of Pizza without decoration(no toppings)&lt;br /&gt;
 puts &amp;quot;price of pizza without Topping #{SimplePizza.new.price}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#Price of Pizza with OnionToppings (decorater used here)&lt;br /&gt;
#initialise OnionTopping class as a decorator for the class SimplePizza&lt;br /&gt;
OTPizza =OnionTopping.new(SimplePizza.new)&lt;br /&gt;
&lt;br /&gt;
puts &amp;quot;price of pizza with OnionTopping #{OTPizza.price}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TwoTopping = CheeseTopping.new(OnionTopping.new(SimplePizza.new))&lt;br /&gt;
puts &amp;quot;price of pizza with cheese and Onion toppings #{TwoTopping.price}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==output==&lt;br /&gt;
price of pizza without Topping 5&lt;br /&gt;
price of pizza with OnionTopping 6.1&lt;br /&gt;
price of pizza with cheese and Onion toppings 7.1&lt;br /&gt;
&lt;br /&gt;
In the example above, we have a class called SimplePizza which initializes the cost of a pizza without any toppings. There might be a situation where a customer would want a pizza with a topping instead writing the price for each type of pizza. For this porpose we use decorator patterns. [http://lukeredpath.co.uk/blog/decorator-pattern-with-ruby-in-8-lines.html 9]&lt;br /&gt;
&lt;br /&gt;
Here the SimplePizza is the base class. The OnionToppingPizza and cheeseToppingPizza classes are the decorators used for this base class. This program dynamically calculates the price of each pizza depending on the choice of topping.&lt;br /&gt;
&lt;br /&gt;
Advantage:&lt;br /&gt;
Altough we dint write a class to calculate the price of a TwoToppingPizza, The decorator pattern used in this program was able to calculate the price of TwotoppingPizzza accurately.&lt;br /&gt;
&lt;br /&gt;
=Iterator pattern=&lt;br /&gt;
Iterator design pattern is used to traverse each element of a collection object sequentially. While using the iterator, the programmer need not worry about the underlying interface of the collection object.The iterator interface usually consists of  hasNext( ),next( ), isDone( ) functions. [http://www.devarticles.com/c/a/Ruby-on-Rails/Iterators-in-Ruby/ 10]&lt;br /&gt;
&lt;br /&gt;
[[Image:Fig7_1.png]]&lt;br /&gt;
&lt;br /&gt;
Fig 7.1 Use Case diagram for Iterator pattern&lt;br /&gt;
&lt;br /&gt;
==Implementation of Iterator pattern in ruby==&lt;br /&gt;
&lt;br /&gt;
===Example 1 square_arrayElements===&lt;br /&gt;
&lt;br /&gt;
This is a simple example where in an iterator each is used to print the square of each element in an array using closures. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def square_arrayElements (array)&lt;br /&gt;
    array.each {|a| puts a*a } &lt;br /&gt;
        end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;  &lt;br /&gt;
array = [1,2,3,5]&lt;br /&gt;
square_arrayElements(array)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Output:&amp;lt;br&amp;gt;&lt;br /&gt;
1&amp;lt;br&amp;gt;&lt;br /&gt;
4&amp;lt;br&amp;gt;&lt;br /&gt;
9&amp;lt;br&amp;gt;&lt;br /&gt;
25&amp;lt;br&amp;gt;&lt;br /&gt;
The array elements 1,2,3,4 is passed to the function square_arrayElements. The iterator parses each element and sends it to the block where the square of each element is calculated and prints it.&lt;br /&gt;
&lt;br /&gt;
===Example 2 EvenOrOdd ===&lt;br /&gt;
In below program, the iterator traverses through each element of the array and checks if the element is odd or even. This check is performed in the block which prints whether the given element is odd or even.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def evenOrodd(array1)&lt;br /&gt;
array1.each { |i| &lt;br /&gt;
 if i % 2 == 0&lt;br /&gt;
       puts &amp;quot;#{i} is a even number&amp;quot;&lt;br /&gt;
     else&lt;br /&gt;
       puts &amp;quot;#{i} is a odd number&amp;quot;&lt;br /&gt;
     end&lt;br /&gt;
      &lt;br /&gt;
   }&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
array1 = [1,2,3,5]&lt;br /&gt;
evenOrodd(array)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Output&amp;lt;br&amp;gt;&lt;br /&gt;
1 is a odd number&amp;lt;br&amp;gt;&lt;br /&gt;
2 is a even number&amp;lt;br&amp;gt;&lt;br /&gt;
3 is a odd number&amp;lt;br&amp;gt;&lt;br /&gt;
5 is a odd number&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=conclusion=&lt;br /&gt;
Design patterns help novice software developers to write efficient programs. The novel implementations of a few designs patterns like observer, decorator and iterator in dynamic language like Ruby was discussed above.In the observer pattern the subject notifies any updates in the state to all its dependants (observers).The decorator pattern adds extra features to the already existing class.The iterator helps to access the elements of a collection object individually. The real-world situations where each design pattern can be used were illustrated with respective examples.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
*[1]: [http://sourcemaking.com/design_patterns Design Patterns, Source Making]&lt;br /&gt;
&lt;br /&gt;
*[2]: [http://en.wikipedia.org/wiki/Design_pattern_(computer_science)?utm_source=twitterfeed&amp;amp;utm_medium=twitter Design pattern, computer_science wikipedia]&lt;br /&gt;
&lt;br /&gt;
*[3]: [http://c2.com/cgi/wiki?DesignPatterns Design Patterns wiki]&lt;br /&gt;
&lt;br /&gt;
*[4]: [http://www.irisa.fr/prive/jezequel/enseignement/dp.pdf irisa]&lt;br /&gt;
&lt;br /&gt;
*[5]: [http://www.site.uottawa.ca/school/research/lloseng/supportMaterial/slides/ Slides, uottawa]&lt;br /&gt;
&lt;br /&gt;
*[6]: [http://c2.com/cgi/wiki?ObserverPattern Observer Pattern, c2.com]&lt;br /&gt;
&lt;br /&gt;
*[7]: [http://www.oodesign.com/decorator-pattern.html Decorator Pattern, oodesign]&lt;br /&gt;
&lt;br /&gt;
*[8]: [http://www.oreillynet.com/ruby/.../ruby_design_patterns_observer.htm Ruby Design Patterns, Observer Pattern, oreillynet]&lt;br /&gt;
&lt;br /&gt;
*[9]: [http://lukeredpath.co.uk/blog/decorator-pattern-with-ruby-in-8-lines.html Decorator Pattern with Ruby, lukeredpath]&lt;br /&gt;
&lt;br /&gt;
*[10]: [http://www.devarticles.com/c/a/Ruby-on-Rails/Iterators-in-Ruby/ Iterators in Ruby, devarticles]&lt;br /&gt;
&lt;br /&gt;
*[11]: [http://www.site.uottawa.ca:4321/oose/index.html#designpattern_table uottawa]&lt;/div&gt;</summary>
		<author><name>Ajain9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7a_AV&amp;diff=43470</id>
		<title>CSC/ECE 517 Fall 2010/ch7 7a AV</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7a_AV&amp;diff=43470"/>
		<updated>2010-12-12T23:49:45Z</updated>

		<summary type="html">&lt;p&gt;Ajain9: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Novel implementations of design patterns in dynamic languages=&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
&lt;br /&gt;
It is a template that provides a description of good design alternatives for the benefit of programmers. It is used to provide recurring solutions to design patterns in both static and dynamic object oriented languages. [http://www.site.uottawa.ca/school/research/lloseng/supportMaterial/slides/ 5] [http://en.wikipedia.org/wiki/Design_pattern_(computer_science)?utm_source=twitterfeed&amp;amp;utm_medium=twitter 2]&lt;br /&gt;
&lt;br /&gt;
==Importance of design patterns in programming languages==&lt;br /&gt;
&lt;br /&gt;
i.	In a given context, design patterns can be a reusable solution for a general problem. [http://sourcemaking.com/design_patterns 1]  &amp;lt;br&amp;gt;&lt;br /&gt;
ii.	For the benefit of novice programmers, design patterns are usually documented systematically. &amp;lt;br&amp;gt;&lt;br /&gt;
iii.	Design patterns help us to learn from the experience of other software developers. &amp;lt;br&amp;gt;&lt;br /&gt;
iv.	Design patterns are a framework for evolution and improvement of existing patterns. &amp;lt;br&amp;gt;&lt;br /&gt;
v.	It provides better abstraction for program organization. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How to choose a particular design pattern?==&lt;br /&gt;
&lt;br /&gt;
i.	Identify the different classes and methods for a given problem. [http://c2.com/cgi/wiki?DesignPatterns 3] &amp;lt;br&amp;gt;&lt;br /&gt;
ii.	Recognize the different solutions that can be used to solve the problem.&amp;lt;br&amp;gt;&lt;br /&gt;
iii.	Compare and contrast the trade offs between the design patterns that can be used for that particular context.&amp;lt;br&amp;gt;&lt;br /&gt;
iv.	Recognize the language limitations for each of the design patterns.&amp;lt;br&amp;gt;&lt;br /&gt;
v.	Finally choose the most suitable and efficient design.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Design patterns in dynamic programming languages=&lt;br /&gt;
&lt;br /&gt;
As dynamic languages need less overhead for bookkeeping (classes, methods) therefore design patterns are easier to use in dynamic languages. Dynamic o-o languages do not have class-restricted design, Hence design patterns are simpler and flexible. [http://www.site.uottawa.ca:4321/oose/index.html#designpattern_table 11]&lt;br /&gt;
&lt;br /&gt;
Some design patterns have novel implementation in dynamic languages. The alternative ways of implementing design patterns ( such as observer, decorator, iterator) is being discussed here. [http://www.irisa.fr/prive/jezequel/enseignement/dp.pdf 4]&lt;br /&gt;
&lt;br /&gt;
=Observer Pattern=     &lt;br /&gt;
This pattern is used in the context, where frequent updates of different states take place.&lt;br /&gt;
It becomes an overhead if each object has to check whether the state has been updated or not. Hence all such objects (called the “observers”) register themselves to another object (“subject”). The subject is responsible to keep check on the object, and notify the observers when a change of state takes place. [http://c2.com/cgi/wiki?ObserverPattern 6]&lt;br /&gt;
&lt;br /&gt;
[[Image:Fig5_1.png]]&lt;br /&gt;
&lt;br /&gt;
Fig 5.1 Use Case diagram for Observer pattern &lt;br /&gt;
&lt;br /&gt;
This pattern is used in the context, where frequent updates of different states take place.&lt;br /&gt;
It becomes an overhead if each object has to check whether the state has been updated or not. Hence all such objects (called the “observers”) register themselves to another object (“subject”). The subject is responsible to keep check on the object, and notify the observers when a change of state takes place. [http://www.oreillynet.com/ruby/.../ruby_design_patterns_observer.htm 8]&lt;br /&gt;
&lt;br /&gt;
==Implementation of observer pattern in ruby==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module Observable #subject module which checks for update and notifies&lt;br /&gt;
def ModifyPrice( &amp;amp;callObservers )&lt;br /&gt;
@observers = [] &lt;br /&gt;
@observers &amp;lt;&amp;lt; callObservers&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def notify_observers&lt;br /&gt;
@observers.each { |o| o.call } &lt;br /&gt;
end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Seller             #state that is checked frequently is price.&lt;br /&gt;
include Observable&lt;br /&gt;
attr :price&lt;br /&gt;
def initialize( price = 10 )&lt;br /&gt;
@price = price&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def increasePrice       &lt;br /&gt;
@price = @price +  2.5&lt;br /&gt;
notify_observers&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
def decreasePrice&lt;br /&gt;
@price = @price -  0.5&lt;br /&gt;
notify_observers&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
StoreKeeper = Seller.new&lt;br /&gt;
StoreKeeper.ModifyPrice do        #updates price and then notifies &lt;br /&gt;
puts &amp;quot;The new price of the product is #{StoreKeeper.price}&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
StoreKeeper.increasePrice&lt;br /&gt;
StoreKeeper.decreasePrice&lt;br /&gt;
StoreKeeper.increasePrice&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Output==&lt;br /&gt;
&lt;br /&gt;
The new price of the product is 12.5&lt;br /&gt;
The new price of the product is 12.0&lt;br /&gt;
The new price of the product is 14.5&lt;br /&gt;
&lt;br /&gt;
In the above example, we have the observable module that checks if a particular state is being updated or not. When the update happens the notify function is immediately called. &lt;br /&gt;
We maintain a seller class that uses the observable module, when the seller increases or decreases the price of a product the notify_observers is called which then calls the &lt;br /&gt;
modify_price which prints the new price. &lt;br /&gt;
This program uses observer pattern in a novel way using closures which differs from its implementation in any other static language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Decorator Pattern=&lt;br /&gt;
&lt;br /&gt;
This design pattern is used when additional functionalities have to be given to a particular class in a dynamic manner. It is an alternative for subclassing and inheritance (which is done statically). The most common application of decorator patterns is in designing of GUI toolkit. [http://www.oodesign.com/decorator-pattern.html 7]&lt;br /&gt;
&lt;br /&gt;
[[Image:Fig6_1.png]]&lt;br /&gt;
&lt;br /&gt;
Fig 6.1 Use Case diagram for Observer pattern&lt;br /&gt;
&lt;br /&gt;
==Implementation of Decorator pattern in ruby==&lt;br /&gt;
&amp;lt;pre&amp;gt;	&lt;br /&gt;
module Decorator&lt;br /&gt;
 def initialize(decorated)&lt;br /&gt;
    @decorated = decorated&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SimplePizza&lt;br /&gt;
  def price&lt;br /&gt;
    @price = 5&lt;br /&gt;
     end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class OnionTopping&lt;br /&gt;
 include Decorator&lt;br /&gt;
&lt;br /&gt;
  def price&lt;br /&gt;
    @price = @decorated.price+ 1.1&lt;br /&gt;
   end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class CheeseTopping&lt;br /&gt;
  include Decorator&lt;br /&gt;
&lt;br /&gt;
  def price&lt;br /&gt;
    @decorated.price + 1.0&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#Price of Pizza without decoration(no toppings)&lt;br /&gt;
 puts &amp;quot;price of pizza without Topping #{SimplePizza.new.price}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#Price of Pizza with OnionToppings (decorater used here)&lt;br /&gt;
#initialise OnionTopping class as a decorator for the class SimplePizza&lt;br /&gt;
OTPizza =OnionTopping.new(SimplePizza.new)&lt;br /&gt;
&lt;br /&gt;
puts &amp;quot;price of pizza with OnionTopping #{OTPizza.price}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TwoTopping = CheeseTopping.new(OnionTopping.new(SimplePizza.new))&lt;br /&gt;
puts &amp;quot;price of pizza with cheese and Onion toppings #{TwoTopping.price}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==output==&lt;br /&gt;
price of pizza without Topping 5&lt;br /&gt;
price of pizza with OnionTopping 6.1&lt;br /&gt;
price of pizza with cheese and Onion toppings 7.1&lt;br /&gt;
&lt;br /&gt;
In the example above, we have a class called SimplePizza which initializes the cost of a pizza without any toppings. There might be a situation where a customer would want a pizza with a topping instead writing the price for each type of pizza. For this porpose we use decorator patterns. [http://lukeredpath.co.uk/blog/decorator-pattern-with-ruby-in-8-lines.html 9]&lt;br /&gt;
&lt;br /&gt;
Here the SimplePizza is the base class. The OnionToppingPizza and cheeseToppingPizza classes are the decorators used for this base class. This program dynamically calculates the price of each pizza depending on the choice of topping.&lt;br /&gt;
&lt;br /&gt;
Advantage:&lt;br /&gt;
Altough we dint write a class to calculate the price of a TwoToppingPizza, The decorator pattern used in this program was able to calculate the price of TwotoppingPizzza accurately.&lt;br /&gt;
&lt;br /&gt;
=Iterator pattern=&lt;br /&gt;
Iterator design pattern is used to traverse each element of a collection object sequentially. While using the iterator, the programmer need not worry about the underlying interface of the collection object.The iterator interface usually consists of  hasNext( ),next( ), isDone( ) functions. [http://www.devarticles.com/c/a/Ruby-on-Rails/Iterators-in-Ruby/ 10]&lt;br /&gt;
&lt;br /&gt;
[[Image:Fig7_1.png]]&lt;br /&gt;
&lt;br /&gt;
Fig 7.1 Use Case diagram for Iterator pattern&lt;br /&gt;
&lt;br /&gt;
==Implementation of Iterator pattern in ruby==&lt;br /&gt;
&lt;br /&gt;
===Example 1 square_arrayElements===&lt;br /&gt;
&lt;br /&gt;
This is a simple example where in an iterator each is used to print the square of each element in an array using closures. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def square_arrayElements (array)&lt;br /&gt;
    array.each {|a| puts a*a } &lt;br /&gt;
        end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;  &lt;br /&gt;
array = [1,2,3,5]&lt;br /&gt;
square_arrayElements(array)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Output:&amp;lt;br&amp;gt;&lt;br /&gt;
1&amp;lt;br&amp;gt;&lt;br /&gt;
4&amp;lt;br&amp;gt;&lt;br /&gt;
9&amp;lt;br&amp;gt;&lt;br /&gt;
25&amp;lt;br&amp;gt;&lt;br /&gt;
The array elements 1,2,3,4 is passed to the function square_arrayElements. The iterator parses each element and sends it to the block where the square of each element is calculated and prints it.&lt;br /&gt;
&lt;br /&gt;
===Example 2 EvenOrOdd ===&lt;br /&gt;
In below program, the iterator traverses through each element of the array and checks if the element is odd or even. This check is performed in the block which prints whether the given element is odd or even.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def evenOrodd(array1)&lt;br /&gt;
array1.each { |i| &lt;br /&gt;
 if i % 2 == 0&lt;br /&gt;
       puts &amp;quot;#{i} is a even number&amp;quot;&lt;br /&gt;
     else&lt;br /&gt;
       puts &amp;quot;#{i} is a odd number&amp;quot;&lt;br /&gt;
     end&lt;br /&gt;
      &lt;br /&gt;
   }&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
array1 = [1,2,3,5]&lt;br /&gt;
evenOrodd(array)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Output&amp;lt;br&amp;gt;&lt;br /&gt;
1 is a odd number&amp;lt;br&amp;gt;&lt;br /&gt;
2 is a even number&amp;lt;br&amp;gt;&lt;br /&gt;
3 is a odd number&amp;lt;br&amp;gt;&lt;br /&gt;
5 is a odd number&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=conclusion=&lt;br /&gt;
Design patterns help novice software developers to write efficient programs. The novel implementations of a few designs patterns like observer, decorator and iterator in dynamic language like Ruby was discussed above.In the observer pattern the subject notifies any updates in the state to all its dependants (observers).The decorator pattern adds extra features to the already existing class.The iterator helps to access the elements of a collection object individually. The real-world situations where each design pattern can be used were illustrated with respective examples.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
*[1]: [http://sourcemaking.com/design_patterns Design Patterns, Source Making]&lt;br /&gt;
&lt;br /&gt;
*[2]: [http://en.wikipedia.org/wiki/Design_pattern_(computer_science)?utm_source=twitterfeed&amp;amp;utm_medium=twitter Design pattern, computer_science wikipedia]&lt;br /&gt;
&lt;br /&gt;
*[3]: [http://c2.com/cgi/wiki?DesignPatterns Design Patterns wiki]&lt;br /&gt;
&lt;br /&gt;
*[4]: [http://www.irisa.fr/prive/jezequel/enseignement/dp.pdf irisa]&lt;br /&gt;
&lt;br /&gt;
*[5]: [http://www.site.uottawa.ca/school/research/lloseng/supportMaterial/slides/ Slides, uottawa]&lt;br /&gt;
&lt;br /&gt;
*[6]: [http://c2.com/cgi/wiki?ObserverPattern Observer Pattern, c2.com]&lt;br /&gt;
&lt;br /&gt;
*[7]: [http://www.oodesign.com/decorator-pattern.html Decorator Pattern, oodesign]&lt;br /&gt;
&lt;br /&gt;
*[8]: [http://www.oreillynet.com/ruby/.../ruby_design_patterns_observer.htm Ruby Design Patterns, Observer Pattern, oreillynet]&lt;br /&gt;
&lt;br /&gt;
*[9]: [http://lukeredpath.co.uk/blog/decorator-pattern-with-ruby-in-8-lines.html Decorator Pattern with Ruby, lukeredpath]&lt;br /&gt;
&lt;br /&gt;
*[10]: [http://www.devarticles.com/c/a/Ruby-on-Rails/Iterators-in-Ruby/ Iterators in Ruby, devarticles]&lt;br /&gt;
&lt;br /&gt;
*[11]: [http://www.site.uottawa.ca:4321/oose/index.html#designpattern_table uottawa]&lt;/div&gt;</summary>
		<author><name>Ajain9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7a_AV&amp;diff=43008</id>
		<title>CSC/ECE 517 Fall 2010/ch7 7a AV</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7a_AV&amp;diff=43008"/>
		<updated>2010-12-01T09:50:43Z</updated>

		<summary type="html">&lt;p&gt;Ajain9: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Novel implementations of design patterns in dynamic languages=&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
&lt;br /&gt;
It is a template that provides a description of good design alternatives for the benefit of programmers. It is used to provide recurring solutions to design patterns in both static and dynamic object oriented languages. [http://www.site.uottawa.ca/school/research/lloseng/supportMaterial/slides/ 5] [http://en.wikipedia.org/wiki/Design_pattern_(computer_science)?utm_source=twitterfeed&amp;amp;utm_medium=twitter 2]&lt;br /&gt;
&lt;br /&gt;
==Importance of design patterns in programming languages==&lt;br /&gt;
&lt;br /&gt;
i.	In a given context, design patterns can be a reusable solution for a general problem. [http://sourcemaking.com/design_patterns 1]  &amp;lt;br&amp;gt;&lt;br /&gt;
ii.	For the benefit of novice programmers, design patterns are usually documented systematically. &amp;lt;br&amp;gt;&lt;br /&gt;
iii.	Design patterns help us to learn from the experience of other software developers. &amp;lt;br&amp;gt;&lt;br /&gt;
iv.	Design patterns are a framework for evolution and improvement of existing patterns. &amp;lt;br&amp;gt;&lt;br /&gt;
v.	It provides better abstraction for program organization. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How to choose a particular design pattern?==&lt;br /&gt;
&lt;br /&gt;
i.	Identify the different classes and methods for a given problem. [http://c2.com/cgi/wiki?DesignPatterns 3] &amp;lt;br&amp;gt;&lt;br /&gt;
ii.	Recognize the different solutions that can be used to solve the problem.&amp;lt;br&amp;gt;&lt;br /&gt;
iii.	Compare and contrast the trade offs between the design patterns that can be used for that particular context.&amp;lt;br&amp;gt;&lt;br /&gt;
iv.	Recognize the language limitations for each of the design patterns.&amp;lt;br&amp;gt;&lt;br /&gt;
v.	Finally choose the most suitable and efficient design.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Design patterns in dynamic programming languages=&lt;br /&gt;
&lt;br /&gt;
As dynamic languages need less overhead for bookkeeping (classes, methods) therefore design patterns are easier to use in dynamic languages. Dynamic o-o languages do not have class-restricted design, Hence design patterns are simpler and flexible. [http://www.site.uottawa.ca:4321/oose/index.html#designpattern_table 11]&lt;br /&gt;
&lt;br /&gt;
Some design patterns have novel implementation in dynamic languages. The alternative ways of implementing design patterns ( such as observer, decorator, iterator) is being discussed here. [http://www.irisa.fr/prive/jezequel/enseignement/dp.pdf 4]&lt;br /&gt;
&lt;br /&gt;
=Observer Pattern=     &lt;br /&gt;
This pattern is used in the context, where frequent updates of different states take place.&lt;br /&gt;
It becomes an overhead if each object has to check whether the state has been updated or not. Hence all such objects (called the “observers”) register themselves to another object (“subject”). The subject is responsible to keep check on the object, and notify the observers when a change of state takes place. [http://c2.com/cgi/wiki?ObserverPattern 6]&lt;br /&gt;
&lt;br /&gt;
[[Image:Fig5_1.png]]&lt;br /&gt;
&lt;br /&gt;
Fig 5.1 Use Case diagram for Observer pattern &lt;br /&gt;
&lt;br /&gt;
This pattern is used in the context, where frequent updates of different states take place.&lt;br /&gt;
It becomes an overhead if each object has to check whether the state has been updated or not. Hence all such objects (called the “observers”) register themselves to another object (“subject”). The subject is responsible to keep check on the object, and notify the observers when a change of state takes place. [http://www.oreillynet.com/ruby/.../ruby_design_patterns_observer.htm 8]&lt;br /&gt;
&lt;br /&gt;
==Implementation of observer pattern in ruby==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module Observable #subject module which checks for update and notifies&lt;br /&gt;
def ModifyPrice( &amp;amp;callObservers )&lt;br /&gt;
@observers = [] &lt;br /&gt;
@observers &amp;lt;&amp;lt; callObservers&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def notify_observers&lt;br /&gt;
@observers.each { |o| o.call } &lt;br /&gt;
end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Seller             #state that is checked frequently is price.&lt;br /&gt;
include Observable&lt;br /&gt;
attr :price&lt;br /&gt;
def initialize( price = 10 )&lt;br /&gt;
@price = price&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def increasePrice       &lt;br /&gt;
@price = @price +  2.5&lt;br /&gt;
notify_observers&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
def decreasePrice&lt;br /&gt;
@price = @price -  0.5&lt;br /&gt;
notify_observers&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
StoreKeeper = Seller.new&lt;br /&gt;
StoreKeeper.ModifyPrice do        #updates price and then notifies &lt;br /&gt;
puts &amp;quot;The new price of the product is #{StoreKeeper.price}&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
StoreKeeper.increasePrice&lt;br /&gt;
StoreKeeper.decreasePrice&lt;br /&gt;
StoreKeeper.increasePrice&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Output==&lt;br /&gt;
&lt;br /&gt;
The new price of the product is 12.5&lt;br /&gt;
The new price of the product is 12.0&lt;br /&gt;
The new price of the product is 14.5&lt;br /&gt;
&lt;br /&gt;
In the above example, we have the observable module that checks if a particular state is being updated or not. When the update happens the notify function is immediately called. &lt;br /&gt;
We maintain a seller class that uses the observable module, when the seller increases or decreases the price of a product the notify_observers is called which then calls the &lt;br /&gt;
modify_price which prints the new price. &lt;br /&gt;
This program uses observer pattern in a novel way using closures which differs from its implementation in any other static language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Decorator Pattern=&lt;br /&gt;
&lt;br /&gt;
This design pattern is used when additional functionalities have to be given to a particular class in a dynamic manner. It is an alternative for subclassing and inheritance (which is done statically). The most common application of decorator patterns is in designing of GUI toolkit. [http://www.oodesign.com/decorator-pattern.html 7]&lt;br /&gt;
&lt;br /&gt;
[[Image:Fig6_1.png]]&lt;br /&gt;
&lt;br /&gt;
Fig 6.1 Use Case diagram for Observer pattern&lt;br /&gt;
&lt;br /&gt;
==Implementation of Decorator pattern in ruby==&lt;br /&gt;
&amp;lt;pre&amp;gt;	&lt;br /&gt;
module Decorator&lt;br /&gt;
 def initialize(decorated)&lt;br /&gt;
    @decorated = decorated&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SimplePizza&lt;br /&gt;
  def price&lt;br /&gt;
    @price = 5&lt;br /&gt;
     end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class OnionTopping&lt;br /&gt;
 include Decorator&lt;br /&gt;
&lt;br /&gt;
  def price&lt;br /&gt;
    @price = @decorated.price+ 1.1&lt;br /&gt;
   end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class CheeseTopping&lt;br /&gt;
  include Decorator&lt;br /&gt;
&lt;br /&gt;
  def price&lt;br /&gt;
    @decorated.price + 1.0&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#Price of Pizza without decoration(no toppings)&lt;br /&gt;
 puts &amp;quot;price of pizza without Topping #{SimplePizza.new.price}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#Price of Pizza with OnionToppings (decorater used here)&lt;br /&gt;
#initialise OnionTopping class as a decorator for the class SimplePizza&lt;br /&gt;
OTPizza =OnionTopping.new(SimplePizza.new)&lt;br /&gt;
&lt;br /&gt;
puts &amp;quot;price of pizza with OnionTopping #{OTPizza.price}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TwoTopping = CheeseTopping.new(OnionTopping.new(SimplePizza.new))&lt;br /&gt;
puts &amp;quot;price of pizza with cheese and Onion toppings #{TwoTopping.price}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==output==&lt;br /&gt;
price of pizza without Topping 5&lt;br /&gt;
price of pizza with OnionTopping 6.1&lt;br /&gt;
price of pizza with cheese and Onion toppings 7.1&lt;br /&gt;
&lt;br /&gt;
In the example above, we have a class called SimplePizza which initializes the cost of a pizza without any toppings. There might be a situation where a customer would want a pizza with a topping instead writing the price for each type of pizza. For this porpose we use decorator patterns. [http://lukeredpath.co.uk/blog/decorator-pattern-with-ruby-in-8-lines.html 9]&lt;br /&gt;
&lt;br /&gt;
Here the SimplePizza is the base class. The OnionToppingPizza and cheeseToppingPizza classes are the decorators used for this base class. This program dynamically calculates the price of each pizza depending on the choice of topping.&lt;br /&gt;
&lt;br /&gt;
Advantage:&lt;br /&gt;
Altough we dint write a class to calculate the price of a TwoToppingPizza, The decorator pattern used in this program was able to calculate the price of TwotoppingPizzza accurately.&lt;br /&gt;
&lt;br /&gt;
=Iterator pattern=&lt;br /&gt;
Iterator design pattern is used to traverse each element of a collection object sequentially. While using the iterator, the programmer need not worry about the underlying interface of the collection object.The iterator interface usually consists of  hasNext( ),next( ), isDone( ) functions. [http://www.devarticles.com/c/a/Ruby-on-Rails/Iterators-in-Ruby/ 10]&lt;br /&gt;
&lt;br /&gt;
[[Image:Fig7_1.png]]&lt;br /&gt;
&lt;br /&gt;
Fig 7.1 Use Case diagram for Iterator pattern&lt;br /&gt;
&lt;br /&gt;
==Implementation of Iterator pattern in ruby==&lt;br /&gt;
&lt;br /&gt;
===Example 1 - square_arrayElements===&lt;br /&gt;
&lt;br /&gt;
This is a simple example where in an iterator each is used to print the square of each element in an array using closures. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def square_arrayElements (array)&lt;br /&gt;
    array.each {|a| puts a*a } &lt;br /&gt;
        end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;  &lt;br /&gt;
array = [1,2,3,5]&lt;br /&gt;
square_arrayElements(array)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Output:&amp;lt;br&amp;gt;&lt;br /&gt;
1&amp;lt;br&amp;gt;&lt;br /&gt;
4&amp;lt;br&amp;gt;&lt;br /&gt;
9&amp;lt;br&amp;gt;&lt;br /&gt;
25&amp;lt;br&amp;gt;&lt;br /&gt;
The array elements 1,2,3,4 is passed to the function square_arrayElements. The iterator parses each element and sends it to the block where the square of each element is calculated and prints it.&lt;br /&gt;
&lt;br /&gt;
===Example 2 EvenOrOdd ===&lt;br /&gt;
In below program, the iterator traverses through each element of the array and checks if the element is odd or even. This check is performed in the block which prints whether the given element is odd or even.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def evenOrodd(array1)&lt;br /&gt;
array1.each { |i| &lt;br /&gt;
 if i % 2 == 0&lt;br /&gt;
       puts &amp;quot;#{i} is a even number&amp;quot;&lt;br /&gt;
     else&lt;br /&gt;
       puts &amp;quot;#{i} is a odd number&amp;quot;&lt;br /&gt;
     end&lt;br /&gt;
      &lt;br /&gt;
   }&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
array1 = [1,2,3,5]&lt;br /&gt;
evenOrodd(array)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Output&amp;lt;br&amp;gt;&lt;br /&gt;
1 is a odd number&amp;lt;br&amp;gt;&lt;br /&gt;
2 is a even number&amp;lt;br&amp;gt;&lt;br /&gt;
3 is a odd number&amp;lt;br&amp;gt;&lt;br /&gt;
5 is a odd number&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=conclusion=&lt;br /&gt;
Design patterns help novice software developers to write efficient programs. The novel implementations of a few designs patterns like observer, decorator and iterator in dynamic language like Ruby was discussed above.In the observer pattern the subject notifies any updates in the state to all its dependants (observers).The decorator pattern adds extra features to the already existing class.The iterator helps to access the elements of a collection object individually. The real-world situations where each design pattern can be used were illustrated with respective examples.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
*[1]: [http://sourcemaking.com/design_patterns Design Patterns (Source Making)]&lt;br /&gt;
&lt;br /&gt;
*[2]: [http://en.wikipedia.org/wiki/Design_pattern_(computer_science)?utm_source=twitterfeed&amp;amp;utm_medium=twitter Design pattern (computer_science) wikipedia.org]&lt;br /&gt;
&lt;br /&gt;
*[3]: [http://c2.com/cgi/wiki?DesignPatterns Design Patterns wiki]&lt;br /&gt;
&lt;br /&gt;
*[4]: [http://www.irisa.fr/prive/jezequel/enseignement/dp.pdf irisa.fr]&lt;br /&gt;
&lt;br /&gt;
*[5]: [http://www.site.uottawa.ca/school/research/lloseng/supportMaterial/slides/ Slides, uottawa.ca]&lt;br /&gt;
&lt;br /&gt;
*[6]: [http://c2.com/cgi/wiki?ObserverPattern Observer Pattern, c2.com]&lt;br /&gt;
&lt;br /&gt;
*[7]: [http://www.oodesign.com/decorator-pattern.html Decorator Pattern, oodesign.com]&lt;br /&gt;
&lt;br /&gt;
*[8]: [http://www.oreillynet.com/ruby/.../ruby_design_patterns_observer.htm Ruby Design Patterns, Observer Pattern, oreillynet.com]&lt;br /&gt;
&lt;br /&gt;
*[9]: [http://lukeredpath.co.uk/blog/decorator-pattern-with-ruby-in-8-lines.html Decorator Pattern with Ruby, lukeredpath.co.uk]&lt;br /&gt;
&lt;br /&gt;
*[10]: [http://www.devarticles.com/c/a/Ruby-on-Rails/Iterators-in-Ruby/ Iterators in Ruby, devarticles.com]&lt;br /&gt;
&lt;br /&gt;
*[11]: [http://www.site.uottawa.ca:4321/oose/index.html#designpattern_table uottawa.ca]&lt;/div&gt;</summary>
		<author><name>Ajain9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7a_AV&amp;diff=43007</id>
		<title>CSC/ECE 517 Fall 2010/ch7 7a AV</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7a_AV&amp;diff=43007"/>
		<updated>2010-12-01T09:50:03Z</updated>

		<summary type="html">&lt;p&gt;Ajain9: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Novel implementations of design patterns in dynamic languages=&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
&lt;br /&gt;
It is a template that provides a description of good design alternatives for the benefit of programmers. It is used to provide recurring solutions to design patterns in both static and dynamic object oriented languages. [http://www.site.uottawa.ca/school/research/lloseng/supportMaterial/slides/ 5] [http://en.wikipedia.org/wiki/Design_pattern_(computer_science)?utm_source=twitterfeed&amp;amp;utm_medium=twitter 2]&lt;br /&gt;
&lt;br /&gt;
==Importance of design patterns in programming languages==&lt;br /&gt;
&lt;br /&gt;
i.	In a given context, design patterns can be a reusable solution for a general problem.&amp;lt;br&amp;gt; [http://sourcemaking.com/design_patterns 1]  &lt;br /&gt;
ii.	For the benefit of novice programmers, design patterns are usually documented systematically. &amp;lt;br&amp;gt;&lt;br /&gt;
iii.	Design patterns help us to learn from the experience of other software developers. &amp;lt;br&amp;gt;&lt;br /&gt;
iv.	Design patterns are a framework for evolution and improvement of existing patterns. &amp;lt;br&amp;gt;&lt;br /&gt;
v.	It provides better abstraction for program organization. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How to choose a particular design pattern?==&lt;br /&gt;
&lt;br /&gt;
i.	Identify the different classes and methods for a given problem.&amp;lt;br&amp;gt; [http://c2.com/cgi/wiki?DesignPatterns 3]&lt;br /&gt;
ii.	Recognize the different solutions that can be used to solve the problem.&amp;lt;br&amp;gt;&lt;br /&gt;
iii.	Compare and contrast the trade offs between the design patterns that can be used for that particular context.&amp;lt;br&amp;gt;&lt;br /&gt;
iv.	Recognize the language limitations for each of the design patterns.&amp;lt;br&amp;gt;&lt;br /&gt;
v.	Finally choose the most suitable and efficient design.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Design patterns in dynamic programming languages=&lt;br /&gt;
&lt;br /&gt;
As dynamic languages need less overhead for bookkeeping (classes, methods) therefore design patterns are easier to use in dynamic languages. Dynamic o-o languages do not have class-restricted design, Hence design patterns are simpler and flexible. [http://www.site.uottawa.ca:4321/oose/index.html#designpattern_table 11]&lt;br /&gt;
&lt;br /&gt;
Some design patterns have novel implementation in dynamic languages. The alternative ways of implementing design patterns ( such as observer, decorator, iterator) is being discussed here. [http://www.irisa.fr/prive/jezequel/enseignement/dp.pdf 4]&lt;br /&gt;
&lt;br /&gt;
=Observer Pattern=     &lt;br /&gt;
This pattern is used in the context, where frequent updates of different states take place.&lt;br /&gt;
It becomes an overhead if each object has to check whether the state has been updated or not. Hence all such objects (called the “observers”) register themselves to another object (“subject”). The subject is responsible to keep check on the object, and notify the observers when a change of state takes place. [http://c2.com/cgi/wiki?ObserverPattern 6]&lt;br /&gt;
&lt;br /&gt;
[[Image:Fig5_1.png]]&lt;br /&gt;
&lt;br /&gt;
Fig 5.1 Use Case diagram for Observer pattern &lt;br /&gt;
&lt;br /&gt;
This pattern is used in the context, where frequent updates of different states take place.&lt;br /&gt;
It becomes an overhead if each object has to check whether the state has been updated or not. Hence all such objects (called the “observers”) register themselves to another object (“subject”). The subject is responsible to keep check on the object, and notify the observers when a change of state takes place. [http://www.oreillynet.com/ruby/.../ruby_design_patterns_observer.htm 8]&lt;br /&gt;
&lt;br /&gt;
==Implementation of observer pattern in ruby==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module Observable #subject module which checks for update and notifies&lt;br /&gt;
def ModifyPrice( &amp;amp;callObservers )&lt;br /&gt;
@observers = [] &lt;br /&gt;
@observers &amp;lt;&amp;lt; callObservers&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def notify_observers&lt;br /&gt;
@observers.each { |o| o.call } &lt;br /&gt;
end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Seller             #state that is checked frequently is price.&lt;br /&gt;
include Observable&lt;br /&gt;
attr :price&lt;br /&gt;
def initialize( price = 10 )&lt;br /&gt;
@price = price&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def increasePrice       &lt;br /&gt;
@price = @price +  2.5&lt;br /&gt;
notify_observers&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
def decreasePrice&lt;br /&gt;
@price = @price -  0.5&lt;br /&gt;
notify_observers&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
StoreKeeper = Seller.new&lt;br /&gt;
StoreKeeper.ModifyPrice do        #updates price and then notifies &lt;br /&gt;
puts &amp;quot;The new price of the product is #{StoreKeeper.price}&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
StoreKeeper.increasePrice&lt;br /&gt;
StoreKeeper.decreasePrice&lt;br /&gt;
StoreKeeper.increasePrice&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Output==&lt;br /&gt;
&lt;br /&gt;
The new price of the product is 12.5&lt;br /&gt;
The new price of the product is 12.0&lt;br /&gt;
The new price of the product is 14.5&lt;br /&gt;
&lt;br /&gt;
In the above example, we have the observable module that checks if a particular state is being updated or not. When the update happens the notify function is immediately called. &lt;br /&gt;
We maintain a seller class that uses the observable module, when the seller increases or decreases the price of a product the notify_observers is called which then calls the &lt;br /&gt;
modify_price which prints the new price. &lt;br /&gt;
This program uses observer pattern in a novel way using closures which differs from its implementation in any other static language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Decorator Pattern=&lt;br /&gt;
&lt;br /&gt;
This design pattern is used when additional functionalities have to be given to a particular class in a dynamic manner. It is an alternative for subclassing and inheritance (which is done statically). The most common application of decorator patterns is in designing of GUI toolkit. [http://www.oodesign.com/decorator-pattern.html 7]&lt;br /&gt;
&lt;br /&gt;
[[Image:Fig6_1.png]]&lt;br /&gt;
&lt;br /&gt;
Fig 6.1 Use Case diagram for Observer pattern&lt;br /&gt;
&lt;br /&gt;
==Implementation of Decorator pattern in ruby==&lt;br /&gt;
&amp;lt;pre&amp;gt;	&lt;br /&gt;
module Decorator&lt;br /&gt;
 def initialize(decorated)&lt;br /&gt;
    @decorated = decorated&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SimplePizza&lt;br /&gt;
  def price&lt;br /&gt;
    @price = 5&lt;br /&gt;
     end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class OnionTopping&lt;br /&gt;
 include Decorator&lt;br /&gt;
&lt;br /&gt;
  def price&lt;br /&gt;
    @price = @decorated.price+ 1.1&lt;br /&gt;
   end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class CheeseTopping&lt;br /&gt;
  include Decorator&lt;br /&gt;
&lt;br /&gt;
  def price&lt;br /&gt;
    @decorated.price + 1.0&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#Price of Pizza without decoration(no toppings)&lt;br /&gt;
 puts &amp;quot;price of pizza without Topping #{SimplePizza.new.price}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#Price of Pizza with OnionToppings (decorater used here)&lt;br /&gt;
#initialise OnionTopping class as a decorator for the class SimplePizza&lt;br /&gt;
OTPizza =OnionTopping.new(SimplePizza.new)&lt;br /&gt;
&lt;br /&gt;
puts &amp;quot;price of pizza with OnionTopping #{OTPizza.price}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TwoTopping = CheeseTopping.new(OnionTopping.new(SimplePizza.new))&lt;br /&gt;
puts &amp;quot;price of pizza with cheese and Onion toppings #{TwoTopping.price}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==output==&lt;br /&gt;
price of pizza without Topping 5&lt;br /&gt;
price of pizza with OnionTopping 6.1&lt;br /&gt;
price of pizza with cheese and Onion toppings 7.1&lt;br /&gt;
&lt;br /&gt;
In the example above, we have a class called SimplePizza which initializes the cost of a pizza without any toppings. There might be a situation where a customer would want a pizza with a topping instead writing the price for each type of pizza. For this porpose we use decorator patterns. [http://lukeredpath.co.uk/blog/decorator-pattern-with-ruby-in-8-lines.html 9]&lt;br /&gt;
&lt;br /&gt;
Here the SimplePizza is the base class. The OnionToppingPizza and cheeseToppingPizza classes are the decorators used for this base class. This program dynamically calculates the price of each pizza depending on the choice of topping.&lt;br /&gt;
&lt;br /&gt;
Advantage:&lt;br /&gt;
Altough we dint write a class to calculate the price of a TwoToppingPizza, The decorator pattern used in this program was able to calculate the price of TwotoppingPizzza accurately.&lt;br /&gt;
&lt;br /&gt;
=Iterator pattern=&lt;br /&gt;
Iterator design pattern is used to traverse each element of a collection object sequentially. While using the iterator, the programmer need not worry about the underlying interface of the collection object.The iterator interface usually consists of  hasNext( ),next( ), isDone( ) functions. [http://www.devarticles.com/c/a/Ruby-on-Rails/Iterators-in-Ruby/ 10]&lt;br /&gt;
&lt;br /&gt;
[[Image:Fig7_1.png]]&lt;br /&gt;
&lt;br /&gt;
Fig 7.1 Use Case diagram for Iterator pattern&lt;br /&gt;
&lt;br /&gt;
==Implementation of Iterator pattern in ruby==&lt;br /&gt;
&lt;br /&gt;
===Example 1 - square_arrayElements===&lt;br /&gt;
&lt;br /&gt;
This is a simple example where in an iterator each is used to print the square of each element in an array using closures. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def square_arrayElements (array)&lt;br /&gt;
    array.each {|a| puts a*a } &lt;br /&gt;
        end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;  &lt;br /&gt;
array = [1,2,3,5]&lt;br /&gt;
square_arrayElements(array)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Output:&amp;lt;br&amp;gt;&lt;br /&gt;
1&amp;lt;br&amp;gt;&lt;br /&gt;
4&amp;lt;br&amp;gt;&lt;br /&gt;
9&amp;lt;br&amp;gt;&lt;br /&gt;
25&amp;lt;br&amp;gt;&lt;br /&gt;
The array elements 1,2,3,4 is passed to the function square_arrayElements. The iterator parses each element and sends it to the block where the square of each element is calculated and prints it.&lt;br /&gt;
&lt;br /&gt;
===Example 2 EvenOrOdd ===&lt;br /&gt;
In below program, the iterator traverses through each element of the array and checks if the element is odd or even. This check is performed in the block which prints whether the given element is odd or even.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def evenOrodd(array1)&lt;br /&gt;
array1.each { |i| &lt;br /&gt;
 if i % 2 == 0&lt;br /&gt;
       puts &amp;quot;#{i} is a even number&amp;quot;&lt;br /&gt;
     else&lt;br /&gt;
       puts &amp;quot;#{i} is a odd number&amp;quot;&lt;br /&gt;
     end&lt;br /&gt;
      &lt;br /&gt;
   }&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
array1 = [1,2,3,5]&lt;br /&gt;
evenOrodd(array)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Output&amp;lt;br&amp;gt;&lt;br /&gt;
1 is a odd number&amp;lt;br&amp;gt;&lt;br /&gt;
2 is a even number&amp;lt;br&amp;gt;&lt;br /&gt;
3 is a odd number&amp;lt;br&amp;gt;&lt;br /&gt;
5 is a odd number&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=conclusion=&lt;br /&gt;
Design patterns help novice software developers to write efficient programs. The novel implementations of a few designs patterns like observer, decorator and iterator in dynamic language like Ruby was discussed above.In the observer pattern the subject notifies any updates in the state to all its dependants (observers).The decorator pattern adds extra features to the already existing class.The iterator helps to access the elements of a collection object individually. The real-world situations where each design pattern can be used were illustrated with respective examples.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
*[1]: [http://sourcemaking.com/design_patterns Design Patterns (Source Making)]&lt;br /&gt;
&lt;br /&gt;
*[2]: [http://en.wikipedia.org/wiki/Design_pattern_(computer_science)?utm_source=twitterfeed&amp;amp;utm_medium=twitter Design pattern (computer_science) wikipedia.org]&lt;br /&gt;
&lt;br /&gt;
*[3]: [http://c2.com/cgi/wiki?DesignPatterns Design Patterns wiki]&lt;br /&gt;
&lt;br /&gt;
*[4]: [http://www.irisa.fr/prive/jezequel/enseignement/dp.pdf irisa.fr]&lt;br /&gt;
&lt;br /&gt;
*[5]: [http://www.site.uottawa.ca/school/research/lloseng/supportMaterial/slides/ Slides, uottawa.ca]&lt;br /&gt;
&lt;br /&gt;
*[6]: [http://c2.com/cgi/wiki?ObserverPattern Observer Pattern, c2.com]&lt;br /&gt;
&lt;br /&gt;
*[7]: [http://www.oodesign.com/decorator-pattern.html Decorator Pattern, oodesign.com]&lt;br /&gt;
&lt;br /&gt;
*[8]: [http://www.oreillynet.com/ruby/.../ruby_design_patterns_observer.htm Ruby Design Patterns, Observer Pattern, oreillynet.com]&lt;br /&gt;
&lt;br /&gt;
*[9]: [http://lukeredpath.co.uk/blog/decorator-pattern-with-ruby-in-8-lines.html Decorator Pattern with Ruby, lukeredpath.co.uk]&lt;br /&gt;
&lt;br /&gt;
*[10]: [http://www.devarticles.com/c/a/Ruby-on-Rails/Iterators-in-Ruby/ Iterators in Ruby, devarticles.com]&lt;br /&gt;
&lt;br /&gt;
*[11]: [http://www.site.uottawa.ca:4321/oose/index.html#designpattern_table uottawa.ca]&lt;/div&gt;</summary>
		<author><name>Ajain9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7a_AV&amp;diff=43006</id>
		<title>CSC/ECE 517 Fall 2010/ch7 7a AV</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7a_AV&amp;diff=43006"/>
		<updated>2010-12-01T09:48:11Z</updated>

		<summary type="html">&lt;p&gt;Ajain9: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Novel implementations of design patterns in dynamic languages=&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
&lt;br /&gt;
It is a template that provides a description of good design alternatives for the benefit of programmers. It is used to provide recurring solutions to design patterns in both static and dynamic object oriented languages. [http://sourcemaking.com/design_patterns 1] [http://c2.com/cgi/wiki?DesignPatterns 3] [http://www.site.uottawa.ca/school/research/lloseng/supportMaterial/slides/ 5] [http://en.wikipedia.org/wiki/Design_pattern_(computer_science)?utm_source=twitterfeed&amp;amp;utm_medium=twitter 2]&lt;br /&gt;
&lt;br /&gt;
==Importance of design patterns in programming languages==&lt;br /&gt;
&lt;br /&gt;
i.	In a given context, design patterns can be a reusable solution for a general problem.&amp;lt;br&amp;gt;&lt;br /&gt;
ii.	For the benefit of novice programmers, design patterns are usually documented systematically. &amp;lt;br&amp;gt;&lt;br /&gt;
iii.	Design patterns help us to learn from the experience of other software developers. &amp;lt;br&amp;gt;&lt;br /&gt;
iv.	Design patterns are a framework for evolution and improvement of existing patterns. &amp;lt;br&amp;gt;&lt;br /&gt;
v.	It provides better abstraction for program organization. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How to choose a particular design pattern?==&lt;br /&gt;
&lt;br /&gt;
i.	Identify the different classes and methods for a given problem.&amp;lt;br&amp;gt;&lt;br /&gt;
ii.	Recognize the different solutions that can be used to solve the problem.&amp;lt;br&amp;gt;&lt;br /&gt;
iii.	Compare and contrast the trade offs between the design patterns that can be used for that particular context.&amp;lt;br&amp;gt;&lt;br /&gt;
iv.	Recognize the language limitations for each of the design patterns.&amp;lt;br&amp;gt;&lt;br /&gt;
v.	Finally choose the most suitable and efficient design.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Design patterns in dynamic programming languages=&lt;br /&gt;
&lt;br /&gt;
As dynamic languages need less overhead for bookkeeping (classes, methods) therefore design patterns are easier to use in dynamic languages. Dynamic o-o languages do not have class-restricted design, Hence design patterns are simpler and flexible. [http://www.site.uottawa.ca:4321/oose/index.html#designpattern_table 11]&lt;br /&gt;
&lt;br /&gt;
Some design patterns have novel implementation in dynamic languages. The alternative ways of implementing design patterns ( such as observer, decorator, iterator) is being discussed here. [http://www.irisa.fr/prive/jezequel/enseignement/dp.pdf 4]&lt;br /&gt;
&lt;br /&gt;
=Observer Pattern=     &lt;br /&gt;
This pattern is used in the context, where frequent updates of different states take place.&lt;br /&gt;
It becomes an overhead if each object has to check whether the state has been updated or not. Hence all such objects (called the “observers”) register themselves to another object (“subject”). The subject is responsible to keep check on the object, and notify the observers when a change of state takes place. [http://c2.com/cgi/wiki?ObserverPattern 6]&lt;br /&gt;
&lt;br /&gt;
[[Image:Fig5_1.png]]&lt;br /&gt;
&lt;br /&gt;
Fig 5.1 Use Case diagram for Observer pattern &lt;br /&gt;
&lt;br /&gt;
This pattern is used in the context, where frequent updates of different states take place.&lt;br /&gt;
It becomes an overhead if each object has to check whether the state has been updated or not. Hence all such objects (called the “observers”) register themselves to another object (“subject”). The subject is responsible to keep check on the object, and notify the observers when a change of state takes place. [http://www.oreillynet.com/ruby/.../ruby_design_patterns_observer.htm 8]&lt;br /&gt;
&lt;br /&gt;
==Implementation of observer pattern in ruby==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module Observable #subject module which checks for update and notifies&lt;br /&gt;
def ModifyPrice( &amp;amp;callObservers )&lt;br /&gt;
@observers = [] &lt;br /&gt;
@observers &amp;lt;&amp;lt; callObservers&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def notify_observers&lt;br /&gt;
@observers.each { |o| o.call } &lt;br /&gt;
end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Seller             #state that is checked frequently is price.&lt;br /&gt;
include Observable&lt;br /&gt;
attr :price&lt;br /&gt;
def initialize( price = 10 )&lt;br /&gt;
@price = price&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def increasePrice       &lt;br /&gt;
@price = @price +  2.5&lt;br /&gt;
notify_observers&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
def decreasePrice&lt;br /&gt;
@price = @price -  0.5&lt;br /&gt;
notify_observers&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
StoreKeeper = Seller.new&lt;br /&gt;
StoreKeeper.ModifyPrice do        #updates price and then notifies &lt;br /&gt;
puts &amp;quot;The new price of the product is #{StoreKeeper.price}&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
StoreKeeper.increasePrice&lt;br /&gt;
StoreKeeper.decreasePrice&lt;br /&gt;
StoreKeeper.increasePrice&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Output==&lt;br /&gt;
&lt;br /&gt;
The new price of the product is 12.5&lt;br /&gt;
The new price of the product is 12.0&lt;br /&gt;
The new price of the product is 14.5&lt;br /&gt;
&lt;br /&gt;
In the above example, we have the observable module that checks if a particular state is being updated or not. When the update happens the notify function is immediately called. &lt;br /&gt;
We maintain a seller class that uses the observable module, when the seller increases or decreases the price of a product the notify_observers is called which then calls the &lt;br /&gt;
modify_price which prints the new price. &lt;br /&gt;
This program uses observer pattern in a novel way using closures which differs from its implementation in any other static language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Decorator Pattern=&lt;br /&gt;
&lt;br /&gt;
This design pattern is used when additional functionalities have to be given to a particular class in a dynamic manner. It is an alternative for subclassing and inheritance (which is done statically). The most common application of decorator patterns is in designing of GUI toolkit. [http://www.oodesign.com/decorator-pattern.html 7]&lt;br /&gt;
&lt;br /&gt;
[[Image:Fig6_1.png]]&lt;br /&gt;
&lt;br /&gt;
Fig 6.1 Use Case diagram for Observer pattern&lt;br /&gt;
&lt;br /&gt;
==Implementation of Decorator pattern in ruby==&lt;br /&gt;
&amp;lt;pre&amp;gt;	&lt;br /&gt;
module Decorator&lt;br /&gt;
 def initialize(decorated)&lt;br /&gt;
    @decorated = decorated&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SimplePizza&lt;br /&gt;
  def price&lt;br /&gt;
    @price = 5&lt;br /&gt;
     end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class OnionTopping&lt;br /&gt;
 include Decorator&lt;br /&gt;
&lt;br /&gt;
  def price&lt;br /&gt;
    @price = @decorated.price+ 1.1&lt;br /&gt;
   end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class CheeseTopping&lt;br /&gt;
  include Decorator&lt;br /&gt;
&lt;br /&gt;
  def price&lt;br /&gt;
    @decorated.price + 1.0&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#Price of Pizza without decoration(no toppings)&lt;br /&gt;
 puts &amp;quot;price of pizza without Topping #{SimplePizza.new.price}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#Price of Pizza with OnionToppings (decorater used here)&lt;br /&gt;
#initialise OnionTopping class as a decorator for the class SimplePizza&lt;br /&gt;
OTPizza =OnionTopping.new(SimplePizza.new)&lt;br /&gt;
&lt;br /&gt;
puts &amp;quot;price of pizza with OnionTopping #{OTPizza.price}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TwoTopping = CheeseTopping.new(OnionTopping.new(SimplePizza.new))&lt;br /&gt;
puts &amp;quot;price of pizza with cheese and Onion toppings #{TwoTopping.price}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==output==&lt;br /&gt;
price of pizza without Topping 5&lt;br /&gt;
price of pizza with OnionTopping 6.1&lt;br /&gt;
price of pizza with cheese and Onion toppings 7.1&lt;br /&gt;
&lt;br /&gt;
In the example above, we have a class called SimplePizza which initializes the cost of a pizza without any toppings. There might be a situation where a customer would want a pizza with a topping instead writing the price for each type of pizza. For this porpose we use decorator patterns. [http://lukeredpath.co.uk/blog/decorator-pattern-with-ruby-in-8-lines.html 9]&lt;br /&gt;
&lt;br /&gt;
Here the SimplePizza is the base class. The OnionToppingPizza and cheeseToppingPizza classes are the decorators used for this base class. This program dynamically calculates the price of each pizza depending on the choice of topping.&lt;br /&gt;
&lt;br /&gt;
Advantage:&lt;br /&gt;
Altough we dint write a class to calculate the price of a TwoToppingPizza, The decorator pattern used in this program was able to calculate the price of TwotoppingPizzza accurately.&lt;br /&gt;
&lt;br /&gt;
=Iterator pattern=&lt;br /&gt;
Iterator design pattern is used to traverse each element of a collection object sequentially. While using the iterator, the programmer need not worry about the underlying interface of the collection object.The iterator interface usually consists of  hasNext( ),next( ), isDone( ) functions.&lt;br /&gt;
&lt;br /&gt;
[[Image:Fig7_1.png]]&lt;br /&gt;
&lt;br /&gt;
Fig 7.1 Use Case diagram for Iterator pattern&lt;br /&gt;
&lt;br /&gt;
==Implementation of Iterator pattern in ruby==&lt;br /&gt;
&lt;br /&gt;
===Example 1 - square_arrayElements===&lt;br /&gt;
&lt;br /&gt;
This is a simple example where in an iterator each is used to print the square of each element in an array using closures. [http://www.devarticles.com/c/a/Ruby-on-Rails/Iterators-in-Ruby/ 10]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def square_arrayElements (array)&lt;br /&gt;
    array.each {|a| puts a*a } &lt;br /&gt;
        end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;  &lt;br /&gt;
array = [1,2,3,5]&lt;br /&gt;
square_arrayElements(array)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Output:&amp;lt;br&amp;gt;&lt;br /&gt;
1&amp;lt;br&amp;gt;&lt;br /&gt;
4&amp;lt;br&amp;gt;&lt;br /&gt;
9&amp;lt;br&amp;gt;&lt;br /&gt;
25&amp;lt;br&amp;gt;&lt;br /&gt;
The array elements 1,2,3,4 is passed to the function square_arrayElements. The iterator parses each element and sends it to the block where the square of each element is calculated and prints it.&lt;br /&gt;
&lt;br /&gt;
===Example 2 EvenOrOdd ===&lt;br /&gt;
In below program, the iterator traverses through each element of the array and checks if the element is odd or even. This check is performed in the block which prints whether the given element is odd or even.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def evenOrodd(array1)&lt;br /&gt;
array1.each { |i| &lt;br /&gt;
 if i % 2 == 0&lt;br /&gt;
       puts &amp;quot;#{i} is a even number&amp;quot;&lt;br /&gt;
     else&lt;br /&gt;
       puts &amp;quot;#{i} is a odd number&amp;quot;&lt;br /&gt;
     end&lt;br /&gt;
      &lt;br /&gt;
   }&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
array1 = [1,2,3,5]&lt;br /&gt;
evenOrodd(array)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Output&amp;lt;br&amp;gt;&lt;br /&gt;
1 is a odd number&amp;lt;br&amp;gt;&lt;br /&gt;
2 is a even number&amp;lt;br&amp;gt;&lt;br /&gt;
3 is a odd number&amp;lt;br&amp;gt;&lt;br /&gt;
5 is a odd number&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=conclusion=&lt;br /&gt;
Design patterns help novice software developers to write efficient programs. The novel implementations of a few designs patterns like observer, decorator and iterator in dynamic language like Ruby was discussed above.In the observer pattern the subject notifies any updates in the state to all its dependants (observers).The decorator pattern adds extra features to the already existing class.The iterator helps to access the elements of a collection object individually. The real-world situations where each design pattern can be used were illustrated with respective examples.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
*[1]: [http://sourcemaking.com/design_patterns Design Patterns (Source Making)]&lt;br /&gt;
&lt;br /&gt;
*[2]: [http://en.wikipedia.org/wiki/Design_pattern_(computer_science)?utm_source=twitterfeed&amp;amp;utm_medium=twitter Design pattern (computer_science) wikipedia.org]&lt;br /&gt;
&lt;br /&gt;
*[3]: [http://c2.com/cgi/wiki?DesignPatterns Design Patterns wiki]&lt;br /&gt;
&lt;br /&gt;
*[4]: [http://www.irisa.fr/prive/jezequel/enseignement/dp.pdf irisa.fr]&lt;br /&gt;
&lt;br /&gt;
*[5]: [http://www.site.uottawa.ca/school/research/lloseng/supportMaterial/slides/ Slides, uottawa.ca]&lt;br /&gt;
&lt;br /&gt;
*[6]: [http://c2.com/cgi/wiki?ObserverPattern Observer Pattern, c2.com]&lt;br /&gt;
&lt;br /&gt;
*[7]: [http://www.oodesign.com/decorator-pattern.html Decorator Pattern, oodesign.com]&lt;br /&gt;
&lt;br /&gt;
*[8]: [http://www.oreillynet.com/ruby/.../ruby_design_patterns_observer.htm Ruby Design Patterns, Observer Pattern, oreillynet.com]&lt;br /&gt;
&lt;br /&gt;
*[9]: [http://lukeredpath.co.uk/blog/decorator-pattern-with-ruby-in-8-lines.html Decorator Pattern with Ruby, lukeredpath.co.uk]&lt;br /&gt;
&lt;br /&gt;
*[10]: [http://www.devarticles.com/c/a/Ruby-on-Rails/Iterators-in-Ruby/ Iterators in Ruby, devarticles.com]&lt;br /&gt;
&lt;br /&gt;
*[11]: [http://www.site.uottawa.ca:4321/oose/index.html#designpattern_table uottawa.ca]&lt;/div&gt;</summary>
		<author><name>Ajain9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7a_AV&amp;diff=43005</id>
		<title>CSC/ECE 517 Fall 2010/ch7 7a AV</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7a_AV&amp;diff=43005"/>
		<updated>2010-12-01T09:34:42Z</updated>

		<summary type="html">&lt;p&gt;Ajain9: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Novel implementations of design patterns in dynamic languages=&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
&lt;br /&gt;
It is a template that provides a description of good design alternatives for the benefit of programmers. It is used to provide recurring solutions to design patterns in both static and dynamic object oriented languages.&lt;br /&gt;
&lt;br /&gt;
==Importance of design patterns in programming languages==&lt;br /&gt;
&lt;br /&gt;
i.	In a given context, design patterns can be a reusable solution for a general problem.&amp;lt;br&amp;gt;&lt;br /&gt;
ii.	For the benefit of novice programmers, design patterns are usually documented systematically. &amp;lt;br&amp;gt;&lt;br /&gt;
iii.	Design patterns help us to learn from the experience of other software developers. &amp;lt;br&amp;gt;&lt;br /&gt;
iv.	Design patterns are a framework for evolution and improvement of existing patterns. &amp;lt;br&amp;gt;&lt;br /&gt;
v.	It provides better abstraction for program organization. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How to choose a particular design pattern?==&lt;br /&gt;
&lt;br /&gt;
i.	Identify the different classes and methods for a given problem.&amp;lt;br&amp;gt;&lt;br /&gt;
ii.	Recognize the different solutions that can be used to solve the problem.&amp;lt;br&amp;gt;&lt;br /&gt;
iii.	Compare and contrast the trade offs between the design patterns that can be used for that particular context.&amp;lt;br&amp;gt;&lt;br /&gt;
iv.	Recognize the language limitations for each of the design patterns.&amp;lt;br&amp;gt;&lt;br /&gt;
v.	Finally choose the most suitable and efficient design.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Design patterns in dynamic programming languages=&lt;br /&gt;
&lt;br /&gt;
As dynamic languages need less overhead for bookkeeping (classes, methods) therefore design patterns are easier to use in dynamic languages. Dynamic o-o languages do not have class-restricted design, Hence design patterns are simpler and flexible.&lt;br /&gt;
&lt;br /&gt;
Some design patterns have novel implementation in dynamic languages. The alternative ways of implementing design patterns ( such as observer, decorator, iterator) is being discussed here.&lt;br /&gt;
&lt;br /&gt;
=Observer Pattern=     &lt;br /&gt;
This pattern is used in the context, where frequent updates of different states take place.&lt;br /&gt;
It becomes an overhead if each object has to check whether the state has been updated or not. Hence all such objects (called the “observers”) register themselves to another object (“subject”). The subject is responsible to keep check on the object, and notify the observers when a change of state takes place.&lt;br /&gt;
&lt;br /&gt;
[[Image:Fig5_1.png]]&lt;br /&gt;
&lt;br /&gt;
Fig 5.1 Use Case diagram for Observer pattern &lt;br /&gt;
&lt;br /&gt;
This pattern is used in the context, where frequent updates of different states take place.&lt;br /&gt;
It becomes an overhead if each object has to check whether the state has been updated or not. Hence all such objects (called the “observers”) register themselves to another object (“subject”). The subject is responsible to keep check on the object, and notify the observers when a change of state takes place.&lt;br /&gt;
&lt;br /&gt;
==Implementation of observer pattern in ruby==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module Observable #subject module which checks for update and notifies&lt;br /&gt;
def ModifyPrice( &amp;amp;callObservers )&lt;br /&gt;
@observers = [] &lt;br /&gt;
@observers &amp;lt;&amp;lt; callObservers&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def notify_observers&lt;br /&gt;
@observers.each { |o| o.call } &lt;br /&gt;
end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Seller             #state that is checked frequently is price.&lt;br /&gt;
include Observable&lt;br /&gt;
attr :price&lt;br /&gt;
def initialize( price = 10 )&lt;br /&gt;
@price = price&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def increasePrice       &lt;br /&gt;
@price = @price +  2.5&lt;br /&gt;
notify_observers&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
def decreasePrice&lt;br /&gt;
@price = @price -  0.5&lt;br /&gt;
notify_observers&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
StoreKeeper = Seller.new&lt;br /&gt;
StoreKeeper.ModifyPrice do        #updates price and then notifies &lt;br /&gt;
puts &amp;quot;The new price of the product is #{StoreKeeper.price}&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
StoreKeeper.increasePrice&lt;br /&gt;
StoreKeeper.decreasePrice&lt;br /&gt;
StoreKeeper.increasePrice&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Output==&lt;br /&gt;
&lt;br /&gt;
The new price of the product is 12.5&lt;br /&gt;
The new price of the product is 12.0&lt;br /&gt;
The new price of the product is 14.5&lt;br /&gt;
&lt;br /&gt;
In the above example, we have the observable module that checks if a particular state is being updated or not. When the update happens the notify function is immediately called. &lt;br /&gt;
We maintain a seller class that uses the observable module, when the seller increases or decreases the price of a product the notify_observers is called which then calls the &lt;br /&gt;
modify_price which prints the new price. &lt;br /&gt;
This program uses observer pattern in a novel way using closures which differs from its implementation in any other static language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Decorator Pattern=&lt;br /&gt;
&lt;br /&gt;
This design pattern is used when additional functionalities have to be given to a particular class in a dynamic manner. It is an alternative for subclassing and inheritance (which is done statically). The most common application of decorator patterns is in designing of GUI toolkit.&lt;br /&gt;
&lt;br /&gt;
[[Image:Fig6_1.png]]&lt;br /&gt;
&lt;br /&gt;
Fig 6.1 Use Case diagram for Observer pattern&lt;br /&gt;
&lt;br /&gt;
==Implementation of Decorator pattern in ruby==&lt;br /&gt;
&amp;lt;pre&amp;gt;	&lt;br /&gt;
module Decorator&lt;br /&gt;
 def initialize(decorated)&lt;br /&gt;
    @decorated = decorated&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SimplePizza&lt;br /&gt;
  def price&lt;br /&gt;
    @price = 5&lt;br /&gt;
     end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class OnionTopping&lt;br /&gt;
 include Decorator&lt;br /&gt;
&lt;br /&gt;
  def price&lt;br /&gt;
    @price = @decorated.price+ 1.1&lt;br /&gt;
   end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class CheeseTopping&lt;br /&gt;
  include Decorator&lt;br /&gt;
&lt;br /&gt;
  def price&lt;br /&gt;
    @decorated.price + 1.0&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#Price of Pizza without decoration(no toppings)&lt;br /&gt;
 puts &amp;quot;price of pizza without Topping #{SimplePizza.new.price}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#Price of Pizza with OnionToppings (decorater used here)&lt;br /&gt;
#initialise OnionTopping class as a decorator for the class SimplePizza&lt;br /&gt;
OTPizza =OnionTopping.new(SimplePizza.new)&lt;br /&gt;
&lt;br /&gt;
puts &amp;quot;price of pizza with OnionTopping #{OTPizza.price}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TwoTopping = CheeseTopping.new(OnionTopping.new(SimplePizza.new))&lt;br /&gt;
puts &amp;quot;price of pizza with cheese and Onion toppings #{TwoTopping.price}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==output==&lt;br /&gt;
price of pizza without Topping 5&lt;br /&gt;
price of pizza with OnionTopping 6.1&lt;br /&gt;
price of pizza with cheese and Onion toppings 7.1&lt;br /&gt;
&lt;br /&gt;
In the example above, we have a class called SimplePizza which initializes the cost of a pizza without any toppings. There might be a situation where a customer would want a pizza with a topping instead writing the price for each type of pizza. For this porpose we use decorator patterns.&lt;br /&gt;
&lt;br /&gt;
Here the SimplePizza is the base class. The OnionToppingPizza and cheeseToppingPizza classes are the decorators used for this base class. This program dynamically calculates the price of each pizza depending on the choice of topping.&lt;br /&gt;
&lt;br /&gt;
Advantage:&lt;br /&gt;
Altough we dint write a class to calculate the price of a TwoToppingPizza, The decorator pattern used in this program was able to calculate the price of TwotoppingPizzza accurately.&lt;br /&gt;
&lt;br /&gt;
=Iterator pattern=&lt;br /&gt;
Iterator design pattern is used to traverse each element of a collection object sequentially. While using the iterator, the programmer need not worry about the underlying interface of the collection object.The iterator interface usually consists of  hasNext( ),next( ), isDone( ) functions.&lt;br /&gt;
&lt;br /&gt;
[[Image:Fig7_1.png]]&lt;br /&gt;
&lt;br /&gt;
Fig 7.1 Use Case diagram for Iterator pattern&lt;br /&gt;
&lt;br /&gt;
==Implementation of Iterator pattern in ruby==&lt;br /&gt;
&lt;br /&gt;
===Example 1 - square_arrayElements===&lt;br /&gt;
&lt;br /&gt;
This is a simple example where in an iterator each is used to print the square of each element in an array using closures.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def square_arrayElements (array)&lt;br /&gt;
    array.each {|a| puts a*a } &lt;br /&gt;
        end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;  &lt;br /&gt;
array = [1,2,3,5]&lt;br /&gt;
square_arrayElements(array)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Output:&amp;lt;br&amp;gt;&lt;br /&gt;
1&amp;lt;br&amp;gt;&lt;br /&gt;
4&amp;lt;br&amp;gt;&lt;br /&gt;
9&amp;lt;br&amp;gt;&lt;br /&gt;
25&amp;lt;br&amp;gt;&lt;br /&gt;
The array elements 1,2,3,4 is passed to the function square_arrayElements. The iterator parses each element and sends it to the block where the square of each element is calculated and prints it.&lt;br /&gt;
&lt;br /&gt;
===Example 2 EvenOrOdd ===&lt;br /&gt;
In below program, the iterator traverses through each element of the array and checks if the element is odd or even. This check is performed in the block which prints whether the given element is odd or even.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def evenOrodd(array1)&lt;br /&gt;
array1.each { |i| &lt;br /&gt;
 if i % 2 == 0&lt;br /&gt;
       puts &amp;quot;#{i} is a even number&amp;quot;&lt;br /&gt;
     else&lt;br /&gt;
       puts &amp;quot;#{i} is a odd number&amp;quot;&lt;br /&gt;
     end&lt;br /&gt;
      &lt;br /&gt;
   }&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
array1 = [1,2,3,5]&lt;br /&gt;
evenOrodd(array)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Output&amp;lt;br&amp;gt;&lt;br /&gt;
1 is a odd number&amp;lt;br&amp;gt;&lt;br /&gt;
2 is a even number&amp;lt;br&amp;gt;&lt;br /&gt;
3 is a odd number&amp;lt;br&amp;gt;&lt;br /&gt;
5 is a odd number&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=conclusion=&lt;br /&gt;
Design patterns help novice software developers to write efficient programs. The novel implementations of a few designs patterns like observer, decorator and iterator in dynamic language like Ruby was discussed above.In the observer pattern the subject notifies any updates in the state to all its dependants (observers).The decorator pattern adds extra features to the already existing class.The iterator helps to access the elements of a collection object individually. The real-world situations where each design pattern can be used were illustrated with respective examples.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
*[1]: [http://sourcemaking.com/design_patterns Design Patterns (Source Making)]&lt;br /&gt;
&lt;br /&gt;
*[2]: [http://en.wikipedia.org/wiki/Design_pattern_(computer_science)?utm_source=twitterfeed&amp;amp;utm_medium=twitter Design pattern (computer_science) wikipedia.org]&lt;br /&gt;
&lt;br /&gt;
*[3]: [http://c2.com/cgi/wiki?DesignPatterns Design Patterns wiki]&lt;br /&gt;
&lt;br /&gt;
*[4]: [http://www.irisa.fr/prive/jezequel/enseignement/dp.pdf irisa.fr]&lt;br /&gt;
&lt;br /&gt;
*[5]: [http://www.site.uottawa.ca/school/research/lloseng/supportMaterial/slides/ Slides, uottawa.ca]&lt;br /&gt;
&lt;br /&gt;
*[6]: [http://c2.com/cgi/wiki?ObserverPattern Observer Pattern, c2.com]&lt;br /&gt;
&lt;br /&gt;
*[7]: [http://www.oodesign.com/decorator-pattern.html Decorator Pattern, oodesign.com]&lt;br /&gt;
&lt;br /&gt;
*[8]: [http://www.oreillynet.com/ruby/.../ruby_design_patterns_observer.htm Ruby Design Patterns, Observer Pattern, oreillynet.com]&lt;br /&gt;
&lt;br /&gt;
*[9]: [http://lukeredpath.co.uk/blog/decorator-pattern-with-ruby-in-8-lines.html Decorator Pattern with Ruby, lukeredpath.co.uk]&lt;br /&gt;
&lt;br /&gt;
*[10]: [http://www.devarticles.com/c/a/Ruby-on-Rails/Iterators-in-Ruby/ Iterators in Ruby, devarticles.com]&lt;br /&gt;
&lt;br /&gt;
*[11]: [http://www.site.uottawa.ca:4321/oose/index.html#designpattern_table uottawa.ca]&lt;/div&gt;</summary>
		<author><name>Ajain9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7a_AV&amp;diff=43004</id>
		<title>CSC/ECE 517 Fall 2010/ch7 7a AV</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch7_7a_AV&amp;diff=43004"/>
		<updated>2010-12-01T08:55:28Z</updated>

		<summary type="html">&lt;p&gt;Ajain9: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Novel implementations of design patterns in dynamic languages=&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
&lt;br /&gt;
It is a template that provides a description of good design alternatives for the benefit of programmers. It is used to provide recurring solutions to design patterns in both static and dynamic object oriented languages.&lt;br /&gt;
&lt;br /&gt;
==Importance of design patterns in programming languages==&lt;br /&gt;
&lt;br /&gt;
i.	In a given context, design patterns can be a reusable solution for a general problem.&amp;lt;br&amp;gt;&lt;br /&gt;
ii.	For the benefit of novice programmers, design patterns are usually documented systematically. &amp;lt;br&amp;gt;&lt;br /&gt;
iii.	Design patterns help us to learn from the experience of other software developers. &amp;lt;br&amp;gt;&lt;br /&gt;
iv.	Design patterns are a framework for evolution and improvement of existing patterns. &amp;lt;br&amp;gt;&lt;br /&gt;
v.	It provides better abstraction for program organization. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How to choose a particular design pattern?==&lt;br /&gt;
&lt;br /&gt;
i.	Identify the different classes and methods for a given problem.&amp;lt;br&amp;gt;&lt;br /&gt;
ii.	Recognize the different solutions that can be used to solve the problem.&amp;lt;br&amp;gt;&lt;br /&gt;
iii.	Compare and contrast the trade offs between the design patterns that can be used for that particular context.&amp;lt;br&amp;gt;&lt;br /&gt;
iv.	Recognize the language limitations for each of the design patterns.&amp;lt;br&amp;gt;&lt;br /&gt;
v.	Finally choose the most suitable and efficient design.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Design patterns in dynamic programming languages=&lt;br /&gt;
&lt;br /&gt;
As dynamic languages need less overhead for bookkeeping (classes, methods) therefore design patterns are easier to use in dynamic languages. Dynamic o-o languages do not have class-restricted design, Hence design patterns are simpler and flexible.&lt;br /&gt;
&lt;br /&gt;
Some design patterns have novel implementation in dynamic languages. The alternative ways of implementing design patterns ( such as observer, decorator, iterator) is being discussed here.&lt;br /&gt;
&lt;br /&gt;
=Observer Pattern=     &lt;br /&gt;
This pattern is used in the context, where frequent updates of different states take place.&lt;br /&gt;
It becomes an overhead if each object has to check whether the state has been updated or not. Hence all such objects (called the “observers”) register themselves to another object (“subject”). The subject is responsible to keep check on the object, and notify the observers when a change of state takes place.&lt;br /&gt;
&lt;br /&gt;
[[Image:Fig5_1.png]]&lt;br /&gt;
&lt;br /&gt;
Fig 5.1 Use Case diagram for Observer pattern &lt;br /&gt;
&lt;br /&gt;
This pattern is used in the context, where frequent updates of different states take place.&lt;br /&gt;
It becomes an overhead if each object has to check whether the state has been updated or not. Hence all such objects (called the “observers”) register themselves to another object (“subject”). The subject is responsible to keep check on the object, and notify the observers when a change of state takes place.&lt;br /&gt;
&lt;br /&gt;
==Implementation of observer pattern in ruby==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module Observable #subject module which checks for update and notifies&lt;br /&gt;
def ModifyPrice( &amp;amp;callObservers )&lt;br /&gt;
@observers = [] &lt;br /&gt;
@observers &amp;lt;&amp;lt; callObservers&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def notify_observers&lt;br /&gt;
@observers.each { |o| o.call } &lt;br /&gt;
end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Seller             #state that is checked frequently is price.&lt;br /&gt;
include Observable&lt;br /&gt;
attr :price&lt;br /&gt;
def initialize( price = 10 )&lt;br /&gt;
@price = price&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def increasePrice       &lt;br /&gt;
@price = @price +  2.5&lt;br /&gt;
notify_observers&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
def decreasePrice&lt;br /&gt;
@price = @price -  0.5&lt;br /&gt;
notify_observers&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
StoreKeeper = Seller.new&lt;br /&gt;
StoreKeeper.ModifyPrice do        #updates price and then notifies &lt;br /&gt;
puts &amp;quot;The new price of the product is #{StoreKeeper.price}&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
StoreKeeper.increasePrice&lt;br /&gt;
StoreKeeper.decreasePrice&lt;br /&gt;
StoreKeeper.increasePrice&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Output==&lt;br /&gt;
&lt;br /&gt;
The new price of the product is 12.5&lt;br /&gt;
The new price of the product is 12.0&lt;br /&gt;
The new price of the product is 14.5&lt;br /&gt;
&lt;br /&gt;
In the above example, we have the observable module that checks if a particular state is being updated or not. When the update happens the notify function is immediately called. &lt;br /&gt;
We maintain a seller class that uses the observable module, when the seller increases or decreases the price of a product the notify_observers is called which then calls the &lt;br /&gt;
modify_price which prints the new price. &lt;br /&gt;
This program uses observer pattern in a novel way using closures which differs from its implementation in any other static language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Decorator Pattern=&lt;br /&gt;
&lt;br /&gt;
This design pattern is used when additional functionalities have to be given to a particular class in a dynamic manner. It is an alternative for subclassing and inheritance (which is done statically). The most common application of decorator patterns is in designing of GUI toolkit.&lt;br /&gt;
&lt;br /&gt;
[[Image:Fig6_1.png]]&lt;br /&gt;
&lt;br /&gt;
Fig 6.1 Use Case diagram for Observer pattern&lt;br /&gt;
&lt;br /&gt;
==Implementation of Decorator pattern in ruby==&lt;br /&gt;
&amp;lt;pre&amp;gt;	&lt;br /&gt;
module Decorator&lt;br /&gt;
 def initialize(decorated)&lt;br /&gt;
    @decorated = decorated&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SimplePizza&lt;br /&gt;
  def price&lt;br /&gt;
    @price = 5&lt;br /&gt;
     end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class OnionTopping&lt;br /&gt;
 include Decorator&lt;br /&gt;
&lt;br /&gt;
  def price&lt;br /&gt;
    @price = @decorated.price+ 1.1&lt;br /&gt;
   end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class CheeseTopping&lt;br /&gt;
  include Decorator&lt;br /&gt;
&lt;br /&gt;
  def price&lt;br /&gt;
    @decorated.price + 1.0&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#Price of Pizza without decoration(no toppings)&lt;br /&gt;
 puts &amp;quot;price of pizza without Topping #{SimplePizza.new.price}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#Price of Pizza with OnionToppings (decorater used here)&lt;br /&gt;
#initialise OnionTopping class as a decorator for the class SimplePizza&lt;br /&gt;
OTPizza =OnionTopping.new(SimplePizza.new)&lt;br /&gt;
&lt;br /&gt;
puts &amp;quot;price of pizza with OnionTopping #{OTPizza.price}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
TwoTopping = CheeseTopping.new(OnionTopping.new(SimplePizza.new))&lt;br /&gt;
puts &amp;quot;price of pizza with cheese and Onion toppings #{TwoTopping.price}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==output==&lt;br /&gt;
price of pizza without Topping 5&lt;br /&gt;
price of pizza with OnionTopping 6.1&lt;br /&gt;
price of pizza with cheese and Onion toppings 7.1&lt;br /&gt;
&lt;br /&gt;
In the example above, we have a class called SimplePizza which initializes the cost of a pizza without any toppings. There might be a situation where a customer would want a pizza with a topping instead writing the price for each type of pizza. For this porpose we use decorator patterns.&lt;br /&gt;
&lt;br /&gt;
Here the SimplePizza is the base class. The OnionToppingPizza and cheeseToppingPizza classes are the decorators used for this base class. This program dynamically calculates the price of each pizza depending on the choice of topping.&lt;br /&gt;
&lt;br /&gt;
Advantage:&lt;br /&gt;
Altough we dint write a class to calculate the price of a TwoToppingPizza, The decorator pattern used in this program was able to calculate the price of TwotoppingPizzza accurately.&lt;br /&gt;
&lt;br /&gt;
=Iterator pattern=&lt;br /&gt;
Iterator design pattern is used to traverse each element of a collection object sequentially. While using the iterator, the programmer need not worry about the underlying interface of the collection object.The iterator interface usually consists of  hasNext( ),next( ), isDone( ) functions.&lt;br /&gt;
&lt;br /&gt;
[[Image:Fig7_1.png]]&lt;br /&gt;
&lt;br /&gt;
Fig 7.1 Use Case diagram for Iterator pattern&lt;br /&gt;
&lt;br /&gt;
==Implementation of Iterator pattern in ruby==&lt;br /&gt;
&lt;br /&gt;
===Example 1 - square_arrayElements===&lt;br /&gt;
&lt;br /&gt;
This is a simple example where in an iterator each is used to print the square of each element in an array using closures.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def square_arrayElements (array)&lt;br /&gt;
    array.each {|a| puts a*a } &lt;br /&gt;
        end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;  &lt;br /&gt;
array = [1,2,3,5]&lt;br /&gt;
square_arrayElements(array)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Output:&amp;lt;br&amp;gt;&lt;br /&gt;
1&amp;lt;br&amp;gt;&lt;br /&gt;
4&amp;lt;br&amp;gt;&lt;br /&gt;
9&amp;lt;br&amp;gt;&lt;br /&gt;
25&amp;lt;br&amp;gt;&lt;br /&gt;
The array elements 1,2,3,4 is passed to the function square_arrayElements. The iterator parses each element and sends it to the block where the square of each element is calculated and prints it.&lt;br /&gt;
&lt;br /&gt;
===Example 2 EvenOrOdd ===&lt;br /&gt;
In below program, the iterator traverses through each element of the array and checks if the element is odd or even. This check is performed in the block which prints whether the given element is odd or even.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def evenOrodd(array1)&lt;br /&gt;
array1.each { |i| &lt;br /&gt;
 if i % 2 == 0&lt;br /&gt;
       puts &amp;quot;#{i} is a even number&amp;quot;&lt;br /&gt;
     else&lt;br /&gt;
       puts &amp;quot;#{i} is a odd number&amp;quot;&lt;br /&gt;
     end&lt;br /&gt;
      &lt;br /&gt;
   }&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
array1 = [1,2,3,5]&lt;br /&gt;
evenOrodd(array)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Output&amp;lt;br&amp;gt;&lt;br /&gt;
1 is a odd number&amp;lt;br&amp;gt;&lt;br /&gt;
2 is a even number&amp;lt;br&amp;gt;&lt;br /&gt;
3 is a odd number&amp;lt;br&amp;gt;&lt;br /&gt;
5 is a odd number&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=conclusion=&lt;br /&gt;
Design patterns help novice software developers to write efficient programs. The novel implementations of a few designs patterns like observer, decorator and iterator in dynamic language like Ruby was discussed above.In the observer pattern the subject notifies any updates in the state to all its dependants (observers).The decorator pattern adds extra features to the already existing class.The iterator helps to access the elements of a collection object individually. The real-world situations where each design pattern can be used were illustrated with respective examples.&lt;/div&gt;</summary>
		<author><name>Ajain9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Fig7_1.png&amp;diff=43003</id>
		<title>File:Fig7 1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Fig7_1.png&amp;diff=43003"/>
		<updated>2010-12-01T08:54:56Z</updated>

		<summary type="html">&lt;p&gt;Ajain9: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ajain9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Fig6_1.png&amp;diff=43002</id>
		<title>File:Fig6 1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Fig6_1.png&amp;diff=43002"/>
		<updated>2010-12-01T08:52:21Z</updated>

		<summary type="html">&lt;p&gt;Ajain9: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ajain9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Fig5_1.png&amp;diff=43001</id>
		<title>File:Fig5 1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Fig5_1.png&amp;diff=43001"/>
		<updated>2010-12-01T08:37:20Z</updated>

		<summary type="html">&lt;p&gt;Ajain9: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ajain9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch5_5f_aj&amp;diff=39903</id>
		<title>CSC/ECE 517 Fall 2010/ch5 5f aj</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch5_5f_aj&amp;diff=39903"/>
		<updated>2010-11-03T05:47:01Z</updated>

		<summary type="html">&lt;p&gt;Ajain9: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;SAS Component Object Model&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
SAS (pronounced as &amp;quot;sass&amp;quot;) is a collection of software for Statistical Analysis. SAS help analyst to perform data entry, retrieval, management and mining, report writing and graphics, statistical analysis, etc. SAS has business solutions that enable large-scale software solutions for areas such as IT management, human resource management, financial management, business intelligence, customer relationship management etc. SAS was started by Anthony J. Barr in 1966 [http://en.wikipedia.org/wiki/Anthony_James_Barr 1] as a NC state graduate student like us. SAS/AF is application facility, a set of application development tools to create customized desktop GUI applications. In simple words it can be called as a library of drag-and-drop widgets which are object oriented. SAS/AF software contain an enhanced SAS component Language also known as Screen Control Language. SCOM is an object oriented programming model that provides a framework for SAS/AF component development. SCOM makes it easy to develop plug-and-play components that adhere to simple communication rules, which in turn makes it easy to share information between components. &lt;br /&gt;
&lt;br /&gt;
==Overview== &lt;br /&gt;
SCOM can be used to develop components that adhere to simple communication rules, which in turn make it easy to share information between components. &lt;br /&gt;
&lt;br /&gt;
==SCOM in detail==&lt;br /&gt;
===Purpose of SCOM===&lt;/div&gt;</summary>
		<author><name>Ajain9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch5_5f_aj&amp;diff=39884</id>
		<title>CSC/ECE 517 Fall 2010/ch5 5f aj</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch5_5f_aj&amp;diff=39884"/>
		<updated>2010-11-03T04:05:05Z</updated>

		<summary type="html">&lt;p&gt;Ajain9: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;SAS Component Object Model&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
SAS/AF software contain an enhanced SAS component Language also known as Screen Control Language. SCOM is an object oriented programming model that provides a framework for SAS/AF component development. SCOM makes it easy to develop plug-and-play components that adhere to simple communication rules, which in turn makes it easy to share information between components. &lt;br /&gt;
&lt;br /&gt;
.[http://www.bredemeyer.com/use_cases.htm 2]&lt;br /&gt;
&lt;br /&gt;
==Overview== &lt;br /&gt;
In general '''use cases''' are used to capture the '''who''' i.e the actors, the '''what''' i.e interactions and system reactions, and the '''purpose''' i.e the goal of a particular system without having to worry too much about the internal workings of the system. Use cases originated in the Object oriented community but their applicability is not limited to object oriented systems. [http://en.wikipedia.org/wiki/Use_case 1]&lt;br /&gt;
&lt;br /&gt;
==SCOM in detail==&lt;br /&gt;
===Purpose of SCOM===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Use case templates ===&lt;br /&gt;
*'''Use case''' &lt;br /&gt;
Each use case should have a unique name describing in a manner which describes its purpose. The name usually is a active phrase, in a verb-noun format. Use cases can also have a reference number associated with them, this is to indicate how they relate to other use cases. Also the use case name should maintain creation and modification history of the template, this information should be preceded by the keyword '''history'''.&lt;br /&gt;
*'''Description'''&lt;br /&gt;
In the description field of the use case template we maintain the goals of the use case. The description should list the source for the functional requirement, this information should be preceded by the keyword '''sources'''.&lt;br /&gt;
*'''Actors'''&lt;br /&gt;
Use cases identify the intent satisfying the role assumed by external '''actors''' interacting with the “system under discussion/test”. The actors can be classified into '''primary actor''' or '''secondary actor'''. A '''primary actor''' is one having a goal requiring the assistance of the system. A '''secondary actor''' is one from which the system needs assistance to satisfy a goal.[http://www.wilsonmar.com/1usecase.htm 8] &lt;br /&gt;
*'''Assumptions'''&lt;br /&gt;
Assumptions made in order to achieve the goals defined should be stated in a declarative manner. The assumptions should be evaluated to a true or false and in case if the assumption is false then it is unspecified as to what the use case will do. Behavior in case of an assumption failure can accounted for using use-case extensions.&lt;br /&gt;
*'''Steps'''&lt;br /&gt;
The sequence of interactions necessary to successfully meet the goal. The interactions between the system and actors are structured into one or more steps which are expressed in natural language. A step completes when all its component interactions have completed. A step has the form&lt;br /&gt;
&amp;lt;sequence number&amp;gt;&amp;lt;interaction&amp;gt;. If there are multiple steps then each step should have a sequence number showing its position in the list of interactions. The execution of one or more steps can be made conditional by using programming-like IF-then-ELSE constructs.[http://www.bredemeyer.com/pdf_files/use_case.pdf 3]&lt;br /&gt;
*'''Variations'''&lt;br /&gt;
Variations represent any variation in the steps of the use case. The format of the variation is &amp;lt;step reference&amp;gt; &amp;lt; list of variations separated by or&amp;gt;.&lt;br /&gt;
*'''Non functional requirements'''&lt;br /&gt;
Non functional requirements related to fault tolerance,performance,etc are listed as &amp;lt;keyword&amp;gt; : &amp;lt; requirement&amp;gt;. Here again the non functional requirements are list in a natural and understandable format.&lt;br /&gt;
*'''Issues'''&lt;br /&gt;
This section lists the issues which are awaiting the resolution.&lt;br /&gt;
&lt;br /&gt;
===Use case template example===&lt;br /&gt;
[[Image:usecasetemplateexample.png]]&lt;br /&gt;
&lt;br /&gt;
===Types of Use cases===&lt;br /&gt;
*'''System use cases''': System use case describes the service which the system provides for the actor. The system use case describes &amp;lt;i&amp;gt;what&amp;lt;/i&amp;gt; the system would do in response to the actor's actions. An actor in the system use cases can be wither a human user or another system interacting with the system under consideration.&lt;br /&gt;
*'''Business use cases''': Business use cases are used to define the processes which will be used by the external actors. The business use cases treat the system under consideration as a black box in which the actors are given a description as to &amp;lt;i&amp;gt;what&amp;lt;/i&amp;gt; the process does by specifying a value. [http://www.agilemodeling.com/artifacts/systemUseCase.htm#Informal 5]&lt;br /&gt;
&lt;br /&gt;
==Use case extension==&lt;br /&gt;
In order to deal with the case of assumption failure, a variant of the use cases can defined using the use case extension. &lt;br /&gt;
===Use case extension template===&lt;br /&gt;
*'''Use case extension''' [http://www.bredemeyer.com/pdf_files/use_case.pdf 3]&lt;br /&gt;
The extension name includes a unique identifier for the extension and a reference to the use case to which the extension applies&lt;br /&gt;
*'''Changed field'''&lt;br /&gt;
This field documents the field of the use case template which are going to be changed.&lt;br /&gt;
*'''Steps'''&lt;br /&gt;
This field mentions the steps field of the use case which require change, the changes are expressed in terms of new or altered steps which require change that apply to a use case at extension point, if some condition is true.&lt;br /&gt;
&lt;br /&gt;
===Use case extension example===&lt;br /&gt;
Continuing the example of the online shopping portal system use case previously explained, on extending the use case we get the following use case extension template.[[Image:Usecaseextensiontemplateexample.png]]&lt;br /&gt;
&lt;br /&gt;
==Use cases in UML==&lt;br /&gt;
UML represents the use cases in a diagrams called as the '''use case diagrams'''. [http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2007/wiki2_4_2q 4]&lt;br /&gt;
Lines in a UML use case between an actor and the system represent a more abstract concept of relationship of communication, acquaintance, or inheritance.&lt;br /&gt;
A use case circle can be more than a user invoking an on-demand service that passively waits until called upon.&lt;br /&gt;
A Use case circle can be event-driven, which proactively notifies one or more subscribers when specific events occur.&lt;br /&gt;
Services that run on their own without formal invocation may be better represented as an (automated) actor rather than as a use case circle.&lt;br /&gt;
The general representation of the use case environment in '''Unified Modeling Language'''(UML)is represented in the figure below&lt;br /&gt;
[[Image:Generalusecase.png]]&lt;br /&gt;
&lt;br /&gt;
'''Example''': Consider a scenario in which a customer is visiting a online shopping portal system. In this scenario as we see the customer as the actor interacting with the online shopping portal system. [http://atlas.kennesaw.edu/~dbraun/csis4650/A&amp;amp;D/UML_tutorial/use_case.htm 6] &lt;br /&gt;
The use case diagram covers the basic operations which the customer would normally perform while ordering an item from the shopping portal. This use case diagram can be extended to include extra scenarios such as the multiple item order, order cancellation and so on.&lt;br /&gt;
&lt;br /&gt;
[[Image:Usecaseexample.png]]&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
*[http://en.wikipedia.org/wiki/List_of_UML_tools List of UML Tools]&lt;br /&gt;
&lt;br /&gt;
*[http://alistair.cockburn.us/index.php/Pluggable_use_cases#Pluggable_Use_Case_Concept Pluggable Use Cases]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*[1]: Wikipedia.2010.Wikipedia-Use Case. wikipedia.org&lt;br /&gt;
&lt;br /&gt;
*[2]: Bredemeyer.2006.Functional Requirements and Use cases. Bredemeyer Consultancy&lt;br /&gt;
&lt;br /&gt;
*[3]: Coleman,Derek.1998.A Use Case Template:draft for discussion. Hewlett Packard&lt;br /&gt;
&lt;br /&gt;
*[4]: Mediawiki.2007.Wiki reference wiki2_4_2q.North Carolina State University &lt;br /&gt;
&lt;br /&gt;
*[5]: Ambler,W.Scott.2009.System Use Cases.Ambysoft Inc. &lt;br /&gt;
&lt;br /&gt;
*[6]: Braun,David.2000.UML tutorial[online].Kennesaw State University &lt;br /&gt;
&lt;br /&gt;
*[7]: Mall,R.2004. Fundamentals of Software Engineering. Prentice Hall, New Delhi.&lt;br /&gt;
&lt;br /&gt;
*[8]: Mar,Wilson.2010. Use cases. Wilson Mar&lt;br /&gt;
&lt;br /&gt;
==Links for References==&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Use_case Use case]&lt;br /&gt;
&lt;br /&gt;
*[http://www.bredemeyer.com/use_cases.htm Functional Requirements and Use cases]&lt;br /&gt;
&lt;br /&gt;
*[http://www.bredemeyer.com/pdf_files/use_case.pdf Use case extension template]&lt;br /&gt;
&lt;br /&gt;
*[http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2007/wiki2_4_2q Wiki reference]&lt;br /&gt;
&lt;br /&gt;
*[http://www.agilemodeling.com/artifacts/systemUseCase.htm#Informal Use case Types]&lt;br /&gt;
&lt;br /&gt;
*[http://atlas.kennesaw.edu/~dbraun/csis4650/A&amp;amp;D/UML_tutorial/use_case.htm Use cases HOW TO?]&lt;br /&gt;
&lt;br /&gt;
*[http://www.wilsonmar.com/1usecase.htm Use cases explained (8) ]&lt;/div&gt;</summary>
		<author><name>Ajain9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010_ch5_5f_aj&amp;diff=39773</id>
		<title>CSC/ECE 517 Fall 2010 ch5 5f aj</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010_ch5_5f_aj&amp;diff=39773"/>
		<updated>2010-11-02T15:54:35Z</updated>

		<summary type="html">&lt;p&gt;Ajain9: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;SAS Component Object Model&lt;/div&gt;</summary>
		<author><name>Ajain9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch5_5f_aj&amp;diff=39772</id>
		<title>CSC/ECE 517 Fall 2010/ch5 5f aj</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch5_5f_aj&amp;diff=39772"/>
		<updated>2010-11-02T15:50:43Z</updated>

		<summary type="html">&lt;p&gt;Ajain9: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;SAS Component Object Model&lt;/div&gt;</summary>
		<author><name>Ajain9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=38461</id>
		<title>CSC/ECE 517 Fall 2010/ch3 3d AI</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=38461"/>
		<updated>2010-10-16T03:53:21Z</updated>

		<summary type="html">&lt;p&gt;Ajain9: /* Aspect Oriented Programming */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Aspect Oriented Programming [http://en.wikipedia.org/wiki/Aspect-oriented_programming 1] is a programming style which isolates the business logic of the program from its secondary or supporting functions. The basis of the aspect oriented programming is to add a third dimension to pre-existing dimensions of the Procedural Programming and Object Oriented Programming, by describing aspects that cross-cut the structure of the program.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
If we look at the programming field from a distance we’ll generally divide programming&lt;br /&gt;
languages into two main camps: procedural programming(POP) and object-oriented programming (OOP). Like all programming techniques these were invented as ways to structure programming to achieve conceptual separation of components. This separation is obtained by dividing programs into sub-structures of some kind so that we can think and program each one&lt;br /&gt;
as a reasonably separate and autonomous entity.&lt;br /&gt;
&lt;br /&gt;
When using POP we divide our program into separate functions or procedures and compose the program flow by redirecting it from one to another in what is essentially a linear structure. With OOP a second dimension is added as we structure our code into encapsulated units linked to each other. The control flow is now defined dynamically by the object structure and&lt;br /&gt;
polymorphism. Aspect Oriented programming tries to add a third dimension to this structure by&lt;br /&gt;
describing so called aspects that cross-cut the structure of the program. &lt;br /&gt;
&lt;br /&gt;
==Motivation ==&lt;br /&gt;
Traditional programming designs had poor modularity due to crosscutting dependencies. Especially in OOP each aspect is scattered by virtue of the function being spread over  numerous unrelated functions or modules which maybe using its functionality, this means changing logging in one function requires modifying all the modules using this functionality, this works on the logic that the users knows/maintains a log of all the functions that use the functionality of the aspect&lt;br /&gt;
Example. &lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure1.png|frame|center]]&lt;br /&gt;
&lt;br /&gt;
Let us consider the example all know and love, Twitter. The model for which is shown in figure 1. If this model were to be implemented in an Object Oriented manner then the security aspect like authentication would have been scattered by virtue of a function called a logging, which is used by both the Users and Posts, a database transaction should encapsulate the operation in order to prevent accidental data loss Also, this operation should be logged onto the system log. We already see that authentication together with logging and transactions are now exhibiting cross-cutting concerns. Now consider the scenario in which the security specifications change , then in order to complete these changes this would require a major effort as the security-related operations are scattered across numerous methods.&lt;br /&gt;
&lt;br /&gt;
==Aspect Oriented Programming ==&lt;br /&gt;
Aspect Oriented Programming aims to solve this problem by including the concept called as aspects [http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf 3]. Aspects are stand-alone modules used to express cross-cutting concerns [http://www.marvin-steinberg.de/alternative-implementations-for-aspect-oriented-programming-language-constructs-a-case-study-in-ruby/ 4]. Figure demonstrates how our twitter module now looks with the inclusion of aspects.&lt;br /&gt;
In Java, the aspects contain advice and intertype declarations [http://www.javaworld.com/javaworld/jw-01-2002/jw-0118-aspect.html 9].&lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure2.png|frame|center]]        &lt;br /&gt;
In our example our authentication module can include a security check for the users before he/she can access the posts posted by himself and his/her friends. &lt;br /&gt;
&lt;br /&gt;
Key Concepts&lt;br /&gt;
&lt;br /&gt;
Join Points: A well defined location at a point in the execution of a program.&lt;br /&gt;
&lt;br /&gt;
PointCut: A set of join points&lt;br /&gt;
&lt;br /&gt;
Advice: Code designed to run automatically at all join points in a particular pointcut. It can be marked as before, after or around i.e. in place of the join points in the pointcut.&lt;br /&gt;
&lt;br /&gt;
Lexical Introduction: Adding functionality to a class in place as opposed to extending it.&lt;br /&gt;
&lt;br /&gt;
==AspectR==&lt;br /&gt;
Aspect Oriented Programming in Ruby is known as AspectR. [http://www.objectmentor.com/resources/articles/AOP_in_Ruby.pdf 2]&lt;br /&gt;
Aspects such login, security login, database session, transactions need to be done at the start of each method. If for example an application starts a session at the beginning of the application start and releases the resource only at the termination. A lot of resources are wasted and also may cause starvation of other applications. Hence we need frequent access to resources every time a needy method is called. Implementing this logic inside the method makes the aspect code repeated and cluttered all over the application source. To avoid this problem Aspect oriented programming can be adopted into the Ruby applications[http://aspectr.sourceforge.net/ 6]. Where all the aspect oriented functionality can be placed inside one behaviour. This behaviour can then be called before and after each method invocation. Thus making changes in aspect behaviour easy [http://www.ironicwolf.com/2009/04/aspect-the-ruby-way/ 7].&lt;br /&gt;
Aspect oriented programming in Ruby can be implemented using Aquarium framework. &lt;br /&gt;
&lt;br /&gt;
===Creating a Simple Aspect in Ruby===&lt;br /&gt;
Let us understand how easily an aspect behavior can be setup.&lt;br /&gt;
&lt;br /&gt;
===Setup===&lt;br /&gt;
Install Aquarium gem from rubyForge website or alternatively use &amp;quot;gem install aquarium&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
Depending on the requirement of the application the aspect behavior may be changed from the one below. The snippet below shows the skeleton of a typical Aspect definition [http://rubyforge.org/frs/?group_id=4281 8]. &lt;br /&gt;
&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 before :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc      &lt;br /&gt;
 end&lt;br /&gt;
 after :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc  &lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Before advice tells what work needs to be done before the method is called.&lt;br /&gt;
After advice tells what work needs to be done after the method ends.&lt;br /&gt;
&lt;br /&gt;
Another way of implementing is using Around Advice.&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 around :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc&lt;br /&gt;
 result = join_point.proceed&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc&lt;br /&gt;
 result  # block returns the result of the proceed.&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
==Aspect Oriented programming vs Object Oriented Programming==&lt;br /&gt;
Aspect oriented programming is not a complement to Object Oriented programming. It coexists together [http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf 3]. AOP tries to lessen the limitations of traditional object oriented programming like cross-cutting in code, dependency in code change in repetitive methods which deal with aspects like logging, authentication and sessions.&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
Aspect oriented Programming is a programming technique which has added a third dimension to programming languages, which is a significant improvement over Object Oriented Programming as it lets the programmer focus on working on the business logic in times when he has to change his line of thinking mid-way. All this without having to to be worried about his aspect being scattered through the code as all his new code can be incorporated in aspects.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*[1]: [http://en.wikipedia.org/wiki/Aspect-oriented_programming Aspect Oriented Programming]&lt;br /&gt;
&lt;br /&gt;
*[2]: [http://www.objectmentor.com/resources/articles/AOP_in_Ruby.pdf Aspect Oriented Programming in Ruby]&lt;br /&gt;
&lt;br /&gt;
*[3]: [http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf Aspect Oriented Programming, Comparison of Languages]&lt;br /&gt;
&lt;br /&gt;
*[4]: [http://www.marvin-steinberg.de/alternative-implementations-for-aspect-oriented-programming-language-constructs-a-case-study-in-ruby/ Alternative Implementations for Aspect-Oriented Programming Language Constructs: A Case Study in Ruby]&lt;br /&gt;
&lt;br /&gt;
*[5]: [http://www.theserverside.com/news/1364528/Implementing-Object-Caching-with-AOP Implementing Object Caching with AOP]&lt;br /&gt;
&lt;br /&gt;
*[6]: [http://aspectr.sourceforge.net/ AspectR sourceforge]&lt;br /&gt;
&lt;br /&gt;
*[7]: [http://www.ironicwolf.com/2009/04/aspect-the-ruby-way/ Aspect the Ruby way]&lt;br /&gt;
&lt;br /&gt;
*[8]: [http://rubyforge.org/frs/?group_id=4281 Ruby Forge]&lt;br /&gt;
&lt;br /&gt;
*[9]: [http://www.javaworld.com/javaworld/jw-01-2002/jw-0118-aspect.html A detailed series of articles about the basics of aspect-oriented programming and AspectJ]&lt;/div&gt;</summary>
		<author><name>Ajain9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=38459</id>
		<title>CSC/ECE 517 Fall 2010/ch3 3d AI</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=38459"/>
		<updated>2010-10-16T03:52:01Z</updated>

		<summary type="html">&lt;p&gt;Ajain9: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Aspect Oriented Programming [http://en.wikipedia.org/wiki/Aspect-oriented_programming 1] is a programming style which isolates the business logic of the program from its secondary or supporting functions. The basis of the aspect oriented programming is to add a third dimension to pre-existing dimensions of the Procedural Programming and Object Oriented Programming, by describing aspects that cross-cut the structure of the program.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
If we look at the programming field from a distance we’ll generally divide programming&lt;br /&gt;
languages into two main camps: procedural programming(POP) and object-oriented programming (OOP). Like all programming techniques these were invented as ways to structure programming to achieve conceptual separation of components. This separation is obtained by dividing programs into sub-structures of some kind so that we can think and program each one&lt;br /&gt;
as a reasonably separate and autonomous entity.&lt;br /&gt;
&lt;br /&gt;
When using POP we divide our program into separate functions or procedures and compose the program flow by redirecting it from one to another in what is essentially a linear structure. With OOP a second dimension is added as we structure our code into encapsulated units linked to each other. The control flow is now defined dynamically by the object structure and&lt;br /&gt;
polymorphism. Aspect Oriented programming tries to add a third dimension to this structure by&lt;br /&gt;
describing so called aspects that cross-cut the structure of the program. &lt;br /&gt;
&lt;br /&gt;
==Motivation ==&lt;br /&gt;
Traditional programming designs had poor modularity due to crosscutting dependencies. Especially in OOP each aspect is scattered by virtue of the function being spread over  numerous unrelated functions or modules which maybe using its functionality, this means changing logging in one function requires modifying all the modules using this functionality, this works on the logic that the users knows/maintains a log of all the functions that use the functionality of the aspect&lt;br /&gt;
Example. &lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure1.png|frame|center]]&lt;br /&gt;
&lt;br /&gt;
Let us consider the example all know and love, Twitter. The model for which is shown in figure 1. If this model were to be implemented in an Object Oriented manner then the security aspect like authentication would have been scattered by virtue of a function called a logging, which is used by both the Users and Posts, a database transaction should encapsulate the operation in order to prevent accidental data loss Also, this operation should be logged onto the system log. We already see that authentication together with logging and transactions are now exhibiting cross-cutting concerns. Now consider the scenario in which the security specifications change , then in order to complete these changes this would require a major effort as the security-related operations are scattered across numerous methods.&lt;br /&gt;
&lt;br /&gt;
==Aspect Oriented Programming ==&lt;br /&gt;
Aspect Oriented Programming aims to solve this problem by including the concept called as aspects [http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf 3]. Aspects are stand-alone modules used to express cross-cutting concerns [http://www.marvin-steinberg.de/alternative-implementations-for-aspect-oriented-programming-language-constructs-a-case-study-in-ruby/ 4]. Figure demonstrates how our twitter module now looks with the inclusion of aspects.&lt;br /&gt;
In Java, the aspects contain advice and intertype declarations.&lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure2.png|frame|center]]        &lt;br /&gt;
In our example our authentication module can include a security check for the users before he/she can access the posts posted by himself and his/her friends. &lt;br /&gt;
&lt;br /&gt;
Key Concepts&lt;br /&gt;
&lt;br /&gt;
Join Points: A well defined location at a point in the execution of a program.&lt;br /&gt;
&lt;br /&gt;
PointCut: A set of join points&lt;br /&gt;
&lt;br /&gt;
Advice: Code designed to run automatically at all join points in a particular pointcut. It can be marked as before, after or around i.e. in place of the join points in the pointcut.&lt;br /&gt;
&lt;br /&gt;
Lexical Introduction: Adding functionality to a class in place as opposed to extending it.&lt;br /&gt;
&lt;br /&gt;
==AspectR==&lt;br /&gt;
Aspect Oriented Programming in Ruby is known as AspectR. [http://www.objectmentor.com/resources/articles/AOP_in_Ruby.pdf 2]&lt;br /&gt;
Aspects such login, security login, database session, transactions need to be done at the start of each method. If for example an application starts a session at the beginning of the application start and releases the resource only at the termination. A lot of resources are wasted and also may cause starvation of other applications. Hence we need frequent access to resources every time a needy method is called. Implementing this logic inside the method makes the aspect code repeated and cluttered all over the application source. To avoid this problem Aspect oriented programming can be adopted into the Ruby applications[http://aspectr.sourceforge.net/ 6]. Where all the aspect oriented functionality can be placed inside one behaviour. This behaviour can then be called before and after each method invocation. Thus making changes in aspect behaviour easy [http://www.ironicwolf.com/2009/04/aspect-the-ruby-way/ 7].&lt;br /&gt;
Aspect oriented programming in Ruby can be implemented using Aquarium framework. &lt;br /&gt;
&lt;br /&gt;
===Creating a Simple Aspect in Ruby===&lt;br /&gt;
Let us understand how easily an aspect behavior can be setup.&lt;br /&gt;
&lt;br /&gt;
===Setup===&lt;br /&gt;
Install Aquarium gem from rubyForge website or alternatively use &amp;quot;gem install aquarium&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
Depending on the requirement of the application the aspect behavior may be changed from the one below. The snippet below shows the skeleton of a typical Aspect definition [http://rubyforge.org/frs/?group_id=4281 8]. &lt;br /&gt;
&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 before :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc      &lt;br /&gt;
 end&lt;br /&gt;
 after :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc  &lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Before advice tells what work needs to be done before the method is called.&lt;br /&gt;
After advice tells what work needs to be done after the method ends.&lt;br /&gt;
&lt;br /&gt;
Another way of implementing is using Around Advice.&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 around :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc&lt;br /&gt;
 result = join_point.proceed&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc&lt;br /&gt;
 result  # block returns the result of the proceed.&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
==Aspect Oriented programming vs Object Oriented Programming==&lt;br /&gt;
Aspect oriented programming is not a complement to Object Oriented programming. It coexists together [http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf 3]. AOP tries to lessen the limitations of traditional object oriented programming like cross-cutting in code, dependency in code change in repetitive methods which deal with aspects like logging, authentication and sessions.&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
Aspect oriented Programming is a programming technique which has added a third dimension to programming languages, which is a significant improvement over Object Oriented Programming as it lets the programmer focus on working on the business logic in times when he has to change his line of thinking mid-way. All this without having to to be worried about his aspect being scattered through the code as all his new code can be incorporated in aspects.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*[1]: [http://en.wikipedia.org/wiki/Aspect-oriented_programming Aspect Oriented Programming]&lt;br /&gt;
&lt;br /&gt;
*[2]: [http://www.objectmentor.com/resources/articles/AOP_in_Ruby.pdf Aspect Oriented Programming in Ruby]&lt;br /&gt;
&lt;br /&gt;
*[3]: [http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf Aspect Oriented Programming, Comparison of Languages]&lt;br /&gt;
&lt;br /&gt;
*[4]: [http://www.marvin-steinberg.de/alternative-implementations-for-aspect-oriented-programming-language-constructs-a-case-study-in-ruby/ Alternative Implementations for Aspect-Oriented Programming Language Constructs: A Case Study in Ruby]&lt;br /&gt;
&lt;br /&gt;
*[5]: [http://www.theserverside.com/news/1364528/Implementing-Object-Caching-with-AOP Implementing Object Caching with AOP]&lt;br /&gt;
&lt;br /&gt;
*[6]: [http://aspectr.sourceforge.net/ AspectR sourceforge]&lt;br /&gt;
&lt;br /&gt;
*[7]: [http://www.ironicwolf.com/2009/04/aspect-the-ruby-way/ Aspect the Ruby way]&lt;br /&gt;
&lt;br /&gt;
*[8]: [http://rubyforge.org/frs/?group_id=4281 Ruby Forge]&lt;br /&gt;
&lt;br /&gt;
*[9]: [http://www.javaworld.com/javaworld/jw-01-2002/jw-0118-aspect.html A detailed series of articles about the basics of aspect-oriented programming and AspectJ]&lt;/div&gt;</summary>
		<author><name>Ajain9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=38458</id>
		<title>CSC/ECE 517 Fall 2010/ch3 3d AI</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=38458"/>
		<updated>2010-10-16T03:50:52Z</updated>

		<summary type="html">&lt;p&gt;Ajain9: /* AspectR */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Aspect Oriented Programming [http://en.wikipedia.org/wiki/Aspect-oriented_programming 1] is a programming style which isolates the business logic of the program from its secondary or supporting functions. The basis of the aspect oriented programming is to add a third dimension to pre-existing dimensions of the Procedural Programming and Object Oriented Programming, by describing aspects that cross-cut the structure of the program.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
If we look at the programming field from a distance we’ll generally divide programming&lt;br /&gt;
languages into two main camps: procedural programming(POP) and object-oriented programming (OOP). Like all programming techniques these were invented as ways to structure programming to achieve conceptual separation of components. This separation is obtained by dividing programs into sub-structures of some kind so that we can think and program each one&lt;br /&gt;
as a reasonably separate and autonomous entity.&lt;br /&gt;
&lt;br /&gt;
When using POP we divide our program into separate functions or procedures and compose the program flow by redirecting it from one to another in what is essentially a linear structure. With OOP a second dimension is added as we structure our code into encapsulated units linked to each other. The control flow is now defined dynamically by the object structure and&lt;br /&gt;
polymorphism. Aspect Oriented programming tries to add a third dimension to this structure by&lt;br /&gt;
describing so called aspects that cross-cut the structure of the program. &lt;br /&gt;
&lt;br /&gt;
==Motivation ==&lt;br /&gt;
Traditional programming designs had poor modularity due to crosscutting dependencies. Especially in OOP each aspect is scattered by virtue of the function being spread over  numerous unrelated functions or modules which maybe using its functionality, this means changing logging in one function requires modifying all the modules using this functionality, this works on the logic that the users knows/maintains a log of all the functions that use the functionality of the aspect&lt;br /&gt;
Example. &lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure1.png|frame|center]]&lt;br /&gt;
&lt;br /&gt;
Let us consider the example all know and love, Twitter. The model for which is shown in figure 1. If this model were to be implemented in an Object Oriented manner then the security aspect like authentication would have been scattered by virtue of a function called a logging, which is used by both the Users and Posts, a database transaction should encapsulate the operation in order to prevent accidental data loss Also, this operation should be logged onto the system log. We already see that authentication together with logging and transactions are now exhibiting cross-cutting concerns. Now consider the scenario in which the security specifications change , then in order to complete these changes this would require a major effort as the security-related operations are scattered across numerous methods.&lt;br /&gt;
&lt;br /&gt;
==Aspect Oriented Programming ==&lt;br /&gt;
Aspect Oriented Programming aims to solve this problem by including the concept called as aspects [http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf 3]. Aspects are stand-alone modules used to express cross-cutting concerns [http://www.marvin-steinberg.de/alternative-implementations-for-aspect-oriented-programming-language-constructs-a-case-study-in-ruby/ 4]. Figure demonstrates how our twitter module now looks with the inclusion of aspects.&lt;br /&gt;
In Java, the aspects contain advice and intertype declarations.&lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure2.png|frame|center]]        &lt;br /&gt;
In our example our authentication module can include a security check for the users before he/she can access the posts posted by himself and his/her friends. &lt;br /&gt;
&lt;br /&gt;
Key Concepts&lt;br /&gt;
&lt;br /&gt;
Join Points: A well defined location at a point in the execution of a program.&lt;br /&gt;
&lt;br /&gt;
PointCut: A set of join points&lt;br /&gt;
&lt;br /&gt;
Advice: Code designed to run automatically at all join points in a particular pointcut. It can be marked as before, after or around i.e. in place of the join points in the pointcut.&lt;br /&gt;
&lt;br /&gt;
Lexical Introduction: Adding functionality to a class in place as opposed to extending it.&lt;br /&gt;
&lt;br /&gt;
==AspectR==&lt;br /&gt;
Aspect Oriented Programming in Ruby is known as AspectR. [http://www.objectmentor.com/resources/articles/AOP_in_Ruby.pdf 2]&lt;br /&gt;
Aspects such login, security login, database session, transactions need to be done at the start of each method. If for example an application starts a session at the beginning of the application start and releases the resource only at the termination. A lot of resources are wasted and also may cause starvation of other applications. Hence we need frequent access to resources every time a needy method is called. Implementing this logic inside the method makes the aspect code repeated and cluttered all over the application source. To avoid this problem Aspect oriented programming can be adopted into the Ruby applications[http://aspectr.sourceforge.net/ 6]. Where all the aspect oriented functionality can be placed inside one behaviour. This behaviour can then be called before and after each method invocation. Thus making changes in aspect behaviour easy [http://www.ironicwolf.com/2009/04/aspect-the-ruby-way/ 7].&lt;br /&gt;
Aspect oriented programming in Ruby can be implemented using Aquarium framework. &lt;br /&gt;
&lt;br /&gt;
===Creating a Simple Aspect in Ruby===&lt;br /&gt;
Let us understand how easily an aspect behavior can be setup.&lt;br /&gt;
&lt;br /&gt;
===Setup===&lt;br /&gt;
Install Aquarium gem from rubyForge website or alternatively use &amp;quot;gem install aquarium&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
Depending on the requirement of the application the aspect behavior may be changed from the one below. The snippet below shows the skeleton of a typical Aspect definition. &lt;br /&gt;
&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 before :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc      &lt;br /&gt;
 end&lt;br /&gt;
 after :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc  &lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Before advice tells what work needs to be done before the method is called.&lt;br /&gt;
After advice tells what work needs to be done after the method ends.&lt;br /&gt;
&lt;br /&gt;
Another way of implementing is using Around Advice.&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 around :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc&lt;br /&gt;
 result = join_point.proceed&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc&lt;br /&gt;
 result  # block returns the result of the proceed.&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
==Aspect Oriented programming vs Object Oriented Programming==&lt;br /&gt;
Aspect oriented programming is not a complement to Object Oriented programming. It coexists together [http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf 3]. AOP tries to lessen the limitations of traditional object oriented programming like cross-cutting in code, dependency in code change in repetitive methods which deal with aspects like logging, authentication and sessions.&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
Aspect oriented Programming is a programming technique which has added a third dimension to programming languages, which is a significant improvement over Object Oriented Programming as it lets the programmer focus on working on the business logic in times when he has to change his line of thinking mid-way. All this without having to to be worried about his aspect being scattered through the code as all his new code can be incorporated in aspects.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*[1]: [http://en.wikipedia.org/wiki/Aspect-oriented_programming Aspect Oriented Programming]&lt;br /&gt;
&lt;br /&gt;
*[2]: [http://www.objectmentor.com/resources/articles/AOP_in_Ruby.pdf Aspect Oriented Programming in Ruby]&lt;br /&gt;
&lt;br /&gt;
*[3]: [http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf Aspect Oriented Programming, Comparison of Languages]&lt;br /&gt;
&lt;br /&gt;
*[4]: [http://www.marvin-steinberg.de/alternative-implementations-for-aspect-oriented-programming-language-constructs-a-case-study-in-ruby/ Alternative Implementations for Aspect-Oriented Programming Language Constructs: A Case Study in Ruby]&lt;br /&gt;
&lt;br /&gt;
*[5]: [http://www.theserverside.com/news/1364528/Implementing-Object-Caching-with-AOP Implementing Object Caching with AOP]&lt;br /&gt;
&lt;br /&gt;
*[6]: [http://aspectr.sourceforge.net/ AspectR sourceforge]&lt;br /&gt;
&lt;br /&gt;
*[7]: [http://www.ironicwolf.com/2009/04/aspect-the-ruby-way/ Aspect the Ruby way]&lt;br /&gt;
&lt;br /&gt;
*[8]: [http://rubyforge.org/frs/?group_id=4281 Ruby Forge]&lt;br /&gt;
&lt;br /&gt;
*[9]: [http://www.javaworld.com/javaworld/jw-01-2002/jw-0118-aspect.html A detailed series of articles about the basics of aspect-oriented programming and AspectJ]&lt;/div&gt;</summary>
		<author><name>Ajain9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=38457</id>
		<title>CSC/ECE 517 Fall 2010/ch3 3d AI</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=38457"/>
		<updated>2010-10-16T03:48:48Z</updated>

		<summary type="html">&lt;p&gt;Ajain9: /* AspectR */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Aspect Oriented Programming [http://en.wikipedia.org/wiki/Aspect-oriented_programming 1] is a programming style which isolates the business logic of the program from its secondary or supporting functions. The basis of the aspect oriented programming is to add a third dimension to pre-existing dimensions of the Procedural Programming and Object Oriented Programming, by describing aspects that cross-cut the structure of the program.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
If we look at the programming field from a distance we’ll generally divide programming&lt;br /&gt;
languages into two main camps: procedural programming(POP) and object-oriented programming (OOP). Like all programming techniques these were invented as ways to structure programming to achieve conceptual separation of components. This separation is obtained by dividing programs into sub-structures of some kind so that we can think and program each one&lt;br /&gt;
as a reasonably separate and autonomous entity.&lt;br /&gt;
&lt;br /&gt;
When using POP we divide our program into separate functions or procedures and compose the program flow by redirecting it from one to another in what is essentially a linear structure. With OOP a second dimension is added as we structure our code into encapsulated units linked to each other. The control flow is now defined dynamically by the object structure and&lt;br /&gt;
polymorphism. Aspect Oriented programming tries to add a third dimension to this structure by&lt;br /&gt;
describing so called aspects that cross-cut the structure of the program. &lt;br /&gt;
&lt;br /&gt;
==Motivation ==&lt;br /&gt;
Traditional programming designs had poor modularity due to crosscutting dependencies. Especially in OOP each aspect is scattered by virtue of the function being spread over  numerous unrelated functions or modules which maybe using its functionality, this means changing logging in one function requires modifying all the modules using this functionality, this works on the logic that the users knows/maintains a log of all the functions that use the functionality of the aspect&lt;br /&gt;
Example. &lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure1.png|frame|center]]&lt;br /&gt;
&lt;br /&gt;
Let us consider the example all know and love, Twitter. The model for which is shown in figure 1. If this model were to be implemented in an Object Oriented manner then the security aspect like authentication would have been scattered by virtue of a function called a logging, which is used by both the Users and Posts, a database transaction should encapsulate the operation in order to prevent accidental data loss Also, this operation should be logged onto the system log. We already see that authentication together with logging and transactions are now exhibiting cross-cutting concerns. Now consider the scenario in which the security specifications change , then in order to complete these changes this would require a major effort as the security-related operations are scattered across numerous methods.&lt;br /&gt;
&lt;br /&gt;
==Aspect Oriented Programming ==&lt;br /&gt;
Aspect Oriented Programming aims to solve this problem by including the concept called as aspects [http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf 3]. Aspects are stand-alone modules used to express cross-cutting concerns [http://www.marvin-steinberg.de/alternative-implementations-for-aspect-oriented-programming-language-constructs-a-case-study-in-ruby/ 4]. Figure demonstrates how our twitter module now looks with the inclusion of aspects.&lt;br /&gt;
In Java, the aspects contain advice and intertype declarations.&lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure2.png|frame|center]]        &lt;br /&gt;
In our example our authentication module can include a security check for the users before he/she can access the posts posted by himself and his/her friends. &lt;br /&gt;
&lt;br /&gt;
Key Concepts&lt;br /&gt;
&lt;br /&gt;
Join Points: A well defined location at a point in the execution of a program.&lt;br /&gt;
&lt;br /&gt;
PointCut: A set of join points&lt;br /&gt;
&lt;br /&gt;
Advice: Code designed to run automatically at all join points in a particular pointcut. It can be marked as before, after or around i.e. in place of the join points in the pointcut.&lt;br /&gt;
&lt;br /&gt;
Lexical Introduction: Adding functionality to a class in place as opposed to extending it.&lt;br /&gt;
&lt;br /&gt;
==AspectR==&lt;br /&gt;
Aspect Oriented Programming in Ruby is known as AspectR. [http://www.objectmentor.com/resources/articles/AOP_in_Ruby.pdf 2]&lt;br /&gt;
Aspects such login, security login, database session, transactions need to be done at the start of each method. If for example an application starts a session at the beginning of the application start and releases the resource only at the termination. A lot of resources are wasted and also may cause starvation of other applications. Hence we need frequent access to resources every time a needy method is called. Implementing this logic inside the method makes the aspect code repeated and cluttered all over the application source. To avoid this problem Aspect oriented programming can be adopted into the Ruby applications[http://aspectr.sourceforge.net/ 6]. Where all the aspect oriented functionality can be placed inside one behaviour. This behaviour can then be called before and after each method invocation. Thus making changes in aspect behaviour easy.&lt;br /&gt;
Aspect oriented programming in Ruby can be implemented using Aquarium framework. &lt;br /&gt;
&lt;br /&gt;
===Creating a Simple Aspect in Ruby===&lt;br /&gt;
Let us understand how easily an aspect behavior can be setup.&lt;br /&gt;
&lt;br /&gt;
===Setup===&lt;br /&gt;
Install Aquarium gem from rubyForge website or alternatively use &amp;quot;gem install aquarium&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
Depending on the requirement of the application the aspect behavior may be changed from the one below. The snippet below shows the skeleton of a typical Aspect definition. &lt;br /&gt;
&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 before :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc      &lt;br /&gt;
 end&lt;br /&gt;
 after :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc  &lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Before advice tells what work needs to be done before the method is called.&lt;br /&gt;
After advice tells what work needs to be done after the method ends.&lt;br /&gt;
&lt;br /&gt;
Another way of implementing is using Around Advice.&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 around :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc&lt;br /&gt;
 result = join_point.proceed&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc&lt;br /&gt;
 result  # block returns the result of the proceed.&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
==Aspect Oriented programming vs Object Oriented Programming==&lt;br /&gt;
Aspect oriented programming is not a complement to Object Oriented programming. It coexists together [http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf 3]. AOP tries to lessen the limitations of traditional object oriented programming like cross-cutting in code, dependency in code change in repetitive methods which deal with aspects like logging, authentication and sessions.&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
Aspect oriented Programming is a programming technique which has added a third dimension to programming languages, which is a significant improvement over Object Oriented Programming as it lets the programmer focus on working on the business logic in times when he has to change his line of thinking mid-way. All this without having to to be worried about his aspect being scattered through the code as all his new code can be incorporated in aspects.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*[1]: [http://en.wikipedia.org/wiki/Aspect-oriented_programming Aspect Oriented Programming]&lt;br /&gt;
&lt;br /&gt;
*[2]: [http://www.objectmentor.com/resources/articles/AOP_in_Ruby.pdf Aspect Oriented Programming in Ruby]&lt;br /&gt;
&lt;br /&gt;
*[3]: [http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf Aspect Oriented Programming, Comparison of Languages]&lt;br /&gt;
&lt;br /&gt;
*[4]: [http://www.marvin-steinberg.de/alternative-implementations-for-aspect-oriented-programming-language-constructs-a-case-study-in-ruby/ Alternative Implementations for Aspect-Oriented Programming Language Constructs: A Case Study in Ruby]&lt;br /&gt;
&lt;br /&gt;
*[5]: [http://www.theserverside.com/news/1364528/Implementing-Object-Caching-with-AOP Implementing Object Caching with AOP]&lt;br /&gt;
&lt;br /&gt;
*[6]: [http://aspectr.sourceforge.net/ AspectR sourceforge]&lt;br /&gt;
&lt;br /&gt;
*[7]: [http://www.ironicwolf.com/2009/04/aspect-the-ruby-way/ Aspect the Ruby way]&lt;br /&gt;
&lt;br /&gt;
*[8]: [http://rubyforge.org/frs/?group_id=4281 Ruby Forge]&lt;br /&gt;
&lt;br /&gt;
*[9]: [http://www.javaworld.com/javaworld/jw-01-2002/jw-0118-aspect.html A detailed series of articles about the basics of aspect-oriented programming and AspectJ]&lt;/div&gt;</summary>
		<author><name>Ajain9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=38453</id>
		<title>CSC/ECE 517 Fall 2010/ch3 3d AI</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=38453"/>
		<updated>2010-10-16T03:36:20Z</updated>

		<summary type="html">&lt;p&gt;Ajain9: /* Aspect Oriented Programming */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Aspect Oriented Programming [http://en.wikipedia.org/wiki/Aspect-oriented_programming 1] is a programming style which isolates the business logic of the program from its secondary or supporting functions. The basis of the aspect oriented programming is to add a third dimension to pre-existing dimensions of the Procedural Programming and Object Oriented Programming, by describing aspects that cross-cut the structure of the program.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
If we look at the programming field from a distance we’ll generally divide programming&lt;br /&gt;
languages into two main camps: procedural programming(POP) and object-oriented programming (OOP). Like all programming techniques these were invented as ways to structure programming to achieve conceptual separation of components. This separation is obtained by dividing programs into sub-structures of some kind so that we can think and program each one&lt;br /&gt;
as a reasonably separate and autonomous entity.&lt;br /&gt;
&lt;br /&gt;
When using POP we divide our program into separate functions or procedures and compose the program flow by redirecting it from one to another in what is essentially a linear structure. With OOP a second dimension is added as we structure our code into encapsulated units linked to each other. The control flow is now defined dynamically by the object structure and&lt;br /&gt;
polymorphism. Aspect Oriented programming tries to add a third dimension to this structure by&lt;br /&gt;
describing so called aspects that cross-cut the structure of the program. &lt;br /&gt;
&lt;br /&gt;
==Motivation ==&lt;br /&gt;
Traditional programming designs had poor modularity due to crosscutting dependencies. Especially in OOP each aspect is scattered by virtue of the function being spread over  numerous unrelated functions or modules which maybe using its functionality, this means changing logging in one function requires modifying all the modules using this functionality, this works on the logic that the users knows/maintains a log of all the functions that use the functionality of the aspect&lt;br /&gt;
Example. &lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure1.png|frame|center]]&lt;br /&gt;
&lt;br /&gt;
Let us consider the example all know and love, Twitter. The model for which is shown in figure 1. If this model were to be implemented in an Object Oriented manner then the security aspect like authentication would have been scattered by virtue of a function called a logging, which is used by both the Users and Posts, a database transaction should encapsulate the operation in order to prevent accidental data loss Also, this operation should be logged onto the system log. We already see that authentication together with logging and transactions are now exhibiting cross-cutting concerns. Now consider the scenario in which the security specifications change , then in order to complete these changes this would require a major effort as the security-related operations are scattered across numerous methods.&lt;br /&gt;
&lt;br /&gt;
==Aspect Oriented Programming ==&lt;br /&gt;
Aspect Oriented Programming aims to solve this problem by including the concept called as aspects [http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf 3]. Aspects are stand-alone modules used to express cross-cutting concerns [http://www.marvin-steinberg.de/alternative-implementations-for-aspect-oriented-programming-language-constructs-a-case-study-in-ruby/ 4]. Figure demonstrates how our twitter module now looks with the inclusion of aspects.&lt;br /&gt;
In Java, the aspects contain advice and intertype declarations.&lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure2.png|frame|center]]        &lt;br /&gt;
In our example our authentication module can include a security check for the users before he/she can access the posts posted by himself and his/her friends. &lt;br /&gt;
&lt;br /&gt;
Key Concepts&lt;br /&gt;
&lt;br /&gt;
Join Points: A well defined location at a point in the execution of a program.&lt;br /&gt;
&lt;br /&gt;
PointCut: A set of join points&lt;br /&gt;
&lt;br /&gt;
Advice: Code designed to run automatically at all join points in a particular pointcut. It can be marked as before, after or around i.e. in place of the join points in the pointcut.&lt;br /&gt;
&lt;br /&gt;
Lexical Introduction: Adding functionality to a class in place as opposed to extending it.&lt;br /&gt;
&lt;br /&gt;
==AspectR==&lt;br /&gt;
Aspect Oriented Programming in Ruby is known as AspectR. [http://www.objectmentor.com/resources/articles/AOP_in_Ruby.pdf 2]&lt;br /&gt;
Aspects such login, security login, database session, transactions need to be done at the start of each method. If for example an application starts a session at the beginning of the application start and releases the resource only at the termination. A lot of resources are wasted and also may cause starvation of other applications. Hence we need frequent access to resources every time a needy method is called. Implementing this logic inside the method makes the aspect code repeated and cluttered all over the application source. To avoid this problem Aspect oriented programming can be adopted into the Ruby applications. Where all the aspect oriented functionality can be placed inside one behaviour. This behaviour can then be called before and after each method invocation. Thus making changes in aspect behaviour easy.&lt;br /&gt;
Aspect oriented programming in Ruby can be implemented using Aquarium framework. &lt;br /&gt;
&lt;br /&gt;
===Creating a Simple Aspect in Ruby===&lt;br /&gt;
Let us understand how easily an aspect behavior can be setup.&lt;br /&gt;
&lt;br /&gt;
===Setup===&lt;br /&gt;
Install Aquarium gem from rubyForge website or alternatively use &amp;quot;gem install aquarium&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
Depending on the requirement of the application the aspect behavior may be changed from the one below. The snippet below shows the skeleton of a typical Aspect definition. &lt;br /&gt;
&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 before :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc      &lt;br /&gt;
 end&lt;br /&gt;
 after :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc  &lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Before advice tells what work needs to be done before the method is called.&lt;br /&gt;
After advice tells what work needs to be done after the method ends.&lt;br /&gt;
&lt;br /&gt;
Another way of implementing is using Around Advice.&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 around :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc&lt;br /&gt;
 result = join_point.proceed&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc&lt;br /&gt;
 result  # block returns the result of the proceed.&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
==Aspect Oriented programming vs Object Oriented Programming==&lt;br /&gt;
Aspect oriented programming is not a complement to Object Oriented programming. It coexists together [http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf 3]. AOP tries to lessen the limitations of traditional object oriented programming like cross-cutting in code, dependency in code change in repetitive methods which deal with aspects like logging, authentication and sessions.&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
Aspect oriented Programming is a programming technique which has added a third dimension to programming languages, which is a significant improvement over Object Oriented Programming as it lets the programmer focus on working on the business logic in times when he has to change his line of thinking mid-way. All this without having to to be worried about his aspect being scattered through the code as all his new code can be incorporated in aspects.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*[1]: [http://en.wikipedia.org/wiki/Aspect-oriented_programming Aspect Oriented Programming]&lt;br /&gt;
&lt;br /&gt;
*[2]: [http://www.objectmentor.com/resources/articles/AOP_in_Ruby.pdf Aspect Oriented Programming in Ruby]&lt;br /&gt;
&lt;br /&gt;
*[3]: [http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf Aspect Oriented Programming, Comparison of Languages]&lt;br /&gt;
&lt;br /&gt;
*[4]: [http://www.marvin-steinberg.de/alternative-implementations-for-aspect-oriented-programming-language-constructs-a-case-study-in-ruby/ Alternative Implementations for Aspect-Oriented Programming Language Constructs: A Case Study in Ruby]&lt;br /&gt;
&lt;br /&gt;
*[5]: [http://www.theserverside.com/news/1364528/Implementing-Object-Caching-with-AOP Implementing Object Caching with AOP]&lt;br /&gt;
&lt;br /&gt;
*[6]: [http://aspectr.sourceforge.net/ AspectR sourceforge]&lt;br /&gt;
&lt;br /&gt;
*[7]: [http://www.ironicwolf.com/2009/04/aspect-the-ruby-way/ Aspect the Ruby way]&lt;br /&gt;
&lt;br /&gt;
*[8]: [http://rubyforge.org/frs/?group_id=4281 Ruby Forge]&lt;br /&gt;
&lt;br /&gt;
*[9]: [http://www.javaworld.com/javaworld/jw-01-2002/jw-0118-aspect.html A detailed series of articles about the basics of aspect-oriented programming and AspectJ]&lt;/div&gt;</summary>
		<author><name>Ajain9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=38449</id>
		<title>CSC/ECE 517 Fall 2010/ch3 3d AI</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=38449"/>
		<updated>2010-10-16T03:26:05Z</updated>

		<summary type="html">&lt;p&gt;Ajain9: /* Aspect Oriented programming vs Object Oriented Programming */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Aspect Oriented Programming [http://en.wikipedia.org/wiki/Aspect-oriented_programming 1] is a programming style which isolates the business logic of the program from its secondary or supporting functions. The basis of the aspect oriented programming is to add a third dimension to pre-existing dimensions of the Procedural Programming and Object Oriented Programming, by describing aspects that cross-cut the structure of the program.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
If we look at the programming field from a distance we’ll generally divide programming&lt;br /&gt;
languages into two main camps: procedural programming(POP) and object-oriented programming (OOP). Like all programming techniques these were invented as ways to structure programming to achieve conceptual separation of components. This separation is obtained by dividing programs into sub-structures of some kind so that we can think and program each one&lt;br /&gt;
as a reasonably separate and autonomous entity.&lt;br /&gt;
&lt;br /&gt;
When using POP we divide our program into separate functions or procedures and compose the program flow by redirecting it from one to another in what is essentially a linear structure. With OOP a second dimension is added as we structure our code into encapsulated units linked to each other. The control flow is now defined dynamically by the object structure and&lt;br /&gt;
polymorphism. Aspect Oriented programming tries to add a third dimension to this structure by&lt;br /&gt;
describing so called aspects that cross-cut the structure of the program. &lt;br /&gt;
&lt;br /&gt;
==Motivation ==&lt;br /&gt;
Traditional programming designs had poor modularity due to crosscutting dependencies. Especially in OOP each aspect is scattered by virtue of the function being spread over  numerous unrelated functions or modules which maybe using its functionality, this means changing logging in one function requires modifying all the modules using this functionality, this works on the logic that the users knows/maintains a log of all the functions that use the functionality of the aspect&lt;br /&gt;
Example. &lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure1.png|frame|center]]&lt;br /&gt;
&lt;br /&gt;
Let us consider the example all know and love, Twitter. The model for which is shown in figure 1. If this model were to be implemented in an Object Oriented manner then the security aspect like authentication would have been scattered by virtue of a function called a logging, which is used by both the Users and Posts, a database transaction should encapsulate the operation in order to prevent accidental data loss Also, this operation should be logged onto the system log. We already see that authentication together with logging and transactions are now exhibiting cross-cutting concerns. Now consider the scenario in which the security specifications change , then in order to complete these changes this would require a major effort as the security-related operations are scattered across numerous methods.&lt;br /&gt;
&lt;br /&gt;
==Aspect Oriented Programming ==&lt;br /&gt;
Aspect Oriented Programming aims to solve this problem by including the concept called as aspects [http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf 3]. Aspects are stand-alone modules used to express cross-cutting concerns. Figure demonstrates how our twitter module now looks with the inclusion of aspects.&lt;br /&gt;
In Java, the aspects contain advice and intertype declarations.&lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure2.png|frame|center]]        &lt;br /&gt;
In our example our authentication module can include a security check for the users before he/she can access the posts posted by himself and his/her friends. &lt;br /&gt;
&lt;br /&gt;
Key Concepts&lt;br /&gt;
&lt;br /&gt;
Join Points: A well defined location at a point in the execution of a program.&lt;br /&gt;
&lt;br /&gt;
PointCut: A set of join points&lt;br /&gt;
&lt;br /&gt;
Advice: Code designed to run automatically at all join points in a particular pointcut. It can be marked as before, after or around i.e. in place of the join points in the pointcut.&lt;br /&gt;
&lt;br /&gt;
Lexical Introduction: Adding functionality to a class in place as opposed to extending it.&lt;br /&gt;
&lt;br /&gt;
==AspectR==&lt;br /&gt;
Aspect Oriented Programming in Ruby is known as AspectR. [http://www.objectmentor.com/resources/articles/AOP_in_Ruby.pdf 2]&lt;br /&gt;
Aspects such login, security login, database session, transactions need to be done at the start of each method. If for example an application starts a session at the beginning of the application start and releases the resource only at the termination. A lot of resources are wasted and also may cause starvation of other applications. Hence we need frequent access to resources every time a needy method is called. Implementing this logic inside the method makes the aspect code repeated and cluttered all over the application source. To avoid this problem Aspect oriented programming can be adopted into the Ruby applications. Where all the aspect oriented functionality can be placed inside one behaviour. This behaviour can then be called before and after each method invocation. Thus making changes in aspect behaviour easy.&lt;br /&gt;
Aspect oriented programming in Ruby can be implemented using Aquarium framework. &lt;br /&gt;
&lt;br /&gt;
===Creating a Simple Aspect in Ruby===&lt;br /&gt;
Let us understand how easily an aspect behavior can be setup.&lt;br /&gt;
&lt;br /&gt;
===Setup===&lt;br /&gt;
Install Aquarium gem from rubyForge website or alternatively use &amp;quot;gem install aquarium&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
Depending on the requirement of the application the aspect behavior may be changed from the one below. The snippet below shows the skeleton of a typical Aspect definition. &lt;br /&gt;
&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 before :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc      &lt;br /&gt;
 end&lt;br /&gt;
 after :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc  &lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Before advice tells what work needs to be done before the method is called.&lt;br /&gt;
After advice tells what work needs to be done after the method ends.&lt;br /&gt;
&lt;br /&gt;
Another way of implementing is using Around Advice.&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 around :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc&lt;br /&gt;
 result = join_point.proceed&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc&lt;br /&gt;
 result  # block returns the result of the proceed.&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
==Aspect Oriented programming vs Object Oriented Programming==&lt;br /&gt;
Aspect oriented programming is not a complement to Object Oriented programming. It coexists together [http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf 3]. AOP tries to lessen the limitations of traditional object oriented programming like cross-cutting in code, dependency in code change in repetitive methods which deal with aspects like logging, authentication and sessions.&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
Aspect oriented Programming is a programming technique which has added a third dimension to programming languages, which is a significant improvement over Object Oriented Programming as it lets the programmer focus on working on the business logic in times when he has to change his line of thinking mid-way. All this without having to to be worried about his aspect being scattered through the code as all his new code can be incorporated in aspects.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*[1]: [http://en.wikipedia.org/wiki/Aspect-oriented_programming Aspect Oriented Programming]&lt;br /&gt;
&lt;br /&gt;
*[2]: [http://www.objectmentor.com/resources/articles/AOP_in_Ruby.pdf Aspect Oriented Programming in Ruby]&lt;br /&gt;
&lt;br /&gt;
*[3]: [http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf Aspect Oriented Programming, Comparison of Languages]&lt;br /&gt;
&lt;br /&gt;
*[4]: [http://www.marvin-steinberg.de/alternative-implementations-for-aspect-oriented-programming-language-constructs-a-case-study-in-ruby/ Alternative Implementations for Aspect-Oriented Programming Language Constructs: A Case Study in Ruby]&lt;br /&gt;
&lt;br /&gt;
*[5]: [http://www.theserverside.com/news/1364528/Implementing-Object-Caching-with-AOP Implementing Object Caching with AOP]&lt;br /&gt;
&lt;br /&gt;
*[6]: [http://aspectr.sourceforge.net/ AspectR sourceforge]&lt;br /&gt;
&lt;br /&gt;
*[7]: [http://www.ironicwolf.com/2009/04/aspect-the-ruby-way/ Aspect the Ruby way]&lt;br /&gt;
&lt;br /&gt;
*[8]: [http://rubyforge.org/frs/?group_id=4281 Ruby Forge]&lt;br /&gt;
&lt;br /&gt;
*[9]: [http://www.javaworld.com/javaworld/jw-01-2002/jw-0118-aspect.html A detailed series of articles about the basics of aspect-oriented programming and AspectJ]&lt;/div&gt;</summary>
		<author><name>Ajain9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=38443</id>
		<title>CSC/ECE 517 Fall 2010/ch3 3d AI</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=38443"/>
		<updated>2010-10-16T03:14:49Z</updated>

		<summary type="html">&lt;p&gt;Ajain9: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Aspect Oriented Programming [http://en.wikipedia.org/wiki/Aspect-oriented_programming 1] is a programming style which isolates the business logic of the program from its secondary or supporting functions. The basis of the aspect oriented programming is to add a third dimension to pre-existing dimensions of the Procedural Programming and Object Oriented Programming, by describing aspects that cross-cut the structure of the program.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
If we look at the programming field from a distance we’ll generally divide programming&lt;br /&gt;
languages into two main camps: procedural programming(POP) and object-oriented programming (OOP). Like all programming techniques these were invented as ways to structure programming to achieve conceptual separation of components. This separation is obtained by dividing programs into sub-structures of some kind so that we can think and program each one&lt;br /&gt;
as a reasonably separate and autonomous entity.&lt;br /&gt;
&lt;br /&gt;
When using POP we divide our program into separate functions or procedures and compose the program flow by redirecting it from one to another in what is essentially a linear structure. With OOP a second dimension is added as we structure our code into encapsulated units linked to each other. The control flow is now defined dynamically by the object structure and&lt;br /&gt;
polymorphism. Aspect Oriented programming tries to add a third dimension to this structure by&lt;br /&gt;
describing so called aspects that cross-cut the structure of the program. &lt;br /&gt;
&lt;br /&gt;
==Motivation ==&lt;br /&gt;
Traditional programming designs had poor modularity due to crosscutting dependencies. Especially in OOP each aspect is scattered by virtue of the function being spread over  numerous unrelated functions or modules which maybe using its functionality, this means changing logging in one function requires modifying all the modules using this functionality, this works on the logic that the users knows/maintains a log of all the functions that use the functionality of the aspect&lt;br /&gt;
Example. &lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure1.png|frame|center]]&lt;br /&gt;
&lt;br /&gt;
Let us consider the example all know and love, Twitter. The model for which is shown in figure 1. If this model were to be implemented in an Object Oriented manner then the security aspect like authentication would have been scattered by virtue of a function called a logging, which is used by both the Users and Posts, a database transaction should encapsulate the operation in order to prevent accidental data loss Also, this operation should be logged onto the system log. We already see that authentication together with logging and transactions are now exhibiting cross-cutting concerns. Now consider the scenario in which the security specifications change , then in order to complete these changes this would require a major effort as the security-related operations are scattered across numerous methods.&lt;br /&gt;
&lt;br /&gt;
==Aspect Oriented Programming ==&lt;br /&gt;
Aspect Oriented Programming aims to solve this problem by including the concept called as aspects [http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf 3]. Aspects are stand-alone modules used to express cross-cutting concerns. Figure demonstrates how our twitter module now looks with the inclusion of aspects.&lt;br /&gt;
In Java, the aspects contain advice and intertype declarations.&lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure2.png|frame|center]]        &lt;br /&gt;
In our example our authentication module can include a security check for the users before he/she can access the posts posted by himself and his/her friends. &lt;br /&gt;
&lt;br /&gt;
Key Concepts&lt;br /&gt;
&lt;br /&gt;
Join Points: A well defined location at a point in the execution of a program.&lt;br /&gt;
&lt;br /&gt;
PointCut: A set of join points&lt;br /&gt;
&lt;br /&gt;
Advice: Code designed to run automatically at all join points in a particular pointcut. It can be marked as before, after or around i.e. in place of the join points in the pointcut.&lt;br /&gt;
&lt;br /&gt;
Lexical Introduction: Adding functionality to a class in place as opposed to extending it.&lt;br /&gt;
&lt;br /&gt;
==AspectR==&lt;br /&gt;
Aspect Oriented Programming in Ruby is known as AspectR. [http://www.objectmentor.com/resources/articles/AOP_in_Ruby.pdf 2]&lt;br /&gt;
Aspects such login, security login, database session, transactions need to be done at the start of each method. If for example an application starts a session at the beginning of the application start and releases the resource only at the termination. A lot of resources are wasted and also may cause starvation of other applications. Hence we need frequent access to resources every time a needy method is called. Implementing this logic inside the method makes the aspect code repeated and cluttered all over the application source. To avoid this problem Aspect oriented programming can be adopted into the Ruby applications. Where all the aspect oriented functionality can be placed inside one behaviour. This behaviour can then be called before and after each method invocation. Thus making changes in aspect behaviour easy.&lt;br /&gt;
Aspect oriented programming in Ruby can be implemented using Aquarium framework. &lt;br /&gt;
&lt;br /&gt;
===Creating a Simple Aspect in Ruby===&lt;br /&gt;
Let us understand how easily an aspect behavior can be setup.&lt;br /&gt;
&lt;br /&gt;
===Setup===&lt;br /&gt;
Install Aquarium gem from rubyForge website or alternatively use &amp;quot;gem install aquarium&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
Depending on the requirement of the application the aspect behavior may be changed from the one below. The snippet below shows the skeleton of a typical Aspect definition. &lt;br /&gt;
&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 before :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc      &lt;br /&gt;
 end&lt;br /&gt;
 after :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc  &lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Before advice tells what work needs to be done before the method is called.&lt;br /&gt;
After advice tells what work needs to be done after the method ends.&lt;br /&gt;
&lt;br /&gt;
Another way of implementing is using Around Advice.&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 around :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc&lt;br /&gt;
 result = join_point.proceed&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc&lt;br /&gt;
 result  # block returns the result of the proceed.&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
==Aspect Oriented programming vs Object Oriented Programming==&lt;br /&gt;
Aspect oriented programming is not a complement to Object Oriented programming. It coexists together. AOP tries to lessen the limitations of traditional object oriented programming like cross-cutting in code, dependency in code change in repetitive methods which deal with aspects like logging, authentication and sessions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
Aspect oriented Programming is a programming technique which has added a third dimension to programming languages, which is a significant improvement over Object Oriented Programming as it lets the programmer focus on working on the business logic in times when he has to change his line of thinking mid-way. All this without having to to be worried about his aspect being scattered through the code as all his new code can be incorporated in aspects.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*[1]: [http://en.wikipedia.org/wiki/Aspect-oriented_programming Aspect Oriented Programming]&lt;br /&gt;
&lt;br /&gt;
*[2]: [http://www.objectmentor.com/resources/articles/AOP_in_Ruby.pdf Aspect Oriented Programming in Ruby]&lt;br /&gt;
&lt;br /&gt;
*[3]: [http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf Aspect Oriented Programming, Comparison of Languages]&lt;br /&gt;
&lt;br /&gt;
*[4]: [http://www.marvin-steinberg.de/alternative-implementations-for-aspect-oriented-programming-language-constructs-a-case-study-in-ruby/ Alternative Implementations for Aspect-Oriented Programming Language Constructs: A Case Study in Ruby]&lt;br /&gt;
&lt;br /&gt;
*[5]: [http://www.theserverside.com/news/1364528/Implementing-Object-Caching-with-AOP Implementing Object Caching with AOP]&lt;br /&gt;
&lt;br /&gt;
*[6]: [http://aspectr.sourceforge.net/ AspectR sourceforge]&lt;br /&gt;
&lt;br /&gt;
*[7]: [http://www.ironicwolf.com/2009/04/aspect-the-ruby-way/ Aspect the Ruby way]&lt;br /&gt;
&lt;br /&gt;
*[8]: [http://rubyforge.org/frs/?group_id=4281 Ruby Forge]&lt;br /&gt;
&lt;br /&gt;
*[9]: [http://www.javaworld.com/javaworld/jw-01-2002/jw-0118-aspect.html A detailed series of articles about the basics of aspect-oriented programming and AspectJ]&lt;/div&gt;</summary>
		<author><name>Ajain9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=38442</id>
		<title>CSC/ECE 517 Fall 2010/ch3 3d AI</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=38442"/>
		<updated>2010-10-16T03:10:44Z</updated>

		<summary type="html">&lt;p&gt;Ajain9: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Aspect Oriented Programming [http://en.wikipedia.org/wiki/Aspect-oriented_programming 1] is a programming style which isolates the business logic of the program from its secondary or supporting functions. The basis of the aspect oriented programming is to add a third dimension to pre-existing dimensions of the Procedural Programming and Object Oriented Programming, by describing aspects that cross-cut the structure of the program.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
If we look at the programming field from a distance we’ll generally divide programming&lt;br /&gt;
languages into two main camps: procedural programming(POP) and object-oriented programming (OOP). Like all programming techniques these were invented as ways to structure programming to achieve conceptual separation of components. This separation is obtained by dividing programs into sub-structures of some kind so that we can think and program each one&lt;br /&gt;
as a reasonably separate and autonomous entity.&lt;br /&gt;
&lt;br /&gt;
When using POP we divide our program into separate functions or procedures and compose the program flow by redirecting it from one to another in what is essentially a linear structure. With OOP a second dimension is added as we structure our code into encapsulated units linked to each other. The control flow is now defined dynamically by the object structure and&lt;br /&gt;
polymorphism. Aspect Oriented programming tries to add a third dimension to this structure by&lt;br /&gt;
describing so called aspects that cross-cut the structure of the program. &lt;br /&gt;
&lt;br /&gt;
==Motivation ==&lt;br /&gt;
Traditional programming designs had poor modularity due to crosscutting dependencies. Especially in OOP each aspect is scattered by virtue of the function being spread over  numerous unrelated functions or modules which maybe using its functionality, this means changing logging in one function requires modifying all the modules using this functionality, this works on the logic that the users knows/maintains a log of all the functions that use the functionality of the aspect&lt;br /&gt;
Example. &lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure1.png|frame|center]]&lt;br /&gt;
&lt;br /&gt;
Let us consider the example all know and love, Twitter. The model for which is shown in figure 1. If this model were to be implemented in an Object Oriented manner then the security aspect like authentication would have been scattered by virtue of a function called a logging, which is used by both the Users and Posts, a database transaction should encapsulate the operation in order to prevent accidental data loss Also, this operation should be logged onto the system log. We already see that authentication together with logging and transactions are now exhibiting cross-cutting concerns. Now consider the scenario in which the security specifications change , then in order to complete these changes this would require a major effort as the security-related operations are scattered across numerous methods.&lt;br /&gt;
&lt;br /&gt;
==Aspect Oriented Programming ==&lt;br /&gt;
Aspect Oriented Programming aims to solve this problem by including the concept called as aspects [http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf 3]. Aspects are stand-alone modules used to express cross-cutting concerns. Figure demonstrates how our twitter module now looks with the inclusion of aspects.&lt;br /&gt;
In Java, the aspects contain advice and intertype declarations.&lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure2.png|frame|center]]        &lt;br /&gt;
In our example our authentication module can include a security check for the users before he/she can access the posts posted by himself and his/her friends. &lt;br /&gt;
&lt;br /&gt;
Key Concepts&lt;br /&gt;
&lt;br /&gt;
Join Points: A well defined location at a point in the execution of a program.&lt;br /&gt;
&lt;br /&gt;
PointCut: A set of join points&lt;br /&gt;
&lt;br /&gt;
Advice: Code designed to run automatically at all join points in a particular pointcut. It can be marked as before, after or around i.e. in place of the join points in the pointcut.&lt;br /&gt;
&lt;br /&gt;
Lexical Introduction: Adding functionality to a class in place as opposed to extending it.&lt;br /&gt;
&lt;br /&gt;
==AspectR==&lt;br /&gt;
Aspect Oriented Programming in Ruby is known as AspectR. [http://www.objectmentor.com/resources/articles/AOP_in_Ruby.pdf 2]&lt;br /&gt;
Aspects such login, security login, database session, transactions need to be done at the start of each method. If for example an application starts a session at the beginning of the application start and releases the resource only at the termination. A lot of resources are wasted and also may cause starvation of other applications. Hence we need frequent access to resources every time a needy method is called. Implementing this logic inside the method makes the aspect code repeated and cluttered all over the application source. To avoid this problem Aspect oriented programming can be adopted into the Ruby applications. Where all the aspect oriented functionality can be placed inside one behaviour. This behaviour can then be called before and after each method invocation. Thus making changes in aspect behaviour easy.&lt;br /&gt;
Aspect oriented programming in Ruby can be implemented using Aquarium framework. &lt;br /&gt;
&lt;br /&gt;
===Creating a Simple Aspect in Ruby===&lt;br /&gt;
Let us understand how easily an aspect behavior can be setup.&lt;br /&gt;
&lt;br /&gt;
===Setup===&lt;br /&gt;
Install Aquarium gem from rubyForge website or alternatively use &amp;quot;gem install aquarium&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
Depending on the requirement of the application the aspect behavior may be changed from the one below. The snippet below shows the skeleton of a typical Aspect definition. &lt;br /&gt;
&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 before :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc      &lt;br /&gt;
 end&lt;br /&gt;
 after :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc  &lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Before advice tells what work needs to be done before the method is called.&lt;br /&gt;
After advice tells what work needs to be done after the method ends.&lt;br /&gt;
&lt;br /&gt;
Another way of implementing is using Around Advice.&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 around :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc&lt;br /&gt;
 result = join_point.proceed&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc&lt;br /&gt;
 result  # block returns the result of the proceed.&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
==Aspect Oriented programming vs Object Oriented Programming==&lt;br /&gt;
Aspect oriented programming is not a complement to Object Oriented programming. It coexists together. AOP tries to lessen the limitations of traditional object oriented programming like cross-cutting in code, dependency in code change in repetitive methods which deal with aspects like logging, authentication and sessions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
Aspect oriented Programming is a programming technique which has added a third dimension to programming languages, which is a significant improvement over Object Oriented Programming as it lets the programmer focus on working on the business logic in times when he has to change his line of thinking mid-way. All this without having to to be worried about his aspect being scattered through the code as all his new code can be incorporated in aspects.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*[1]: [http://en.wikipedia.org/wiki/Aspect-oriented_programming Aspect Oriented Programming]&lt;br /&gt;
&lt;br /&gt;
*[2]: [http://www.objectmentor.com/resources/articles/AOP_in_Ruby.pdf Aspect Oriented Programming in Ruby]&lt;br /&gt;
&lt;br /&gt;
*[3]: [http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf Aspect Oriented Programming, Comparison of Languages]&lt;br /&gt;
&lt;br /&gt;
*[4]: [http://www.marvin-steinberg.de/alternative-implementations-for-aspect-oriented-programming-language-constructs-a-case-study-in-ruby/ Alternative Implementations for Aspect-Oriented Programming Language Constructs: A Case Study in Ruby]&lt;br /&gt;
&lt;br /&gt;
*[5]: http://www.theserverside.com/news/1364528/Implementing-Object-Caching-with-AOP&lt;br /&gt;
&lt;br /&gt;
*[6]: http://aspectr.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
*[7]: http://www.ironicwolf.com/2009/04/aspect-the-ruby-way/&lt;br /&gt;
&lt;br /&gt;
*[8]: http://rubyforge.org/frs/?group_id=4281&lt;br /&gt;
&lt;br /&gt;
*[9]:  [http://www.javaworld.com/javaworld/jw-01-2002/jw-0118-aspect.html A detailed series of articles about the basics of aspect-oriented programming and AspectJ]&lt;/div&gt;</summary>
		<author><name>Ajain9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=38439</id>
		<title>CSC/ECE 517 Fall 2010/ch3 3d AI</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=38439"/>
		<updated>2010-10-16T03:03:37Z</updated>

		<summary type="html">&lt;p&gt;Ajain9: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Aspect Oriented Programming [http://en.wikipedia.org/wiki/Aspect-oriented_programming 1] is a programming style which isolates the business logic of the program from its secondary or supporting functions. The basis of the aspect oriented programming is to add a third dimension to pre-existing dimensions of the Procedural Programming and Object Oriented Programming, by describing aspects that cross-cut the structure of the program.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
If we look at the programming field from a distance we’ll generally divide programming&lt;br /&gt;
languages into two main camps: procedural programming(POP) and object-oriented programming (OOP). Like all programming techniques these were invented as ways to structure programming to achieve conceptual separation of components. This separation is obtained by dividing programs into sub-structures of some kind so that we can think and program each one&lt;br /&gt;
as a reasonably separate and autonomous entity.&lt;br /&gt;
&lt;br /&gt;
When using POP we divide our program into separate functions or procedures and compose the program flow by redirecting it from one to another in what is essentially a linear structure. With OOP a second dimension is added as we structure our code into encapsulated units linked to each other. The control flow is now defined dynamically by the object structure and&lt;br /&gt;
polymorphism. Aspect Oriented programming tries to add a third dimension to this structure by&lt;br /&gt;
describing so called aspects that cross-cut the structure of the program. &lt;br /&gt;
&lt;br /&gt;
==Motivation ==&lt;br /&gt;
Traditional programming designs had poor modularity due to crosscutting dependencies. Especially in OOP each aspect is scattered by virtue of the function being spread over  numerous unrelated functions or modules which maybe using its functionality, this means changing logging in one function requires modifying all the modules using this functionality, this works on the logic that the users knows/maintains a log of all the functions that use the functionality of the aspect&lt;br /&gt;
Example. &lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure1.png|frame|center]]&lt;br /&gt;
&lt;br /&gt;
Let us consider the example all know and love, Twitter. The model for which is shown in figure 1. If this model were to be implemented in an Object Oriented manner then the security aspect like authentication would have been scattered by virtue of a function called a logging, which is used by both the Users and Posts, a database transaction should encapsulate the operation in order to prevent accidental data loss Also, this operation should be logged onto the system log. We already see that authentication together with logging and transactions are now exhibiting cross-cutting concerns. Now consider the scenario in which the security specifications change , then in order to complete these changes this would require a major effort as the security-related operations are scattered across numerous methods.&lt;br /&gt;
&lt;br /&gt;
==Aspect Oriented Programming ==&lt;br /&gt;
Aspect Oriented Programming aims to solve this problem by including the concept called as aspects [http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf 3]. Aspects are stand-alone modules used to express cross-cutting concerns. Figure demonstrates how our twitter module now looks with the inclusion of aspects.&lt;br /&gt;
In Java, the aspects contain advice and intertype declarations.&lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure2.png|frame|center]]        &lt;br /&gt;
In our example our authentication module can include a security check for the users before he/she can access the posts posted by himself and his/her friends. &lt;br /&gt;
&lt;br /&gt;
Key Concepts&lt;br /&gt;
&lt;br /&gt;
Join Points: A well defined location at a point in the execution of a program.&lt;br /&gt;
&lt;br /&gt;
PointCut: A set of join points&lt;br /&gt;
&lt;br /&gt;
Advice: Code designed to run automatically at all join points in a particular pointcut. It can be marked as before, after or around i.e. in place of the join points in the pointcut.&lt;br /&gt;
&lt;br /&gt;
Lexical Introduction: Adding functionality to a class in place as opposed to extending it.&lt;br /&gt;
&lt;br /&gt;
==AspectR==&lt;br /&gt;
Aspect Oriented Programming in Ruby is known as AspectR. [http://www.objectmentor.com/resources/articles/AOP_in_Ruby.pdf 2]&lt;br /&gt;
Aspects such login, security login, database session, transactions need to be done at the start of each method. If for example an application starts a session at the beginning of the application start and releases the resource only at the termination. A lot of resources are wasted and also may cause starvation of other applications. Hence we need frequent access to resources every time a needy method is called. Implementing this logic inside the method makes the aspect code repeated and cluttered all over the application source. To avoid this problem Aspect oriented programming can be adopted into the Ruby applications. Where all the aspect oriented functionality can be placed inside one behaviour. This behaviour can then be called before and after each method invocation. Thus making changes in aspect behaviour easy.&lt;br /&gt;
Aspect oriented programming in Ruby can be implemented using Aquarium framework. &lt;br /&gt;
&lt;br /&gt;
===Creating a Simple Aspect in Ruby===&lt;br /&gt;
Let us understand how easily an aspect behavior can be setup.&lt;br /&gt;
&lt;br /&gt;
===Setup===&lt;br /&gt;
Install Aquarium gem from rubyForge website or alternatively use &amp;quot;gem install aquarium&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
Depending on the requirement of the application the aspect behavior may be changed from the one below. The snippet below shows the skeleton of a typical Aspect definition. &lt;br /&gt;
&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 before :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc      &lt;br /&gt;
 end&lt;br /&gt;
 after :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc  &lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Before advice tells what work needs to be done before the method is called.&lt;br /&gt;
After advice tells what work needs to be done after the method ends.&lt;br /&gt;
&lt;br /&gt;
Another way of implementing is using Around Advice.&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 around :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc&lt;br /&gt;
 result = join_point.proceed&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc&lt;br /&gt;
 result  # block returns the result of the proceed.&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
==Aspect Oriented programming vs Object Oriented Programming==&lt;br /&gt;
Aspect oriented programming is not a complement to Object Oriented programming. It coexists together. AOP tries to lessen the limitations of traditional object oriented programming like cross-cutting in code, dependency in code change in repetitive methods which deal with aspects like logging, authentication and sessions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
Aspect oriented Programming is a programming technique which has added a third dimension to programming languages, which is a significant improvement over Object Oriented Programming as it lets the programmer focus on working on the business logic in times when he has to change his line of thinking mid-way. All this without having to to be worried about his aspect being scattered through the code as all his new code can be incorporated in aspects.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*[1]: [http://en.wikipedia.org/wiki/Aspect-oriented_programming Aspect Oriented Programming]&lt;br /&gt;
&lt;br /&gt;
*[2]: [http://www.objectmentor.com/resources/articles/AOP_in_Ruby.pdf Aspect Oriented Programming in Ruby]&lt;br /&gt;
&lt;br /&gt;
*[3]: [http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf Aspect Oriented Programming, Comparison of Languages]&lt;br /&gt;
&lt;br /&gt;
*[4]: [http://www.marvin-steinberg.de/alternative-implementations-for-aspect-oriented-programming-language-constructs-a-case-study-in-ruby/ Alternative Implementations for Aspect-Oriented Programming Language Constructs: A Case Study in Ruby]&lt;br /&gt;
&lt;br /&gt;
*[5]: http://www.theserverside.com/news/1364528/Implementing-Object-Caching-with-AOP&lt;br /&gt;
&lt;br /&gt;
*[6]: http://aspectr.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
*[7]: http://www.ironicwolf.com/2009/04/aspect-the-ruby-way/&lt;br /&gt;
&lt;br /&gt;
*[8]: http://rubyforge.org/frs/?group_id=4281&lt;/div&gt;</summary>
		<author><name>Ajain9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=38435</id>
		<title>CSC/ECE 517 Fall 2010/ch3 3d AI</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=38435"/>
		<updated>2010-10-16T03:01:11Z</updated>

		<summary type="html">&lt;p&gt;Ajain9: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Aspect Oriented Programming [http://en.wikipedia.org/wiki/Aspect-oriented_programming 1] is a programming style which isolates the business logic of the program from its secondary or supporting functions. The basis of the aspect oriented programming is to add a third dimension to pre-existing dimensions of the Procedural Programming and Object Oriented Programming, by describing aspects that cross-cut the structure of the program.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
If we look at the programming field from a distance we’ll generally divide programming&lt;br /&gt;
languages into two main camps: procedural programming(POP) and object-oriented programming (OOP). Like all programming techniques these were invented as ways to structure programming to achieve conceptual separation of components. This separation is obtained by dividing programs into sub-structures of some kind so that we can think and program each one&lt;br /&gt;
as a reasonably separate and autonomous entity.&lt;br /&gt;
&lt;br /&gt;
When using POP we divide our program into separate functions or procedures and compose the program flow by redirecting it from one to another in what is essentially a linear structure. With OOP a second dimension is added as we structure our code into encapsulated units linked to each other. The control flow is now defined dynamically by the object structure and&lt;br /&gt;
polymorphism. Aspect Oriented programming tries to add a third dimension to this structure by&lt;br /&gt;
describing so called aspects that cross-cut the structure of the program. &lt;br /&gt;
&lt;br /&gt;
==Motivation ==&lt;br /&gt;
Traditional programming designs had poor modularity due to crosscutting dependencies. Especially in OOP each aspect is scattered by virtue of the function being spread over  numerous unrelated functions or modules which maybe using its functionality, this means changing logging in one function requires modifying all the modules using this functionality, this works on the logic that the users knows/maintains a log of all the functions that use the functionality of the aspect&lt;br /&gt;
Example. &lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure1.png|frame|center]]&lt;br /&gt;
&lt;br /&gt;
Let us consider the example all know and love, Twitter. The model for which is shown in figure 1. If this model were to be implemented in an Object Oriented manner then the security aspect like authentication would have been scattered by virtue of a function called a logging, which is used by both the Users and Posts, a database transaction should encapsulate the operation in order to prevent accidental data loss Also, this operation should be logged onto the system log. We already see that authentication together with logging and transactions are now exhibiting cross-cutting concerns. Now consider the scenario in which the security specifications change , then in order to complete these changes this would require a major effort as the security-related operations are scattered across numerous methods.&lt;br /&gt;
&lt;br /&gt;
==Aspect Oriented Programming ==&lt;br /&gt;
Aspect Oriented Programming aims to solve this problem by including the concept called as aspects [http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf 3]. Aspects are stand-alone modules used to express cross-cutting concerns. Figure demonstrates how our twitter module now looks with the inclusion of aspects.&lt;br /&gt;
In Java, the aspects contain advice and intertype declarations.&lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure2.png|frame|center]]        &lt;br /&gt;
In our example our authentication module can include a security check for the users before he/she can access the posts posted by himself and his/her friends. &lt;br /&gt;
&lt;br /&gt;
Key Concepts&lt;br /&gt;
&lt;br /&gt;
Join Points: A well defined location at a point in the execution of a program.&lt;br /&gt;
&lt;br /&gt;
PointCut: A set of join points&lt;br /&gt;
&lt;br /&gt;
Advice: Code designed to run automatically at all join points in a particular pointcut. It can be marked as before, after or around i.e. in place of the join points in the pointcut.&lt;br /&gt;
&lt;br /&gt;
Lexical Introduction: Adding functionality to a class in place as opposed to extending it.&lt;br /&gt;
&lt;br /&gt;
==AspectR==&lt;br /&gt;
Aspect Oriented Programming in Ruby is known as AspectR. [http://www.objectmentor.com/resources/articles/AOP_in_Ruby.pdf 2]&lt;br /&gt;
Aspects such login, security login, database session, transactions need to be done at the start of each method. If for example an application starts a session at the beginning of the application start and releases the resource only at the termination. A lot of resources are wasted and also may cause starvation of other applications. Hence we need frequent access to resources every time a needy method is called. Implementing this logic inside the method makes the aspect code repeated and cluttered all over the application source. To avoid this problem Aspect oriented programming can be adopted into the Ruby applications. Where all the aspect oriented functionality can be placed inside one behaviour. This behaviour can then be called before and after each method invocation. Thus making changes in aspect behaviour easy.&lt;br /&gt;
Aspect oriented programming in Ruby can be implemented using Aquarium framework. &lt;br /&gt;
&lt;br /&gt;
===Creating a Simple Aspect in Ruby===&lt;br /&gt;
Let us understand how easily an aspect behavior can be setup.&lt;br /&gt;
&lt;br /&gt;
===Setup===&lt;br /&gt;
Install Aquarium gem from rubyForge website or alternatively use &amp;quot;gem install aquarium&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
Depending on the requirement of the application the aspect behavior may be changed from the one below. The snippet below shows the skeleton of a typical Aspect definition. &lt;br /&gt;
&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 before :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc      &lt;br /&gt;
 end&lt;br /&gt;
 after :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc  &lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Before advice tells what work needs to be done before the method is called.&lt;br /&gt;
After advice tells what work needs to be done after the method ends.&lt;br /&gt;
&lt;br /&gt;
Another way of implementing is using Around Advice.&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 around :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc&lt;br /&gt;
 result = join_point.proceed&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc&lt;br /&gt;
 result  # block returns the result of the proceed.&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
==Aspect Oriented programming vs Object Oriented Programming==&lt;br /&gt;
Aspect oriented programming is not a complement to Object Oriented programming. It coexists together. AOP tries to lessen the limitations of traditional object oriented programming like cross-cutting in code, dependency in code change in repetitive methods which deal with aspects like logging, authentication and sessions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
Aspect oriented Programming is a programming technique which has added a third dimension to programming languages, which is a significant improvement over Object Oriented Programming as it lets the programmer focus on working on the business logic in times when he has to change his line of thinking mid-way. All this without having to to be worried about his aspect being scattered through the code as all his new code can be incorporated in aspects.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*[1]: [http://en.wikipedia.org/wiki/Aspect-oriented_programming Aspect Oriented Programming]&lt;br /&gt;
&lt;br /&gt;
*[2]: [http://www.objectmentor.com/resources/articles/AOP_in_Ruby.pdf Aspect Oriented Programming in Ruby]&lt;br /&gt;
&lt;br /&gt;
*[3]: [http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf Aspect Oriented Programming, Comparison of Languages]&lt;br /&gt;
&lt;br /&gt;
*[4]: http://www.marvin-steinberg.de/alternative-implementations-for-aspect-oriented-programming-language-constructs-a-case-study-in-ruby/&lt;br /&gt;
&lt;br /&gt;
*[5]: http://www.theserverside.com/news/1364528/Implementing-Object-Caching-with-AOP&lt;br /&gt;
&lt;br /&gt;
*[6]: http://aspectr.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
*[7]: http://www.ironicwolf.com/2009/04/aspect-the-ruby-way/&lt;br /&gt;
&lt;br /&gt;
*[8]: http://rubyforge.org/frs/?group_id=4281&lt;/div&gt;</summary>
		<author><name>Ajain9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=38434</id>
		<title>CSC/ECE 517 Fall 2010/ch3 3d AI</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=38434"/>
		<updated>2010-10-16T03:00:30Z</updated>

		<summary type="html">&lt;p&gt;Ajain9: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Aspect Oriented Programming [http://en.wikipedia.org/wiki/Aspect-oriented_programming 1] is a programming style which isolates the business logic of the program from its secondary or supporting functions. The basis of the aspect oriented programming is to add a third dimension to pre-existing dimensions of the Procedural Programming and Object Oriented Programming, by describing aspects that cross-cut the structure of the program.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
If we look at the programming field from a distance we’ll generally divide programming&lt;br /&gt;
languages into two main camps: procedural programming(POP) and object-oriented programming (OOP). Like all programming techniques these were invented as ways to structure programming to achieve conceptual separation of components. This separation is obtained by dividing programs into sub-structures of some kind so that we can think and program each one&lt;br /&gt;
as a reasonably separate and autonomous entity.&lt;br /&gt;
&lt;br /&gt;
When using POP we divide our program into separate functions or procedures and compose the program flow by redirecting it from one to another in what is essentially a linear structure. With OOP a second dimension is added as we structure our code into encapsulated units linked to each other. The control flow is now defined dynamically by the object structure and&lt;br /&gt;
polymorphism. Aspect Oriented programming tries to add a third dimension to this structure by&lt;br /&gt;
describing so called aspects that cross-cut the structure of the program. &lt;br /&gt;
&lt;br /&gt;
==Motivation ==&lt;br /&gt;
Traditional programming designs had poor modularity due to crosscutting dependencies. Especially in OOP each aspect is scattered by virtue of the function being spread over  numerous unrelated functions or modules which maybe using its functionality, this means changing logging in one function requires modifying all the modules using this functionality, this works on the logic that the users knows/maintains a log of all the functions that use the functionality of the aspect&lt;br /&gt;
Example. &lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure1.png|frame|center]]&lt;br /&gt;
&lt;br /&gt;
Let us consider the example all know and love, Twitter. The model for which is shown in figure 1. If this model were to be implemented in an Object Oriented manner then the security aspect like authentication would have been scattered by virtue of a function called a logging, which is used by both the Users and Posts, a database transaction should encapsulate the operation in order to prevent accidental data loss Also, this operation should be logged onto the system log. We already see that authentication together with logging and transactions are now exhibiting cross-cutting concerns. Now consider the scenario in which the security specifications change , then in order to complete these changes this would require a major effort as the security-related operations are scattered across numerous methods.&lt;br /&gt;
&lt;br /&gt;
==Aspect Oriented Programming ==&lt;br /&gt;
Aspect Oriented Programming aims to solve this problem by including the concept called as aspects [http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf 3]. Aspects are stand-alone modules used to express cross-cutting concerns. Figure demonstrates how our twitter module now looks with the inclusion of aspects.&lt;br /&gt;
In Java, the aspects contain advice and intertype declarations.&lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure2.png|frame|center]]        &lt;br /&gt;
In our example our authentication module can include a security check for the users before he/she can access the posts posted by himself and his/her friends. &lt;br /&gt;
&lt;br /&gt;
Key Concepts&lt;br /&gt;
&lt;br /&gt;
Join Points: A well defined location at a point in the execution of a program.&lt;br /&gt;
&lt;br /&gt;
PointCut: A set of join points&lt;br /&gt;
&lt;br /&gt;
Advice: Code designed to run automatically at all join points in a particular pointcut. It can be marked as before, after or around i.e. in place of the join points in the pointcut.&lt;br /&gt;
&lt;br /&gt;
Lexical Introduction: Adding functionality to a class in place as opposed to extending it.&lt;br /&gt;
&lt;br /&gt;
==AspectR==&lt;br /&gt;
Aspect Oriented Programming in Ruby is known as AspectR. [http://www.objectmentor.com/resources/articles/AOP_in_Ruby.pdf 2]&lt;br /&gt;
Aspects such login, security login, database session, transactions need to be done at the start of each method. If for example an application starts a session at the beginning of the application start and releases the resource only at the termination. A lot of resources are wasted and also may cause starvation of other applications. Hence we need frequent access to resources every time a needy method is called. Implementing this logic inside the method makes the aspect code repeated and cluttered all over the application source. To avoid this problem Aspect oriented programming can be adopted into the Ruby applications. Where all the aspect oriented functionality can be placed inside one behaviour. This behaviour can then be called before and after each method invocation. Thus making changes in aspect behaviour easy.&lt;br /&gt;
Aspect oriented programming in Ruby can be implemented using Aquarium framework. &lt;br /&gt;
&lt;br /&gt;
===Creating a Simple Aspect in Ruby===&lt;br /&gt;
Let us understand how easily an aspect behavior can be setup.&lt;br /&gt;
&lt;br /&gt;
===Setup===&lt;br /&gt;
Install Aquarium gem from rubyForge website or alternatively use &amp;quot;gem install aquarium&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
Depending on the requirement of the application the aspect behavior may be changed from the one below. The snippet below shows the skeleton of a typical Aspect definition. &lt;br /&gt;
&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 before :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc      &lt;br /&gt;
 end&lt;br /&gt;
 after :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc  &lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Before advice tells what work needs to be done before the method is called.&lt;br /&gt;
After advice tells what work needs to be done after the method ends.&lt;br /&gt;
&lt;br /&gt;
Another way of implementing is using Around Advice.&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 around :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc&lt;br /&gt;
 result = join_point.proceed&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc&lt;br /&gt;
 result  # block returns the result of the proceed.&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
==Aspect Oriented programming vs Object Oriented Programming==&lt;br /&gt;
Aspect oriented programming is not a complement to Object Oriented programming. It coexists together. AOP tries to lessen the limitations of traditional object oriented programming like cross-cutting in code, dependency in code change in repetitive methods which deal with aspects like logging, authentication and sessions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
Aspect oriented Programming is a programming technique which has added a third dimension to programming languages, which is a significant improvement over Object Oriented Programming as it lets the programmer focus on working on the business logic in times when he has to change his line of thinking mid-way. All this without having to to be worried about his aspect being scattered through the code as all his new code can be incorporated in aspects.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*[1]: [http://en.wikipedia.org/wiki/Aspect-oriented_programming Aspect Oriented Programming]&lt;br /&gt;
&lt;br /&gt;
*[2]: [http://www.objectmentor.com/resources/articles/AOP_in_Ruby.pdf Aspect Oriented Programming]&lt;br /&gt;
&lt;br /&gt;
*[3]: [http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf Aspect Oriented Programming, Comparison of Languages]&lt;br /&gt;
&lt;br /&gt;
*[4]: http://www.marvin-steinberg.de/alternative-implementations-for-aspect-oriented-programming-language-constructs-a-case-study-in-ruby/&lt;br /&gt;
&lt;br /&gt;
*[5]: http://www.theserverside.com/news/1364528/Implementing-Object-Caching-with-AOP&lt;br /&gt;
&lt;br /&gt;
*[6]: http://aspectr.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
*[7]: http://www.ironicwolf.com/2009/04/aspect-the-ruby-way/&lt;br /&gt;
&lt;br /&gt;
*[8]: http://rubyforge.org/frs/?group_id=4281&lt;/div&gt;</summary>
		<author><name>Ajain9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=38431</id>
		<title>CSC/ECE 517 Fall 2010/ch3 3d AI</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=38431"/>
		<updated>2010-10-16T02:58:34Z</updated>

		<summary type="html">&lt;p&gt;Ajain9: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Aspect Oriented Programming [http://en.wikipedia.org/wiki/Aspect-oriented_programming 1] is a programming style which isolates the business logic of the program from its secondary or supporting functions. The basis of the aspect oriented programming is to add a third dimension to pre-existing dimensions of the Procedural Programming and Object Oriented Programming, by describing aspects that cross-cut the structure of the program.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
If we look at the programming field from a distance we’ll generally divide programming&lt;br /&gt;
languages into two main camps: procedural programming(POP) and object-oriented programming (OOP). Like all programming techniques these were invented as ways to structure programming to achieve conceptual separation of components. This separation is obtained by dividing programs into sub-structures of some kind so that we can think and program each one&lt;br /&gt;
as a reasonably separate and autonomous entity.&lt;br /&gt;
&lt;br /&gt;
When using POP we divide our program into separate functions or procedures and compose the program flow by redirecting it from one to another in what is essentially a linear structure. With OOP a second dimension is added as we structure our code into encapsulated units linked to each other. The control flow is now defined dynamically by the object structure and&lt;br /&gt;
polymorphism. Aspect Oriented programming tries to add a third dimension to this structure by&lt;br /&gt;
describing so called aspects that cross-cut the structure of the program. &lt;br /&gt;
&lt;br /&gt;
==Motivation ==&lt;br /&gt;
Traditional programming designs had poor modularity due to crosscutting dependencies. Especially in OOP each aspect is scattered by virtue of the function being spread over  numerous unrelated functions or modules which maybe using its functionality, this means changing logging in one function requires modifying all the modules using this functionality, this works on the logic that the users knows/maintains a log of all the functions that use the functionality of the aspect&lt;br /&gt;
Example. &lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure1.png|frame|center]]&lt;br /&gt;
&lt;br /&gt;
Let us consider the example all know and love, Twitter. The model for which is shown in figure 1. If this model were to be implemented in an Object Oriented manner then the security aspect like authentication would have been scattered by virtue of a function called a logging, which is used by both the Users and Posts, a database transaction should encapsulate the operation in order to prevent accidental data loss Also, this operation should be logged onto the system log. We already see that authentication together with logging and transactions are now exhibiting cross-cutting concerns. Now consider the scenario in which the security specifications change , then in order to complete these changes this would require a major effort as the security-related operations are scattered across numerous methods.&lt;br /&gt;
&lt;br /&gt;
==Aspect Oriented Programming ==&lt;br /&gt;
Aspect Oriented Programming aims to solve this problem by including the concept called as aspects [http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf 3]. Aspects are stand-alone modules used to express cross-cutting concerns. Figure demonstrates how our twitter module now looks with the inclusion of aspects.&lt;br /&gt;
In Java, the aspects contain advice and intertype declarations.&lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure2.png|frame|center]]        &lt;br /&gt;
In our example our authentication module can include a security check for the users before he/she can access the posts posted by himself and his/her friends. &lt;br /&gt;
&lt;br /&gt;
Key Concepts&lt;br /&gt;
&lt;br /&gt;
Join Points: A well defined location at a point in the execution of a program.&lt;br /&gt;
&lt;br /&gt;
PointCut: A set of join points&lt;br /&gt;
&lt;br /&gt;
Advice: Code designed to run automatically at all join points in a particular pointcut. It can be marked as before, after or around i.e. in place of the join points in the pointcut.&lt;br /&gt;
&lt;br /&gt;
Lexical Introduction: Adding functionality to a class in place as opposed to extending it.&lt;br /&gt;
&lt;br /&gt;
==AspectR==&lt;br /&gt;
Aspect Oriented Programming in Ruby is known as AspectR. [http://www.objectmentor.com/resources/articles/AOP_in_Ruby.pdf 2]&lt;br /&gt;
Aspects such login, security login, database session, transactions need to be done at the start of each method. If for example an application starts a session at the beginning of the application start and releases the resource only at the termination. A lot of resources are wasted and also may cause starvation of other applications. Hence we need frequent access to resources every time a needy method is called. Implementing this logic inside the method makes the aspect code repeated and cluttered all over the application source. To avoid this problem Aspect oriented programming can be adopted into the Ruby applications. Where all the aspect oriented functionality can be placed inside one behaviour. This behaviour can then be called before and after each method invocation. Thus making changes in aspect behaviour easy.&lt;br /&gt;
Aspect oriented programming in Ruby can be implemented using Aquarium framework. &lt;br /&gt;
&lt;br /&gt;
===Creating a Simple Aspect in Ruby===&lt;br /&gt;
Let us understand how easily an aspect behavior can be setup.&lt;br /&gt;
&lt;br /&gt;
===Setup===&lt;br /&gt;
Install Aquarium gem from rubyForge website or alternatively use &amp;quot;gem install aquarium&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
Depending on the requirement of the application the aspect behavior may be changed from the one below. The snippet below shows the skeleton of a typical Aspect definition. &lt;br /&gt;
&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 before :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc      &lt;br /&gt;
 end&lt;br /&gt;
 after :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc  &lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Before advice tells what work needs to be done before the method is called.&lt;br /&gt;
After advice tells what work needs to be done after the method ends.&lt;br /&gt;
&lt;br /&gt;
Another way of implementing is using Around Advice.&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 around :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc&lt;br /&gt;
 result = join_point.proceed&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc&lt;br /&gt;
 result  # block returns the result of the proceed.&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
==Aspect Oriented programming vs Object Oriented Programming==&lt;br /&gt;
Aspect oriented programming is not a complement to Object Oriented programming. It coexists together. AOP tries to lessen the limitations of traditional object oriented programming like cross-cutting in code, dependency in code change in repetitive methods which deal with aspects like logging, authentication and sessions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
Aspect oriented Programming is a programming technique which has added a third dimension to programming languages, which is a significant improvement over Object Oriented Programming as it lets the programmer focus on working on the business logic in times when he has to change his line of thinking mid-way. All this without having to to be worried about his aspect being scattered through the code as all his new code can be incorporated in aspects.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*[1]: http://en.wikipedia.org/wiki/Aspect-oriented_programming&lt;br /&gt;
&lt;br /&gt;
*[2]: http://www.objectmentor.com/resources/articles/AOP_in_Ruby.pdf&lt;br /&gt;
&lt;br /&gt;
*[3]: http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf&lt;br /&gt;
&lt;br /&gt;
*[4]: http://www.marvin-steinberg.de/alternative-implementations-for-aspect-oriented-programming-language-constructs-a-case-study-in-ruby/&lt;br /&gt;
&lt;br /&gt;
*[5]: http://www.theserverside.com/news/1364528/Implementing-Object-Caching-with-AOP&lt;br /&gt;
&lt;br /&gt;
*[6]: http://aspectr.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
*[7]: http://www.ironicwolf.com/2009/04/aspect-the-ruby-way/&lt;br /&gt;
&lt;br /&gt;
*[8]: http://rubyforge.org/frs/?group_id=4281&lt;/div&gt;</summary>
		<author><name>Ajain9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=38430</id>
		<title>CSC/ECE 517 Fall 2010/ch3 3d AI</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=38430"/>
		<updated>2010-10-16T02:55:28Z</updated>

		<summary type="html">&lt;p&gt;Ajain9: /* Aspect Oriented Programming */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Aspect Oriented Programming [http://en.wikipedia.org/wiki/Aspect-oriented_programming 1] is a programming style which isolates the business logic of the program from its secondary or supporting functions. The basis of the aspect oriented programming is to add a third dimension to pre-existing dimensions of the Procedural Programming and Object Oriented Programming, by describing aspects that cross-cut the structure of the program.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
If we look at the programming field from a distance we’ll generally divide programming&lt;br /&gt;
languages into two main camps: procedural programming(POP) and object-oriented programming (OOP). Like all programming techniques these were invented as ways to structure programming to achieve conceptual separation of components. This separation is obtained by dividing programs into sub-structures of some kind so that we can think and program each one&lt;br /&gt;
as a reasonably separate and autonomous entity.&lt;br /&gt;
&lt;br /&gt;
When using POP we divide our program into separate functions or procedures and compose the program flow by redirecting it from one to another in what is essentially a linear structure. With OOP a second dimension is added as we structure our code into encapsulated units linked to each other. The control flow is now defined dynamically by the object structure and&lt;br /&gt;
polymorphism. Aspect Oriented programming tries to add a third dimension to this structure by&lt;br /&gt;
describing so called aspects that cross-cut the structure of the program. &lt;br /&gt;
&lt;br /&gt;
==Motivation ==&lt;br /&gt;
Traditional programming designs had poor modularity due to crosscutting dependencies. Especially in OOP each aspect is scattered by virtue of the function being spread over  numerous unrelated functions or modules which maybe using its functionality, this means changing logging in one function requires modifying all the modules using this functionality, this works on the logic that the users knows/maintains a log of all the functions that use the functionality of the aspect&lt;br /&gt;
Example. &lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure1.png|frame|center]]&lt;br /&gt;
&lt;br /&gt;
Let us consider the example all know and love, Twitter. The model for which is shown in figure 1. If this model were to be implemented in an Object Oriented manner then the security aspect like authentication would have been scattered by virtue of a function called a logging, which is used by both the Users and Posts, a database transaction should encapsulate the operation in order to prevent accidental data loss Also, this operation should be logged onto the system log. We already see that authentication together with logging and transactions are now exhibiting cross-cutting concerns. Now consider the scenario in which the security specifications change , then in order to complete these changes this would require a major effort as the security-related operations are scattered across numerous methods.&lt;br /&gt;
&lt;br /&gt;
==Aspect Oriented Programming ==&lt;br /&gt;
Aspect Oriented Programming aims to solve this problem by including the concept called as aspects [http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf 3]. Aspects are stand-alone modules used to express cross-cutting concerns. Figure demonstrates how our twitter module now looks with the inclusion of aspects.&lt;br /&gt;
In Java, the aspects contain advice and intertype declarations.&lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure2.png|frame|center]]        &lt;br /&gt;
In our example our authentication module can include a security check for the users before he/she can access the posts posted by himself and his/her friends. &lt;br /&gt;
&lt;br /&gt;
Key Concepts&lt;br /&gt;
&lt;br /&gt;
Join Points: A well defined location at a point in the execution of a program.&lt;br /&gt;
&lt;br /&gt;
PointCut: A set of join points&lt;br /&gt;
&lt;br /&gt;
Advice: Code designed to run automatically at all join points in a particular pointcut. It can be marked as before, after or around i.e. in place of the join points in the pointcut.&lt;br /&gt;
&lt;br /&gt;
Lexical Introduction: Adding functionality to a class in place as opposed to extending it.&lt;br /&gt;
&lt;br /&gt;
==AspectR==&lt;br /&gt;
Aspect Oriented Programming in Ruby is known as AspectR. [http://www.objectmentor.com/resources/articles/AOP_in_Ruby.pdf 2]&lt;br /&gt;
Aspects such login, security login, database session, transactions need to be done at the start of each method. If for example an application starts a session at the beginning of the application start and releases the resource only at the termination. A lot of resources are wasted and also may cause starvation of other applications. Hence we need frequent access to resources every time a needy method is called. Implementing this logic inside the method makes the aspect code repeated and cluttered all over the application source. To avoid this problem Aspect oriented programming can be adopted into the Ruby applications. Where all the aspect oriented functionality can be placed inside one behaviour. This behaviour can then be called before and after each method invocation. Thus making changes in aspect behaviour easy.&lt;br /&gt;
Aspect oriented programming in Ruby can be implemented using Aquarium framework. &lt;br /&gt;
&lt;br /&gt;
===Creating a Simple Aspect in Ruby===&lt;br /&gt;
Let us understand how easily an aspect behavior can be setup.&lt;br /&gt;
&lt;br /&gt;
===Setup===&lt;br /&gt;
Install Aquarium gem from rubyForge website or alternatively use &amp;quot;gem install aquarium&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
Depending on the requirement of the application the aspect behavior may be changed from the one below. The snippet below shows the skeleton of a typical Aspect definition. &lt;br /&gt;
&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 before :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc      &lt;br /&gt;
 end&lt;br /&gt;
 after :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc  &lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Before advice tells what work needs to be done before the method is called.&lt;br /&gt;
After advice tells what work needs to be done after the method ends.&lt;br /&gt;
&lt;br /&gt;
Another way of implementing is using Around Advice.&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 around :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc&lt;br /&gt;
 result = join_point.proceed&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc&lt;br /&gt;
 result  # block returns the result of the proceed.&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
==Aspect Oriented programming vs Object Oriented Programming==&lt;br /&gt;
Aspect oriented programming is not a complement to Object Oriented programming. It coexists together. AOP tries to lessen the limitations of traditional object oriented programming like cross-cutting in code, dependency in code change in repetitive methods which deal with aspects like logging, authentication and sessions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
Aspect oriented Programming is a programming technique which has added a third dimension to programming languages, which is a significant improvement over Object Oriented Programming as it lets the programmer focus on working on the business logic in times when he has to change his line of thinking mid-way. All this without having to to be worried about his aspect being scattered through the code as all his new code can be incorporated in aspects.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*[1]: http://en.wikipedia.org/wiki/Aspect-oriented_programming&lt;br /&gt;
&lt;br /&gt;
*[2]: http://www.objectmentor.com/resources/articles/AOP_in_Ruby.pdf&lt;br /&gt;
&lt;br /&gt;
*[3]: http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf&lt;br /&gt;
&lt;br /&gt;
*[4]: http://www.cs.virginia.edu/~sullivan/&lt;br /&gt;
&lt;br /&gt;
*[5]: http://www.marvin-steinberg.de/alternative-implementations-for-aspect-oriented-programming-language-constructs-a-case-study-in-ruby/&lt;br /&gt;
&lt;br /&gt;
*[6]: http://www.theserverside.com/news/1364528/Implementing-Object-Caching-with-AOP&lt;br /&gt;
&lt;br /&gt;
*[7]: http://aspectr.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
*[8]: http://www.ironicwolf.com/2009/04/aspect-the-ruby-way/&lt;br /&gt;
&lt;br /&gt;
*[9]: http://rubyforge.org/frs/?group_id=4281&lt;/div&gt;</summary>
		<author><name>Ajain9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=38429</id>
		<title>CSC/ECE 517 Fall 2010/ch3 3d AI</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=38429"/>
		<updated>2010-10-16T02:52:30Z</updated>

		<summary type="html">&lt;p&gt;Ajain9: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Aspect Oriented Programming [http://en.wikipedia.org/wiki/Aspect-oriented_programming 1] is a programming style which isolates the business logic of the program from its secondary or supporting functions. The basis of the aspect oriented programming is to add a third dimension to pre-existing dimensions of the Procedural Programming and Object Oriented Programming, by describing aspects that cross-cut the structure of the program.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
If we look at the programming field from a distance we’ll generally divide programming&lt;br /&gt;
languages into two main camps: procedural programming(POP) and object-oriented programming (OOP). Like all programming techniques these were invented as ways to structure programming to achieve conceptual separation of components. This separation is obtained by dividing programs into sub-structures of some kind so that we can think and program each one&lt;br /&gt;
as a reasonably separate and autonomous entity.&lt;br /&gt;
&lt;br /&gt;
When using POP we divide our program into separate functions or procedures and compose the program flow by redirecting it from one to another in what is essentially a linear structure. With OOP a second dimension is added as we structure our code into encapsulated units linked to each other. The control flow is now defined dynamically by the object structure and&lt;br /&gt;
polymorphism. Aspect Oriented programming tries to add a third dimension to this structure by&lt;br /&gt;
describing so called aspects that cross-cut the structure of the program. &lt;br /&gt;
&lt;br /&gt;
==Motivation ==&lt;br /&gt;
Traditional programming designs had poor modularity due to crosscutting dependencies. Especially in OOP each aspect is scattered by virtue of the function being spread over  numerous unrelated functions or modules which maybe using its functionality, this means changing logging in one function requires modifying all the modules using this functionality, this works on the logic that the users knows/maintains a log of all the functions that use the functionality of the aspect&lt;br /&gt;
Example. &lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure1.png|frame|center]]&lt;br /&gt;
&lt;br /&gt;
Let us consider the example all know and love, Twitter. The model for which is shown in figure 1. If this model were to be implemented in an Object Oriented manner then the security aspect like authentication would have been scattered by virtue of a function called a logging, which is used by both the Users and Posts, a database transaction should encapsulate the operation in order to prevent accidental data loss Also, this operation should be logged onto the system log. We already see that authentication together with logging and transactions are now exhibiting cross-cutting concerns. Now consider the scenario in which the security specifications change , then in order to complete these changes this would require a major effort as the security-related operations are scattered across numerous methods.&lt;br /&gt;
&lt;br /&gt;
==Aspect Oriented Programming ==&lt;br /&gt;
Aspect Oriented Programming aims to solve this problem by including the concept called as aspects. Aspects are stand-alone modules used to express cross-cutting concerns. Figure demonstrates how our twitter module now looks with the inclusion of aspects.&lt;br /&gt;
In Java, the aspects contain advice and intertype declarations.&lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure2.png|frame|center]]        &lt;br /&gt;
In our example our authentication module can include a security check for the users before he/she can access the posts posted by himself and his/her friends. &lt;br /&gt;
&lt;br /&gt;
Key Concepts&lt;br /&gt;
&lt;br /&gt;
Join Points: A well defined location at a point in the execution of a program.&lt;br /&gt;
&lt;br /&gt;
PointCut: A set of join points&lt;br /&gt;
&lt;br /&gt;
Advice: Code designed to run automatically at all join points in a particular pointcut. It can be marked as before, after or around i.e. in place of the join points in the pointcut.&lt;br /&gt;
&lt;br /&gt;
Lexical Introduction: Adding functionality to a class in place as opposed to extending it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==AspectR==&lt;br /&gt;
Aspect Oriented Programming in Ruby is known as AspectR. [http://www.objectmentor.com/resources/articles/AOP_in_Ruby.pdf 2]&lt;br /&gt;
Aspects such login, security login, database session, transactions need to be done at the start of each method. If for example an application starts a session at the beginning of the application start and releases the resource only at the termination. A lot of resources are wasted and also may cause starvation of other applications. Hence we need frequent access to resources every time a needy method is called. Implementing this logic inside the method makes the aspect code repeated and cluttered all over the application source. To avoid this problem Aspect oriented programming can be adopted into the Ruby applications. Where all the aspect oriented functionality can be placed inside one behaviour. This behaviour can then be called before and after each method invocation. Thus making changes in aspect behaviour easy.&lt;br /&gt;
Aspect oriented programming in Ruby can be implemented using Aquarium framework. &lt;br /&gt;
&lt;br /&gt;
===Creating a Simple Aspect in Ruby===&lt;br /&gt;
Let us understand how easily an aspect behavior can be setup.&lt;br /&gt;
&lt;br /&gt;
===Setup===&lt;br /&gt;
Install Aquarium gem from rubyForge website or alternatively use &amp;quot;gem install aquarium&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
Depending on the requirement of the application the aspect behavior may be changed from the one below. The snippet below shows the skeleton of a typical Aspect definition. &lt;br /&gt;
&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 before :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc      &lt;br /&gt;
 end&lt;br /&gt;
 after :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc  &lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Before advice tells what work needs to be done before the method is called.&lt;br /&gt;
After advice tells what work needs to be done after the method ends.&lt;br /&gt;
&lt;br /&gt;
Another way of implementing is using Around Advice.&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 around :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc&lt;br /&gt;
 result = join_point.proceed&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc&lt;br /&gt;
 result  # block returns the result of the proceed.&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
==Aspect Oriented programming vs Object Oriented Programming==&lt;br /&gt;
Aspect oriented programming is not a complement to Object Oriented programming. It coexists together. AOP tries to lessen the limitations of traditional object oriented programming like cross-cutting in code, dependency in code change in repetitive methods which deal with aspects like logging, authentication and sessions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
Aspect oriented Programming is a programming technique which has added a third dimension to programming languages, which is a significant improvement over Object Oriented Programming as it lets the programmer focus on working on the business logic in times when he has to change his line of thinking mid-way. All this without having to to be worried about his aspect being scattered through the code as all his new code can be incorporated in aspects.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*[1]: http://en.wikipedia.org/wiki/Aspect-oriented_programming&lt;br /&gt;
&lt;br /&gt;
*[2]: http://www.objectmentor.com/resources/articles/AOP_in_Ruby.pdf&lt;br /&gt;
&lt;br /&gt;
*[3]: http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf&lt;br /&gt;
&lt;br /&gt;
*[4]: http://www.cs.virginia.edu/~sullivan/&lt;br /&gt;
&lt;br /&gt;
*[5]: http://www.marvin-steinberg.de/alternative-implementations-for-aspect-oriented-programming-language-constructs-a-case-study-in-ruby/&lt;br /&gt;
&lt;br /&gt;
*[6]: http://www.theserverside.com/news/1364528/Implementing-Object-Caching-with-AOP&lt;br /&gt;
&lt;br /&gt;
*[7]: http://aspectr.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
*[8]: http://www.ironicwolf.com/2009/04/aspect-the-ruby-way/&lt;br /&gt;
&lt;br /&gt;
*[9]: http://rubyforge.org/frs/?group_id=4281&lt;/div&gt;</summary>
		<author><name>Ajain9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=38427</id>
		<title>CSC/ECE 517 Fall 2010/ch3 3d AI</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=38427"/>
		<updated>2010-10-16T02:51:41Z</updated>

		<summary type="html">&lt;p&gt;Ajain9: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Aspect Oriented Programming [http://en.wikipedia.org/wiki/Aspect-oriented_programming 1] is a programming style which isolates the business logic of the program from its secondary or supporting functions. The basis of the aspect oriented programming is to add a third dimension to pre-existing dimensions of the Procedural Programming and Object Oriented Programming, by describing aspects that cross-cut the structure of the program.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
If we look at the programming field from a distance we’ll generally divide programming&lt;br /&gt;
languages into two main camps: procedural programming(POP) and object-oriented programming (OOP). Like all programming techniques these were invented as ways to structure programming to achieve conceptual separation of components. This separation is obtained by dividing programs into sub-structures of some kind so that we can think and program each one&lt;br /&gt;
as a reasonably separate and autonomous entity.&lt;br /&gt;
&lt;br /&gt;
When using POP we divide our program into separate functions or procedures and compose the program flow by redirecting it from one to another in what is essentially a linear structure. With OOP a second dimension is added as we structure our code into encapsulated units linked to each other. The control flow is now defined dynamically by the object structure and&lt;br /&gt;
polymorphism. Aspect Oriented programming tries to add a third dimension to this structure by&lt;br /&gt;
describing so called aspects that cross-cut the structure of the program. &lt;br /&gt;
&lt;br /&gt;
==Motivation ==&lt;br /&gt;
Traditional programming designs had poor modularity due to crosscutting dependencies. Especially in OOP each aspect is scattered by virtue of the function being spread over  numerous unrelated functions or modules which maybe using its functionality, this means changing logging in one function requires modifying all the modules using this functionality, this works on the logic that the users knows/maintains a log of all the functions that use the functionality of the aspect&lt;br /&gt;
Example. &lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure1.png|frame|center]]&lt;br /&gt;
&lt;br /&gt;
Let us consider the example all know and love, Twitter. The model for which is shown in figure 1. If this model were to be implemented in an Object Oriented manner then the security aspect like authentication would have been scattered by virtue of a function called a logging, which is used by both the Users and Posts, a database transaction should encapsulate the operation in order to prevent accidental data loss Also, this operation should be logged onto the system log. We already see that authentication together with logging and transactions are now exhibiting cross-cutting concerns. Now consider the scenario in which the security specifications change , then in order to complete these changes this would require a major effort as the security-related operations are scattered across numerous methods.&lt;br /&gt;
&lt;br /&gt;
==Aspect Oriented Programming ==&lt;br /&gt;
Aspect Oriented Programming aims to solve this problem by including the concept called as aspects. Aspects are stand-alone modules used to express cross-cutting concerns. Figure demonstrates how our twitter module now looks with the inclusion of aspects.&lt;br /&gt;
In Java, the aspects contain advice and intertype declarations.&lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure2.png|frame|center]]        &lt;br /&gt;
In our example our authentication module can include a security check for the users before he/she can access the posts posted by himself and his/her friends. &lt;br /&gt;
&lt;br /&gt;
Key Concepts&lt;br /&gt;
&lt;br /&gt;
Join Points: A well defined location at a point in the execution of a program.&lt;br /&gt;
&lt;br /&gt;
PointCut: A set of join points&lt;br /&gt;
&lt;br /&gt;
Advice: Code designed to run automatically at all join points in a particular pointcut. It can be marked as before, after or around i.e. in place of the join points in the pointcut.&lt;br /&gt;
&lt;br /&gt;
Lexical Introduction: Adding functionality to a class in place as opposed to extending it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==AspectR==&lt;br /&gt;
Aspect Oriented Programming in Ruby is known as AspectR.&lt;br /&gt;
Aspects such login, security login, database session, transactions need to be done at the start of each method. If for example an application starts a session at the beginning of the application start and releases the resource only at the termination. A lot of resources are wasted and also may cause starvation of other applications. Hence we need frequent access to resources every time a needy method is called. Implementing this logic inside the method makes the aspect code repeated and cluttered all over the application source. To avoid this problem Aspect oriented programming can be adopted into the Ruby applications. Where all the aspect oriented functionality can be placed inside one behaviour. This behaviour can then be called before and after each method invocation. Thus making changes in aspect behaviour easy.&lt;br /&gt;
Aspect oriented programming in Ruby can be implemented using Aquarium framework. &lt;br /&gt;
&lt;br /&gt;
===Creating a Simple Aspect in Ruby===&lt;br /&gt;
Let us understand how easily an aspect behavior can be setup.&lt;br /&gt;
&lt;br /&gt;
===Setup===&lt;br /&gt;
Install Aquarium gem from rubyForge website or alternatively use &amp;quot;gem install aquarium&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
Depending on the requirement of the application the aspect behavior may be changed from the one below. The snippet below shows the skeleton of a typical Aspect definition. &lt;br /&gt;
&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 before :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc      &lt;br /&gt;
 end&lt;br /&gt;
 after :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc  &lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Before advice tells what work needs to be done before the method is called.&lt;br /&gt;
After advice tells what work needs to be done after the method ends.&lt;br /&gt;
&lt;br /&gt;
Another way of implementing is using Around Advice.&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 around :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc&lt;br /&gt;
 result = join_point.proceed&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc&lt;br /&gt;
 result  # block returns the result of the proceed.&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
==Aspect Oriented programming vs Object Oriented Programming==&lt;br /&gt;
Aspect oriented programming is not a complement to Object Oriented programming. It coexists together. AOP tries to lessen the limitations of traditional object oriented programming like cross-cutting in code, dependency in code change in repetitive methods which deal with aspects like logging, authentication and sessions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
Aspect oriented Programming is a programming technique which has added a third dimension to programming languages, which is a significant improvement over Object Oriented Programming as it lets the programmer focus on working on the business logic in times when he has to change his line of thinking mid-way. All this without having to to be worried about his aspect being scattered through the code as all his new code can be incorporated in aspects.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*[1]: http://en.wikipedia.org/wiki/Aspect-oriented_programming&lt;br /&gt;
&lt;br /&gt;
*[2]: http://www.objectmentor.com/resources/articles/AOP_in_Ruby.pdf&lt;br /&gt;
&lt;br /&gt;
*[3]: http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf&lt;br /&gt;
&lt;br /&gt;
*[4]: http://www.cs.virginia.edu/~sullivan/&lt;br /&gt;
&lt;br /&gt;
*[5]: http://www.marvin-steinberg.de/alternative-implementations-for-aspect-oriented-programming-language-constructs-a-case-study-in-ruby/&lt;br /&gt;
&lt;br /&gt;
*[6]: http://www.theserverside.com/news/1364528/Implementing-Object-Caching-with-AOP&lt;br /&gt;
&lt;br /&gt;
*[7]: http://aspectr.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
*[8]: http://www.ironicwolf.com/2009/04/aspect-the-ruby-way/&lt;br /&gt;
&lt;br /&gt;
*[9]: http://rubyforge.org/frs/?group_id=4281&lt;/div&gt;</summary>
		<author><name>Ajain9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=38424</id>
		<title>CSC/ECE 517 Fall 2010/ch3 3d AI</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=38424"/>
		<updated>2010-10-16T02:50:22Z</updated>

		<summary type="html">&lt;p&gt;Ajain9: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Aspect Oriented Programming [1] is a programming style which isolates the business logic of the program from its secondary or supporting functions. The basis of the aspect oriented programming is to add a third dimension to pre-existing dimensions of the Procedural Programming and Object Oriented Programming, by describing aspects that cross-cut the structure of the program.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
If we look at the programming field from a distance we’ll generally divide programming&lt;br /&gt;
languages into two main camps: procedural programming(POP) and object-oriented programming (OOP). Like all programming techniques these were invented as ways to structure programming to achieve conceptual separation of components. This separation is obtained by dividing programs into sub-structures of some kind so that we can think and program each one&lt;br /&gt;
as a reasonably separate and autonomous entity.&lt;br /&gt;
&lt;br /&gt;
When using POP we divide our program into separate functions or procedures and compose the program flow by redirecting it from one to another in what is essentially a linear structure. With OOP a second dimension is added as we structure our code into encapsulated units linked to each other. The control flow is now defined dynamically by the object structure and&lt;br /&gt;
polymorphism. Aspect Oriented programming tries to add a third dimension to this structure by&lt;br /&gt;
describing so called aspects that cross-cut the structure of the program. &lt;br /&gt;
&lt;br /&gt;
==Motivation ==&lt;br /&gt;
Traditional programming designs had poor modularity due to crosscutting dependencies. Especially in OOP each aspect is scattered by virtue of the function being spread over  numerous unrelated functions or modules which maybe using its functionality, this means changing logging in one function requires modifying all the modules using this functionality, this works on the logic that the users knows/maintains a log of all the functions that use the functionality of the aspect&lt;br /&gt;
Example. &lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure1.png|frame|center]]&lt;br /&gt;
&lt;br /&gt;
Let us consider the example all know and love, Twitter. The model for which is shown in figure 1. If this model were to be implemented in an Object Oriented manner then the security aspect like authentication would have been scattered by virtue of a function called a logging, which is used by both the Users and Posts, a database transaction should encapsulate the operation in order to prevent accidental data loss Also, this operation should be logged onto the system log. We already see that authentication together with logging and transactions are now exhibiting cross-cutting concerns. Now consider the scenario in which the security specifications change , then in order to complete these changes this would require a major effort as the security-related operations are scattered across numerous methods.&lt;br /&gt;
&lt;br /&gt;
==Aspect Oriented Programming ==&lt;br /&gt;
Aspect Oriented Programming aims to solve this problem by including the concept called as aspects. Aspects are stand-alone modules used to express cross-cutting concerns. Figure demonstrates how our twitter module now looks with the inclusion of aspects.&lt;br /&gt;
In Java, the aspects contain advice and intertype declarations.&lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure2.png|frame|center]]        &lt;br /&gt;
In our example our authentication module can include a security check for the users before he/she can access the posts posted by himself and his/her friends. &lt;br /&gt;
&lt;br /&gt;
Key Concepts&lt;br /&gt;
&lt;br /&gt;
Join Points: A well defined location at a point in the execution of a program.&lt;br /&gt;
&lt;br /&gt;
PointCut: A set of join points&lt;br /&gt;
&lt;br /&gt;
Advice: Code designed to run automatically at all join points in a particular pointcut. It can be marked as before, after or around i.e. in place of the join points in the pointcut.&lt;br /&gt;
&lt;br /&gt;
Lexical Introduction: Adding functionality to a class in place as opposed to extending it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==AspectR==&lt;br /&gt;
Aspect Oriented Programming in Ruby is known as AspectR.&lt;br /&gt;
Aspects such login, security login, database session, transactions need to be done at the start of each method. If for example an application starts a session at the beginning of the application start and releases the resource only at the termination. A lot of resources are wasted and also may cause starvation of other applications. Hence we need frequent access to resources every time a needy method is called. Implementing this logic inside the method makes the aspect code repeated and cluttered all over the application source. To avoid this problem Aspect oriented programming can be adopted into the Ruby applications. Where all the aspect oriented functionality can be placed inside one behaviour. This behaviour can then be called before and after each method invocation. Thus making changes in aspect behaviour easy.&lt;br /&gt;
Aspect oriented programming in Ruby can be implemented using Aquarium framework. &lt;br /&gt;
&lt;br /&gt;
===Creating a Simple Aspect in Ruby===&lt;br /&gt;
Let us understand how easily an aspect behavior can be setup.&lt;br /&gt;
&lt;br /&gt;
===Setup===&lt;br /&gt;
Install Aquarium gem from rubyForge website or alternatively use &amp;quot;gem install aquarium&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
Depending on the requirement of the application the aspect behavior may be changed from the one below. The snippet below shows the skeleton of a typical Aspect definition. &lt;br /&gt;
&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 before :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc      &lt;br /&gt;
 end&lt;br /&gt;
 after :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc  &lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Before advice tells what work needs to be done before the method is called.&lt;br /&gt;
After advice tells what work needs to be done after the method ends.&lt;br /&gt;
&lt;br /&gt;
Another way of implementing is using Around Advice.&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 around :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc&lt;br /&gt;
 result = join_point.proceed&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc&lt;br /&gt;
 result  # block returns the result of the proceed.&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
==Aspect Oriented programming vs Object Oriented Programming==&lt;br /&gt;
Aspect oriented programming is not a complement to Object Oriented programming. It coexists together. AOP tries to lessen the limitations of traditional object oriented programming like cross-cutting in code, dependency in code change in repetitive methods which deal with aspects like logging, authentication and sessions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
Aspect oriented Programming is a programming technique which has added a third dimension to programming languages, which is a significant improvement over Object Oriented Programming as it lets the programmer focus on working on the business logic in times when he has to change his line of thinking mid-way. All this without having to to be worried about his aspect being scattered through the code as all his new code can be incorporated in aspects.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*[1]: http://en.wikipedia.org/wiki/Aspect-oriented_programming&lt;br /&gt;
&lt;br /&gt;
*[2]: http://www.objectmentor.com/resources/articles/AOP_in_Ruby.pdf&lt;br /&gt;
&lt;br /&gt;
*[3]: http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf&lt;br /&gt;
&lt;br /&gt;
*[4]: http://www.cs.virginia.edu/~sullivan/&lt;br /&gt;
&lt;br /&gt;
*[5]: http://www.marvin-steinberg.de/alternative-implementations-for-aspect-oriented-programming-language-constructs-a-case-study-in-ruby/&lt;br /&gt;
&lt;br /&gt;
*[6]: http://www.theserverside.com/news/1364528/Implementing-Object-Caching-with-AOP&lt;br /&gt;
&lt;br /&gt;
*[7]: http://aspectr.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
*[8]: http://www.ironicwolf.com/2009/04/aspect-the-ruby-way/&lt;br /&gt;
&lt;br /&gt;
*[9]: http://rubyforge.org/frs/?group_id=4281&lt;/div&gt;</summary>
		<author><name>Ajain9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=38418</id>
		<title>CSC/ECE 517 Fall 2010/ch3 3d AI</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=38418"/>
		<updated>2010-10-16T02:43:38Z</updated>

		<summary type="html">&lt;p&gt;Ajain9: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Aspect Oriented Programming is a programming style which isolates the business logic of the program from its secondary or supporting functions. The basis of the aspect oriented programming is to add a third dimension to pre-existing dimensions of the Procedural Programming and Object Oriented Programming, by describing aspects that cross-cut the structure of the program.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
If we look at the programming field from a distance we’ll generally divide programming&lt;br /&gt;
languages into two main camps: procedural programming(POP) and object-oriented programming (OOP). Like all programming techniques these were invented as ways to structure programming to achieve conceptual separation of components. This separation is obtained by dividing programs into sub-structures of some kind so that we can think and program each one&lt;br /&gt;
as a reasonably separate and autonomous entity.&lt;br /&gt;
&lt;br /&gt;
When using POP we divide our program into separate functions or procedures and compose the program flow by redirecting it from one to another in what is essentially a linear structure. With OOP a second dimension is added as we structure our code into encapsulated units linked to each other. The control flow is now defined dynamically by the object structure and&lt;br /&gt;
polymorphism. Aspect Oriented programming tries to add a third dimension to this structure by&lt;br /&gt;
describing so called aspects that cross-cut the structure of the program. &lt;br /&gt;
&lt;br /&gt;
==Motivation ==&lt;br /&gt;
Traditional programming designs had poor modularity due to crosscutting dependencies. Especially in OOP each aspect is scattered by virtue of the function being spread over  numerous unrelated functions or modules which maybe using its functionality, this means changing logging in one function requires modifying all the modules using this functionality, this works on the logic that the users knows/maintains a log of all the functions that use the functionality of the aspect&lt;br /&gt;
Example. &lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure1.png|frame|center]]&lt;br /&gt;
&lt;br /&gt;
Let us consider the example all know and love, Twitter. The model for which is shown in figure 1. If this model were to be implemented in an Object Oriented manner then the security aspect like authentication would have been scattered by virtue of a function called a logging, which is used by both the Users and Posts, a database transaction should encapsulate the operation in order to prevent accidental data loss Also, this operation should be logged onto the system log. We already see that authentication together with logging and transactions are now exhibiting cross-cutting concerns. Now consider the scenario in which the security specifications change , then in order to complete these changes this would require a major effort as the security-related operations are scattered across numerous methods.&lt;br /&gt;
&lt;br /&gt;
==Aspect Oriented Programming ==&lt;br /&gt;
Aspect Oriented Programming aims to solve this problem by including the concept called as aspects. Aspects are stand-alone modules used to express cross-cutting concerns. Figure demonstrates how our twitter module now looks with the inclusion of aspects.&lt;br /&gt;
In Java, the aspects contain advice and intertype declarations.&lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure2.png|frame|center]]        &lt;br /&gt;
In our example our authentication module can include a security check for the users before he/she can access the posts posted by himself and his/her friends. &lt;br /&gt;
&lt;br /&gt;
Key Concepts&lt;br /&gt;
&lt;br /&gt;
Join Points: A well defined location at a point in the execution of a program.&lt;br /&gt;
&lt;br /&gt;
PointCut: A set of join points&lt;br /&gt;
&lt;br /&gt;
Advice: Code designed to run automatically at all join points in a particular pointcut. It can be marked as before, after or around i.e. in place of the join points in the pointcut.&lt;br /&gt;
&lt;br /&gt;
Lexical Introduction: Adding functionality to a class in place as opposed to extending it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==AspectR==&lt;br /&gt;
Aspect Oriented Programming in Ruby is known as AspectR.&lt;br /&gt;
Aspects such login, security login, database session, transactions need to be done at the start of each method. If for example an application starts a session at the beginning of the application start and releases the resource only at the termination. A lot of resources are wasted and also may cause starvation of other applications. Hence we need frequent access to resources every time a needy method is called. Implementing this logic inside the method makes the aspect code repeated and cluttered all over the application source. To avoid this problem Aspect oriented programming can be adopted into the Ruby applications. Where all the aspect oriented functionality can be placed inside one behaviour. This behaviour can then be called before and after each method invocation. Thus making changes in aspect behaviour easy.&lt;br /&gt;
Aspect oriented programming in Ruby can be implemented using Aquarium framework. &lt;br /&gt;
&lt;br /&gt;
===Creating a Simple Aspect in Ruby===&lt;br /&gt;
Let us understand how easily an aspect behavior can be setup.&lt;br /&gt;
&lt;br /&gt;
===Setup===&lt;br /&gt;
Install Aquarium gem from rubyForge website or alternatively use &amp;quot;gem install aquarium&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
Depending on the requirement of the application the aspect behavior may be changed from the one below. The snippet below shows the skeleton of a typical Aspect definition. &lt;br /&gt;
&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 before :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc      &lt;br /&gt;
 end&lt;br /&gt;
 after :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc  &lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Before advice tells what work needs to be done before the method is called.&lt;br /&gt;
After advice tells what work needs to be done after the method ends.&lt;br /&gt;
&lt;br /&gt;
Another way of implementing is using Around Advice.&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 around :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc&lt;br /&gt;
 result = join_point.proceed&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc&lt;br /&gt;
 result  # block returns the result of the proceed.&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
==Aspect Oriented programming vs Object Oriented Programming==&lt;br /&gt;
Aspect oriented programming is not a complement to Object Oriented programming. It coexists together. AOP tries to lessen the limitations of traditional object oriented programming like cross-cutting in code, dependency in code change in repetitive methods which deal with aspects like logging, authentication and sessions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
Aspect oriented Programming is a programming technique which has added a third dimension to programming languages, which is a significant improvement over Object Oriented Programming as it lets the programmer focus on working on the business logic in times when he has to change his line of thinking mid-way. All this without having to to be worried about his aspect being scattered through the code as all his new code can be incorporated in aspects.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*[1]: http://en.wikipedia.org/wiki/Aspect-oriented_programming&lt;br /&gt;
&lt;br /&gt;
*[2]: http://www.objectmentor.com/resources/articles/AOP_in_Ruby.pdf&lt;br /&gt;
&lt;br /&gt;
*[3]: http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf&lt;br /&gt;
&lt;br /&gt;
*[4]: http://www.cs.virginia.edu/~sullivan/&lt;br /&gt;
&lt;br /&gt;
*[5]: http://www.marvin-steinberg.de/alternative-implementations-for-aspect-oriented-programming-language-constructs-a-case-study-in-ruby/&lt;br /&gt;
&lt;br /&gt;
*[6]: http://www.theserverside.com/news/1364528/Implementing-Object-Caching-with-AOP&lt;br /&gt;
&lt;br /&gt;
*[7]: http://aspectr.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
*[8]: http://www.ironicwolf.com/2009/04/aspect-the-ruby-way/&lt;br /&gt;
&lt;br /&gt;
*[9]: http://rubyforge.org/frs/?group_id=4281&lt;/div&gt;</summary>
		<author><name>Ajain9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=37691</id>
		<title>CSC/ECE 517 Fall 2010/ch3 3d AI</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=37691"/>
		<updated>2010-10-07T02:40:29Z</updated>

		<summary type="html">&lt;p&gt;Ajain9: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Aspect Oriented Programming is a programming style which isolates the business logic of the program from its secondary or supporting functions. The basis of the aspect oriented programming is to add a third dimension to pre-existing dimensions of the Procedural Programming and Object Oriented Programming, by describing aspects that cross-cut the structure of the program.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
If we look at the programming field from a distance we’ll generally divide programming&lt;br /&gt;
languages into two main camps: procedural programming(POP) and object-oriented programming (OOP). Like all programming techniques these were invented as ways to structure programming to achieve conceptual separation of components. This separation is obtained by dividing programs into sub-structures of some kind so that we can think and program each one&lt;br /&gt;
as a reasonably separate and autonomous entity.&lt;br /&gt;
&lt;br /&gt;
When using POP we divide our program into separate functions or procedures and compose the program flow by redirecting it from one to another in what is essentially a linear structure. With OOP a second dimension is added as we structure our code into encapsulated units linked to each other. The control flow is now defined dynamically by the object structure and&lt;br /&gt;
polymorphism. Aspect Oriented programming tries to add a third dimension to this structure by&lt;br /&gt;
describing so called aspects that cross-cut the structure of the program. &lt;br /&gt;
&lt;br /&gt;
==Motivation ==&lt;br /&gt;
Traditional programming designs had poor modularity due to crosscutting dependencies. Especially in OOP each aspect is scattered by virtue of the function being spread over  numerous unrelated functions or modules which maybe using its functionality, this means changing logging in one function requires modifying all the modules using this functionality, this works on the logic that the users knows/maintains a log of all the functions that use the functionality of the aspect&lt;br /&gt;
Example. &lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure1.png|frame|center]]&lt;br /&gt;
&lt;br /&gt;
Let us consider the example all know and love, Twitter. The model for which is shown in figure 1. If this model were to be implemented in an Object Oriented manner then the security aspect like authentication would have been scattered by virtue of a function called a logging, which is used by both the Users and Posts, a database transaction should encapsulate the operation in order to prevent accidental data loss Also, this operation should be logged onto the system log. We already see that authentication together with logging and transactions are now exhibiting cross-cutting concerns. Now consider the scenario in which the security specifications change , then in order to complete these changes this would require a major effort as the security-related operations are scattered across numerous methods.&lt;br /&gt;
&lt;br /&gt;
==Aspect Oriented Programming ==&lt;br /&gt;
Aspect Oriented Programming aims to solve this problem by including the concept called as aspects. Aspects are stand-alone modules used to express cross-cutting concerns. Figure demonstrates how our twitter module now looks with the inclusion of aspects.&lt;br /&gt;
In Java, the aspects contain advice and intertype declarations.&lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure2.png|frame|center]]        &lt;br /&gt;
In our example our authentication module can include a security check for the users before he/she can access the posts posted by himself and his/her friends. &lt;br /&gt;
&lt;br /&gt;
Key Concepts&lt;br /&gt;
&lt;br /&gt;
Join Points: A well defined location at a point in the execution of a program.&lt;br /&gt;
&lt;br /&gt;
PointCut: A set of join points&lt;br /&gt;
&lt;br /&gt;
Advice: Code designed to run automatically at all join points in a particular pointcut. It can be marked as before, after or around i.e. in place of the join points in the pointcut.&lt;br /&gt;
&lt;br /&gt;
Lexical Introduction: Adding functionality to a class in place as opposed to extending it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==AspectR==&lt;br /&gt;
Aspects such loggin, security login, database session, transactions need to be done at the start of each method. If for example an application starts a session at the beginning of the application start and releases the resource only at the termination. A lot of resources are wasted and also may cause starvation of other applications. Hence we need frequent access to resources every time a needy method is called. Implementing this logic inside the method makes the aspect code repeated and cluttered all over the application source. To avoid this problem Aspect oriented programming can be adopted into the Ruby applications. Where all the aspect oriented functionality can be placed inside one behaviour. This behaviour can then be called before and after each method invocation. Thus making changes in aspect behaviour easy.&lt;br /&gt;
Aspect oriented programming in Ruby can be implemented using Aquarium framework. &lt;br /&gt;
&lt;br /&gt;
===Creating a Simple Aspect in Ruby===&lt;br /&gt;
Let us understand how easily an aspect behavior can be setup.&lt;br /&gt;
&lt;br /&gt;
===Setup===&lt;br /&gt;
Install Aquarium gem from rubyForge website or alternatively use &amp;quot;gem install aquarium&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
Depending on the requirement of the application the aspect behavior may be changed from the one below. The snippet below shows the skeleton of a typical Aspect definition. &lt;br /&gt;
&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 before :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc      &lt;br /&gt;
 end&lt;br /&gt;
 after :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc  &lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Before advice tells what work needs to be done before the method is called.&lt;br /&gt;
After advice tells what work needs to be done after the method ends.&lt;br /&gt;
&lt;br /&gt;
Another way of implementing is using Around Advice.&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 around :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc&lt;br /&gt;
 result = join_point.proceed&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc&lt;br /&gt;
 result  # block returns the result of the proceed.&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
==Aspect Oriented programming vs Object Oriented Programming==&lt;br /&gt;
Aspect oriented programming is not a complement to Object Oriented programming. It coexists together. AOP tries to lessen the limitations of traditional object oriented programming like cross-cutting in code, dependency in code change in repetitive methods which deal with aspects like logging, authentication and sessions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
Aspect oriented Programming is a programming technique which has added a third dimension to programming languages, which is a significant improvement over Object Oriented Programming as it lets the programmer focus on working on the business logic in times when he has to change his line of thinking mid-way. All this without having to to be worried about his aspect being scattered through the code as all his new code can be incorporated in aspects.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
1. http://en.wikipedia.org/wiki/Aspect-oriented_programming&lt;br /&gt;
&lt;br /&gt;
2. http://www.objectmentor.com/resources/articles/AOP_in_Ruby.pdf&lt;br /&gt;
&lt;br /&gt;
3. http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf&lt;br /&gt;
&lt;br /&gt;
4. http://www.cs.virginia.edu/~sullivan/&lt;br /&gt;
&lt;br /&gt;
5. http://www.marvin-steinberg.de/alternative-implementations-for-aspect-oriented-programming-language-constructs-a-case-study-in-ruby/&lt;br /&gt;
&lt;br /&gt;
6. http://www.theserverside.com/news/1364528/Implementing-Object-Caching-with-AOP&lt;br /&gt;
&lt;br /&gt;
7. http://aspectr.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
8. http://www.ironicwolf.com/2009/04/aspect-the-ruby-way/&lt;br /&gt;
&lt;br /&gt;
9. http://rubyforge.org/frs/?group_id=4281&lt;/div&gt;</summary>
		<author><name>Ajain9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=37684</id>
		<title>CSC/ECE 517 Fall 2010/ch3 3d AI</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=37684"/>
		<updated>2010-10-07T02:36:45Z</updated>

		<summary type="html">&lt;p&gt;Ajain9: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Aspect Oriented Programming is a programming style which isolates the business logic of the program from its secondary or supporting functions. The basis of the aspect oriented programming is to add a third dimension to pre-existing dimensions of the Procedural Programming and Object Oriented Programming, by describing aspects that cross-cut the structure of the program.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
If we look at the programming field from a distance we’ll generally divide programming&lt;br /&gt;
languages into two main camps: procedural programming(POP) and object-oriented programming (OOP). Like all programming techniques these were invented as ways to structure programming to achieve conceptual separation of components. This separation is obtained by dividing programs into sub-structures of some kind so that we can think and program each one&lt;br /&gt;
as a reasonably separate and autonomous entity.&lt;br /&gt;
&lt;br /&gt;
When using POP we divide our program into separate functions or procedures and compose the program flow by redirecting it from one to another in what is essentially a linear structure. With OOP a second dimension is added as we structure our code into encapsulated units linked to each other. The control flow is now defined dynamically by the object structure and&lt;br /&gt;
polymorphism. Aspect Oriented programming tries to add a third dimension to this structure by&lt;br /&gt;
describing so called aspects that cross-cut the structure of the program. &lt;br /&gt;
&lt;br /&gt;
==Motivation ==&lt;br /&gt;
Traditional programming designs had poor modularity due to crosscutting dependencies. Especially in OOP each aspect is scattered by virtue of the function being spread over  numerous unrelated functions or modules which maybe using its functionality, this means changing logging in one function requires modifying all the modules using this functionality, this works on the logic that the users knows/maintains a log of all the functions that use the functionality of the aspect&lt;br /&gt;
Example. &lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure1.png|frame|center]]&lt;br /&gt;
&lt;br /&gt;
Let us consider the example all know and love, Twitter. The model for which is shown in figure 1. If this model were to be implemented in an Object Oriented manner then the security aspect like authentication would have been scattered by virtue of a function called a logging, which is used by both the Users and Posts, a database transaction should encapsulate the operation in order to prevent accidental data loss Also, this operation should be logged onto the system log. We already see that authentication together with logging and transactions are now exhibiting cross-cutting concerns. Now consider the scenario in which the security specifications change , then in order to complete these changes this would require a major effort as the security-related operations are scattered across numerous methods.&lt;br /&gt;
&lt;br /&gt;
==Aspect Oriented Programming ==&lt;br /&gt;
Aspect Oriented Programming aims to solve this problem by including the concept called as aspects. Aspects are stand-alone modules used to express cross-cutting concerns. Figure demonstrates how our twitter module now looks with the inclusion of aspects.&lt;br /&gt;
In Java, the aspects contain advice and intertype declarations.&lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure2.png|frame|center]]        &lt;br /&gt;
In our example our authentication module can include a security check for the users before he/she can access the posts posted by himself and his/her friends. &lt;br /&gt;
&lt;br /&gt;
Key Concepts&lt;br /&gt;
&lt;br /&gt;
Join Points: A well defined location at a point in the execution of a program.&lt;br /&gt;
&lt;br /&gt;
PointCut: A set of join points&lt;br /&gt;
&lt;br /&gt;
Advice: Code designed to run automatically at all join points in a particular pointcut. It can be marked as before, after or around i.e. in place of the join points in the pointcut.&lt;br /&gt;
&lt;br /&gt;
Lexical Introduction: Adding functionality to a class in place as opposed to extending it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==AspectR==&lt;br /&gt;
Aspects such loggin, security login, database session, transactions need to be done at the start of each method. If for example an application starts a session at the beginning of the application start and releases the resource only at the termination. A lot of resources are wasted and also may cause starvation of other applications. Hence we need frequent access to resources every time a needy method is called. Implementing this logic inside the method makes the aspect code repeated and cluttered all over the application source. To avoid this problem Aspect oriented programming can be adopted into the Ruby applications. Where all the aspect oriented functionality can be placed inside one behaviour. This behaviour can then be called before and after each method invocation. Thus making changes in aspect behaviour easy.&lt;br /&gt;
Aspect oriented programming in Ruby can be implemented using Aquarium framework. &lt;br /&gt;
&lt;br /&gt;
===Creating a Simple Aspect in Ruby===&lt;br /&gt;
Let us understand how easily an aspect behavior can be setup.&lt;br /&gt;
&lt;br /&gt;
===Setup===&lt;br /&gt;
Install Aquarium gem from rubyForge website or alternatively use &amp;quot;gem install aquarium&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
Depending on the requirement of the application the aspect behavior may be changed from the one below. The snippet below shows the skeleton of a typical Aspect definition. &lt;br /&gt;
&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 before :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc      &lt;br /&gt;
 end&lt;br /&gt;
 after :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc  &lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Before advice tells what work needs to be done before the method is called.&lt;br /&gt;
After advice tells what work needs to be done after the method ends.&lt;br /&gt;
&lt;br /&gt;
Another way of implementing is using Around Advice.&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 around :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc&lt;br /&gt;
 result = join_point.proceed&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc&lt;br /&gt;
 result  # block returns the result of the proceed.&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
==Comparison of Aspect Oriented programming with Object Oriented Programming==&lt;br /&gt;
Aspect oriented programming is not a complement to Object Oriented programming. It coexists together. AOP tries to lessen the limitations of traditional object oriented programming like cross-cutting in code, dependency in code change in repetitive methods which deal with aspects like logging, authentication and sessions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
Aspect oriented Programming is a programming technique which has added a third dimension to programming languages, which is a significant improvement over Object Oriented Programming as it lets the programmer focus on working on the business logic in times when he has to change his line of thinking mid-way. All this without having to to be worried about his aspect being scattered through the code as all his new code can be incorporated in aspects.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
1. http://en.wikipedia.org/wiki/Aspect-oriented_programming&lt;br /&gt;
&lt;br /&gt;
2. http://www.objectmentor.com/resources/articles/AOP_in_Ruby.pdf&lt;br /&gt;
&lt;br /&gt;
3. http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf&lt;br /&gt;
&lt;br /&gt;
4. http://www.cs.virginia.edu/~sullivan/&lt;br /&gt;
&lt;br /&gt;
5. http://www.marvin-steinberg.de/alternative-implementations-for-aspect-oriented-programming-language-constructs-a-case-study-in-ruby/&lt;br /&gt;
&lt;br /&gt;
6. http://www.theserverside.com/news/1364528/Implementing-Object-Caching-with-AOP&lt;br /&gt;
&lt;br /&gt;
7. http://aspectr.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
8. http://www.ironicwolf.com/2009/04/aspect-the-ruby-way/&lt;br /&gt;
&lt;br /&gt;
9. http://rubyforge.org/frs/?group_id=4281&lt;/div&gt;</summary>
		<author><name>Ajain9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=37683</id>
		<title>CSC/ECE 517 Fall 2010/ch3 3d AI</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=37683"/>
		<updated>2010-10-07T02:35:56Z</updated>

		<summary type="html">&lt;p&gt;Ajain9: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Aspect Oriented Programming is a programming style which isolates the business logic of the program from its secondary or supporting functions. The basis of the aspect oriented programming is to add a third dimension to pre-existing dimensions of the Procedural Programming and Object Oriented Programming, by describing aspects that cross-cut the structure of the program.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
If we look at the programming field from a distance we’ll generally divide programming&lt;br /&gt;
languages into two main camps: procedural programming(POP) and object-oriented programming (OOP). Like all programming techniques these were invented as ways to structure programming to achieve conceptual separation of components. This separation is obtained by dividing programs into sub-structures of some kind so that we can think and program each one&lt;br /&gt;
as a reasonably separate and autonomous entity.&lt;br /&gt;
&lt;br /&gt;
When using POP we divide our program into separate functions or procedures and compose the program flow by redirecting it from one to another in what is essentially a linear structure. With OOP a second dimension is added as we structure our code into encapsulated units linked to each other. The control flow is now defined dynamically by the object structure and&lt;br /&gt;
polymorphism. Aspect Oriented programming tries to add a third dimension to this structure by&lt;br /&gt;
describing so called aspects that cross-cut the structure of the program. &lt;br /&gt;
&lt;br /&gt;
==Motivation ==&lt;br /&gt;
Traditional programming designs had poor modularity due to crosscutting dependencies. Especially in OOP each aspect is scattered by virtue of the function being spread over  numerous unrelated functions or modules which maybe using its functionality, this means changing logging in one function requires modifying all the modules using this functionality, this works on the logic that the users knows/maintains a log of all the functions that use the functionality of the aspect&lt;br /&gt;
Example. &lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure1.png|frame|center]]&lt;br /&gt;
&lt;br /&gt;
Let us consider the example all know and love, Twitter. The model for which is shown in figure 1. If this model were to be implemented in an Object Oriented manner then the security aspect like authentication would have been scattered by virtue of a function called a logging, which is used by both the Users and Posts, a database transaction should encapsulate the operation in order to prevent accidental data loss Also, this operation should be logged onto the system log. We already see that authentication together with logging and transactions are now exhibiting cross-cutting concerns. Now consider the scenario in which the security specifications change , then in order to complete these changes this would require a major effort as the security-related operations are scattered across numerous methods.&lt;br /&gt;
&lt;br /&gt;
==Aspect Oriented Programming ==&lt;br /&gt;
Aspect Oriented Programming aims to solve this problem by including the concept called as aspects. Aspects are stand-alone modules used to express cross-cutting concerns. Figure demonstrates how our twitter module now looks with the inclusion of aspects.&lt;br /&gt;
In Java, the aspects contain advice and intertype declarations.&lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure2.png|frame|center]]        &lt;br /&gt;
 In our example our authentication module can include a security check for the users before he/she can access the posts posted by himself and his/her friends. &lt;br /&gt;
&lt;br /&gt;
Key Concepts&lt;br /&gt;
&lt;br /&gt;
Join Points: A well defined location at a point in the execution of a program.&lt;br /&gt;
&lt;br /&gt;
PointCut: A set of join points&lt;br /&gt;
&lt;br /&gt;
Advice: Code designed to run automatically at all join points in a particular pointcut. It can be marked as before, after or around i.e. in place of the join points in the pointcut.&lt;br /&gt;
&lt;br /&gt;
Lexical Introduction: Adding functionality to a class in place as opposed to extending it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==AspectR==&lt;br /&gt;
Aspects such loggin, security login, database session, transactions need to be done at the start of each method. If for example an application starts a session at the beginning of the application start and releases the resource only at the termination. A lot of resources are wasted and also may cause starvation of other applications. Hence we need frequent access to resources every time a needy method is called. Implementing this logic inside the method makes the aspect code repeated and cluttered all over the application source. To avoid this problem Aspect oriented programming can be adopted into the Ruby applications. Where all the aspect oriented functionality can be placed inside one behaviour. This behaviour can then be called before and after each method invocation. Thus making changes in aspect behaviour easy.&lt;br /&gt;
Aspect oriented programming in Ruby can be implemented using Aquarium framework. &lt;br /&gt;
&lt;br /&gt;
===Creating a Simple Aspect in Ruby===&lt;br /&gt;
Let us understand how easily an aspect behavior can be setup.&lt;br /&gt;
&lt;br /&gt;
===Setup===&lt;br /&gt;
Install Aquarium gem from rubyForge website or alternatively use &amp;quot;gem install aquarium&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
Depending on the requirement of the application the aspect behavior may be changed from the one below. The snippet below shows the skeleton of a typical Aspect definition. &lt;br /&gt;
&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 before :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc      &lt;br /&gt;
 end&lt;br /&gt;
 after :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc  &lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Before advice tells what work needs to be done before the method is called.&lt;br /&gt;
After advice tells what work needs to be done after the method ends.&lt;br /&gt;
&lt;br /&gt;
Another way of implementing is using Around Advice.&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 around :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc&lt;br /&gt;
 result = join_point.proceed&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc&lt;br /&gt;
 result  # block returns the result of the proceed.&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
==Comparison of Aspect Oriented programming with Object Oriented Programming==&lt;br /&gt;
Aspect oriented programming is not a complement to Object Oriented programming. It coexists together. AOP tries to lessen the limitations of traditional object oriented programming like cross-cutting in code, dependency in code change in repetitive methods which deal with aspects like logging, authentication and sessions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
Aspect oriented Programming is a programming technique which has added a third dimension to programming languages, which is a significant improvement over Object Oriented Programming as it lets the programmer focus on working on the business logic in times when he has to change his line of thinking mid-way. All this without having to to be worried about his aspect being scattered through the code as all his new code can be incorporated in aspects.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
1. http://en.wikipedia.org/wiki/Aspect-oriented_programming&lt;br /&gt;
&lt;br /&gt;
2. http://www.objectmentor.com/resources/articles/AOP_in_Ruby.pdf&lt;br /&gt;
&lt;br /&gt;
3. http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf&lt;br /&gt;
&lt;br /&gt;
4. http://www.cs.virginia.edu/~sullivan/&lt;br /&gt;
&lt;br /&gt;
5. http://www.marvin-steinberg.de/alternative-implementations-for-aspect-oriented-programming-language-constructs-a-case-study-in-ruby/&lt;br /&gt;
&lt;br /&gt;
6. http://www.theserverside.com/news/1364528/Implementing-Object-Caching-with-AOP&lt;br /&gt;
&lt;br /&gt;
7. http://aspectr.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
8. http://www.ironicwolf.com/2009/04/aspect-the-ruby-way/&lt;br /&gt;
&lt;br /&gt;
9. http://rubyforge.org/frs/?group_id=4281&lt;/div&gt;</summary>
		<author><name>Ajain9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=37655</id>
		<title>CSC/ECE 517 Fall 2010/ch3 3d AI</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=37655"/>
		<updated>2010-10-07T02:17:20Z</updated>

		<summary type="html">&lt;p&gt;Ajain9: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Aspect Oriented Programming is a programming style which isolates the business logic of the program from its secondary or supporting functions. The basis of the aspect oriented programming is to add a third dimension to pre-existing dimensions of the Procedural Programming and Object Oriented Programming, by describing aspects that cross-cut the structure of the program.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
If we look at the programming field from a distance we’ll generally divide programming&lt;br /&gt;
languages into two main camps: procedural programming(POP) and object-oriented programming (OOP). Like all programming techniques these were invented as ways to structure programming to achieve conceptual separation of components. This separation is obtained by dividing programs into sub-structures of some kind so that we can think and program each one&lt;br /&gt;
as a reasonably separate and autonomous entity.&lt;br /&gt;
&lt;br /&gt;
When using POP we divide our program into separate functions or procedures and compose the program flow by redirecting it from one to another in what is essentially a linear structure. With OOP a second dimension is added as we structure our code into encapsulated units linked to each other. The control flow is now defined dynamically by the object structure and&lt;br /&gt;
polymorphism. Aspect Oriented programming tries to add a third dimension to this structure by&lt;br /&gt;
describing so called aspects that cross-cut the structure of the program. &lt;br /&gt;
&lt;br /&gt;
==Motivation ==&lt;br /&gt;
Traditional programming designs had poor modularity due to crosscutting dependencies. Especially in OOP each aspect is scattered by virtue of the function being spread over  numerous unrelated functions or modules which maybe using its functionality, this means changing logging in one function requires modifying all the modules using this functionality, this works on the logic that the users knows/maintains a log of all the functions that use the functionality of the aspect&lt;br /&gt;
Example. &lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure1.png|frame|center]]&lt;br /&gt;
&lt;br /&gt;
Let us consider the example all know and love, Twitter. The model for which is shown in figure 1. If this model were to be implemented in an Object Oriented manner then the security aspect like authentication would have been scattered by virtue of a function called a logging, which is used by both the Users and Posts, a database transaction should encapsulate the operation in order to prevent accidental data loss Also, this operation should be logged onto the system log. We already see that authentication together with logging and transactions are now exhibiting cross-cutting concerns. Now consider the scenario in which the security specifications change , then in order to complete these changes this would require a major effort as the security-related operations are scattered across numerous methods.&lt;br /&gt;
&lt;br /&gt;
==Aspect Oriented Programming ==&lt;br /&gt;
Aspect Oriented Programming aims to solve this problem by including the concept called as aspects. Aspects are stand-alone modules used to express cross-cutting concerns. Figure demonstrates how our twitter module now looks with the inclusion of aspects.&lt;br /&gt;
In Java, the aspects contain advice and intertype declarations.&lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure2.png|frame|center]]        &lt;br /&gt;
 In our example our authentication module can include a security check for the users before he/she can access the posts posted by himself and his/her friends. &lt;br /&gt;
&lt;br /&gt;
Key Concepts&lt;br /&gt;
&lt;br /&gt;
Join Points: A well defined location at a point in the execution of a program.&lt;br /&gt;
&lt;br /&gt;
PointCut: A set of join points&lt;br /&gt;
&lt;br /&gt;
Advice: Code designed to run automatically at all join points in a particular pointcut. It can be marked as before, after or around i.e. in place of the join points in the pointcut.&lt;br /&gt;
&lt;br /&gt;
Lexical Introduction: Adding functionality to a class in place as opposed to extending it.&lt;br /&gt;
&lt;br /&gt;
==Comparison of Aspect Oriented programming with Object Oriented Programming==&lt;br /&gt;
Aspect oriented programming is not a complement to Object Oriented programming. It coexists together. AOP tries to lessen the limitations of traditional object oriented programming like cross-cutting in code, dependency in code change in repetitive methods which deal with aspects like logging, authentication and sessions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==AspectR==&lt;br /&gt;
Aspects such loggin, security login, database session, transactions need to be done at the start of each method. If for example an application starts a session at the beginning of the application start and releases the resource only at the termination. A lot of resources are wasted and also may cause starvation of other applications. Hence we need frequent access to resources every time a needy method is called. Implementing this logic inside the method makes the aspect code repeated and cluttered all over the application source. To avoid this problem Aspect oriented programming can be adopted into the Ruby applications. Where all the aspect oriented functionality can be placed inside one behaviour. This behaviour can then be called before and after each method invocation. Thus making changes in aspect behaviour easy.&lt;br /&gt;
Aspect oriented programming in Ruby can be implemented using Aquarium framework. &lt;br /&gt;
&lt;br /&gt;
===Creating a Simple Aspect in Ruby===&lt;br /&gt;
Let us understand how easily an aspect behavior can be setup.&lt;br /&gt;
&lt;br /&gt;
===Setup===&lt;br /&gt;
Install Aquarium gem from rubyForge website or alternatively use &amp;quot;gem install aquarium&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
Depending on the requirement of the application the aspect behavior may be changed from the one below. The snippet below shows the skeleton of a typical Aspect definition. &lt;br /&gt;
&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 before :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc      &lt;br /&gt;
 end&lt;br /&gt;
 after :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc  &lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Before advice tells what work needs to be done before the method is called.&lt;br /&gt;
After advice tells what work needs to be done after the method ends.&lt;br /&gt;
&lt;br /&gt;
Another way of implementing is using Around Advice.&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 around :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc&lt;br /&gt;
 result = join_point.proceed&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc&lt;br /&gt;
 result  # block returns the result of the proceed.&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
Aspect oriented Programming is a programming technique which has added a third dimension to programming languages, which is a significant improvement over Object Oriented Programming as it lets the programmer focus on working on the business logic in times when he has to change his line of thinking mid-way. All this without having to to be worried about his aspect being scattered through the code as all his new code can be incorporated in aspects.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
1. http://en.wikipedia.org/wiki/Aspect-oriented_programming&lt;br /&gt;
&lt;br /&gt;
2. http://www.objectmentor.com/resources/articles/AOP_in_Ruby.pdf&lt;br /&gt;
&lt;br /&gt;
3. http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf&lt;br /&gt;
&lt;br /&gt;
4. http://www.cs.virginia.edu/~sullivan/&lt;br /&gt;
&lt;br /&gt;
5. http://www.marvin-steinberg.de/alternative-implementations-for-aspect-oriented-programming-language-constructs-a-case-study-in-ruby/&lt;br /&gt;
&lt;br /&gt;
6. http://www.theserverside.com/news/1364528/Implementing-Object-Caching-with-AOP&lt;br /&gt;
&lt;br /&gt;
7. http://aspectr.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
8. http://www.ironicwolf.com/2009/04/aspect-the-ruby-way/&lt;br /&gt;
&lt;br /&gt;
9. http://rubyforge.org/frs/?group_id=4281&lt;/div&gt;</summary>
		<author><name>Ajain9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=37650</id>
		<title>CSC/ECE 517 Fall 2010/ch3 3d AI</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=37650"/>
		<updated>2010-10-07T02:15:34Z</updated>

		<summary type="html">&lt;p&gt;Ajain9: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Aspect Oriented Programming is a programming style which isolates the business logic of the program from its secondary or supporting functions. The basis of the aspect oriented programming is to add a third dimension to pre-existing dimensions of the Procedural Programming and Object Oriented Programming, by describing aspects that cross-cut the structure of the program.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
If we look at the programming field from a distance we’ll generally divide programming&lt;br /&gt;
languages into two main camps: procedural programming(POP) and object-oriented programming (OOP). Like all programming techniques these were invented as ways to structure programming to achieve conceptual separation of components. This separation is obtained by dividing programs into sub-structures of some kind so that we can think and program each one&lt;br /&gt;
as a reasonably separate and autonomous entity.&lt;br /&gt;
&lt;br /&gt;
When using POP we divide our program into separate functions or procedures and compose the program flow by redirecting it from one to another in what is essentially a linear structure. With OOP a second dimension is added as we structure our code into encapsulated units linked to each other. The control flow is now defined dynamically by the object structure and&lt;br /&gt;
polymorphism. Aspect Oriented programming tries to add a third dimension to this structure by&lt;br /&gt;
describing so called aspects that cross-cut the structure of the program. &lt;br /&gt;
&lt;br /&gt;
==Motivation and Terminologies==&lt;br /&gt;
Traditional programming designs had poor modularity due to crosscutting dependencies. Especially in OOP each aspect is scattered by virtue of the function being spread over  numerous unrelated functions or modules which maybe using its functionality, this means changing logging in one function requires modifying all the modules using this functionality, this works on the logic that the users knows/maintains a log of all the functions that use the functionality of the aspect&lt;br /&gt;
Example. &lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure1.png|frame|center]]&lt;br /&gt;
&lt;br /&gt;
Let us consider the example all know and love, Twitter. The model for which is shown in figure 1. If this model were to be implemented in an Object Oriented manner then the security aspect like authentication would have been scattered by virtue of a function called a logging, which is used by both the Users and Posts, a database transaction should encapsulate the operation in order to prevent accidental data loss Also, this operation should be logged onto the system log. We already see that authentication together with logging and transactions are now exhibiting cross-cutting concerns. Now consider the scenario in which the security specifications change , then in order to complete these changes this would require a major effort as the security-related operations are scattered across numerous methods.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Aspect Oriented Programming==&lt;br /&gt;
&lt;br /&gt;
Aspect Oriented Programming aims to solve this problem by including the concept called as aspects. Aspects are stand-alone modules used to express cross-cutting concerns. Figure demonstrates how our twitter module now looks with the inclusion of aspects.&lt;br /&gt;
In Java, the aspects contain advice and intertype declarations.&lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure2.png|frame|center]]        &lt;br /&gt;
 In our example our authentication module can include a security check for the users before he/she can access the posts posted by himself and his/her friends. &lt;br /&gt;
&lt;br /&gt;
Key Concepts&lt;br /&gt;
&lt;br /&gt;
Cross-cutting: Cross-cutting phenomenon is directly responsible for the tangling in the code. The single composition mechanism the language provides us,i.e, procedure calling is very well suited to building up the unoptimized functional units. But it can't help us compose the functional units and the loop fusion simultaneously, because, they follow such different composition rules and yet must compose. This breakdown forces us to combine the properties entirely by hand. &lt;br /&gt;
 &lt;br /&gt;
Join Points: A well defined location at a point in the execution of a program. The join point model defines three things: When the advice can run called join points, a way to specify join points called point cuts and means to specify the code to run join points called advice. Join point model can be compared based on join points exposed, how join points are specified, the structural enhancements that can be expressed and the operations permitted at the join points.&lt;br /&gt;
&lt;br /&gt;
PointCut: A set of join points. &lt;br /&gt;
&lt;br /&gt;
Advice: Code designed to run automatically at all join points in a particular pointcut. It can be marked as before, after or around i.e. in place of the join points in the pointcut.&lt;br /&gt;
&lt;br /&gt;
Lexical Introduction: Adding functionality to a class in place as opposed to extending it.&lt;br /&gt;
&lt;br /&gt;
==Comparison of Aspect Oriented programming with Object Oriented Programming==&lt;br /&gt;
Aspect oriented programming is not a complement to Object Oriented programming. It coexists together. AOP tries to lessen the limitations of traditional object oriented programming like cross-cutting in code, dependency in code change in repetitive methods which deal with aspects like logging, authentication and sessions. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==AspectR==&lt;br /&gt;
Aspects such as login, security login, database session, transactions need to be done at the start of each method. If for example an application starts a session at the beginning of the application start and releases the resource only at the termination. A lot of resources are wasted and also may cause starvation of other applications. Hence we need frequent access to resources every time a needy method is called. Implementing this logic inside the method makes the aspect code repeated and cluttered all over the application source. To avoid this problem Aspect oriented programming can be adopted into the Ruby applications. Where all the aspect oriented functionality can be placed inside one behaviour. This behaviour can then be called before and after each method invocation. Thus making changes in aspect behaviour easy.&lt;br /&gt;
Aspect oriented programming in Ruby can be implemented using Aquarium framework. &lt;br /&gt;
&lt;br /&gt;
===Creating a Simple Aspect in Ruby===&lt;br /&gt;
Let us understand how easily an aspect behavior can be setup.&lt;br /&gt;
&lt;br /&gt;
===Setup===&lt;br /&gt;
Install Aquarium gem from rubyForge website or alternatively use &amp;quot;gem install aquarium&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
Depending on the requirement of the application the aspect behavior may be changed from the one below. The snippet below shows the skeleton of a typical Aspect definition. &lt;br /&gt;
&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 before :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc      &lt;br /&gt;
 end&lt;br /&gt;
 after :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc  &lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Before advice tells what work needs to be done before the method is called.&lt;br /&gt;
After advice tells what work needs to be done after the method ends.&lt;br /&gt;
&lt;br /&gt;
Another way of implementing is using Around Advice.&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 around :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc&lt;br /&gt;
 result = join_point.proceed&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc&lt;br /&gt;
 result  # block returns the result of the proceed.&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
1. http://en.wikipedia.org/wiki/Aspect-oriented_programming&lt;br /&gt;
&lt;br /&gt;
2. http://www.objectmentor.com/resources/articles/AOP_in_Ruby.pdf&lt;br /&gt;
&lt;br /&gt;
3. http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf&lt;br /&gt;
&lt;br /&gt;
4. http://www.cs.virginia.edu/~sullivan/&lt;br /&gt;
&lt;br /&gt;
5. http://www.marvin-steinberg.de/alternative-implementations-for-aspect-oriented-programming-language-constructs-a-case-study-in-ruby/&lt;br /&gt;
&lt;br /&gt;
6. http://www.theserverside.com/news/1364528/Implementing-Object-Caching-with-AOP&lt;br /&gt;
&lt;br /&gt;
7. http://aspectr.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
8. http://www.ironicwolf.com/2009/04/aspect-the-ruby-way/&lt;br /&gt;
&lt;br /&gt;
9. http://rubyforge.org/frs/?group_id=4281&lt;/div&gt;</summary>
		<author><name>Ajain9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=37638</id>
		<title>CSC/ECE 517 Fall 2010/ch3 3d AI</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=37638"/>
		<updated>2010-10-07T02:02:51Z</updated>

		<summary type="html">&lt;p&gt;Ajain9: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Aspect Oriented Programming is a programming style which isolates the business logic of the program from its secondary or supporting functions. The basis of the aspect oriented programming is to add a third dimension to pre-existing dimensions of the Procedural Programming and Object Oriented Programming, by describing aspects that cross-cut the structure of the program.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
If we look at the programming field from a distance we’ll generally divide programming&lt;br /&gt;
languages into two main camps: procedural programming(POP) and object-oriented programming (OOP). Like all programming techniques these were invented as ways to structure programming to achieve conceptual separation of components. This separation is obtained by dividing programs into sub-structures of some kind so that we can think and program each one&lt;br /&gt;
as a reasonably separate and autonomous entity.&lt;br /&gt;
&lt;br /&gt;
When using POP we divide our program into separate functions or procedures and compose the program flow by redirecting it from one to another in what is essentially a linear structure. With OOP a second dimension is added as we structure our code into encapsulated units linked to each other. The control flow is now defined dynamically by the object structure and&lt;br /&gt;
polymorphism. Aspect Oriented programming tries to add a third dimension to this structure by&lt;br /&gt;
describing so called aspects that cross-cut the structure of the program. &lt;br /&gt;
&lt;br /&gt;
==Motivation ==&lt;br /&gt;
Traditional programming designs had poor modularity due to crosscutting dependencies. Especially in OOP each aspect is scattered by virtue of the function being spread over  numerous unrelated functions or modules which maybe using its functionality, this means changing logging in one function requires modifying all the modules using this functionality, this works on the logic that the users knows/maintains a log of all the functions that use the functionality of the aspect&lt;br /&gt;
Example. &lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure1.png|frame|center]]&lt;br /&gt;
&lt;br /&gt;
Let us consider the example all know and love, Twitter. The model for which is shown in figure 1. If this model were to be implemented in an Object Oriented manner then the security aspect like authentication would have been scattered by virtue of a function called a logging, which is used by both the Users and Posts, a database transaction should encapsulate the operation in order to prevent accidental data loss Also, this operation should be logged onto the system log. We already see that authentication together with logging and transactions are now exhibiting cross-cutting concerns. Now consider the scenario in which the security specifications change , then in order to complete these changes this would require a major effort as the security-related operations are scattered across numerous methods.&lt;br /&gt;
&lt;br /&gt;
==Aspect Oriented Programming ==&lt;br /&gt;
Aspect Oriented Programming aims to solve this problem by including the concept called as aspects. Aspects are stand-alone modules used to express cross-cutting concerns. Figure demonstrates how our twitter module now looks with the inclusion of aspects.&lt;br /&gt;
In Java, the aspects contain advice and intertype declarations.&lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure2.png|frame|center]]        &lt;br /&gt;
 In our example our authentication module can include a security check for the users before he/she can access the posts posted by himself and his/her friends. &lt;br /&gt;
&lt;br /&gt;
Key Concepts&lt;br /&gt;
&lt;br /&gt;
Join Points: A well defined location at a point in the execution of a program.&lt;br /&gt;
&lt;br /&gt;
PointCut: A set of join points&lt;br /&gt;
&lt;br /&gt;
Advice: Code designed to run automatically at all join points in a particular pointcut. It can be marked as before, after or around i.e. in place of the join points in the pointcut.&lt;br /&gt;
&lt;br /&gt;
Lexical Introduction: Adding functionality to a class in place as opposed to extending it.&lt;br /&gt;
&lt;br /&gt;
==Comparison of Aspect Oriented programming with Object Oriented Programming==&lt;br /&gt;
Aspect oriented programming is not a complement to Object Oriented programming. It coexists together. AOP tries to lessen the limitations of traditional object oriented programming like cross-cutting in code, dependency in code change in repetitive methods which deal with aspects like logging, authentication and sessions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==AspectR==&lt;br /&gt;
Aspects such loggin, security login, database session, transactions need to be done at the start of each method. If for example an application starts a session at the beginning of the application start and releases the resource only at the termination. A lot of resources are wasted and also may cause starvation of other applications. Hence we need frequent access to resources every time a needy method is called. Implementing this logic inside the method makes the aspect code repeated and cluttered all over the application source. To avoid this problem Aspect oriented programming can be adopted into the Ruby applications. Where all the aspect oriented functionality can be placed inside one behaviour. This behaviour can then be called before and after each method invocation. Thus making changes in aspect behaviour easy.&lt;br /&gt;
Aspect oriented programming in Ruby can be implemented using Aquarium framework. &lt;br /&gt;
&lt;br /&gt;
===Creating a Simple Aspect in Ruby===&lt;br /&gt;
Let us understand how easily an aspect behavior can be setup.&lt;br /&gt;
&lt;br /&gt;
===Setup===&lt;br /&gt;
Install Aquarium gem from rubyForge website or alternatively use &amp;quot;gem install aquarium&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
Depending on the requirement of the application the aspect behavior may be changed from the one below. The snippet below shows the skeleton of a typical Aspect definition. &lt;br /&gt;
&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 before :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc      &lt;br /&gt;
 end&lt;br /&gt;
 after :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc  &lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Before advice tells what work needs to be done before the method is called.&lt;br /&gt;
After advice tells what work needs to be done after the method ends.&lt;br /&gt;
&lt;br /&gt;
Another way of implementing is using Around Advice.&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 around :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc&lt;br /&gt;
 result = join_point.proceed&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc&lt;br /&gt;
 result  # block returns the result of the proceed.&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
1. http://en.wikipedia.org/wiki/Aspect-oriented_programming&lt;br /&gt;
&lt;br /&gt;
2. http://www.objectmentor.com/resources/articles/AOP_in_Ruby.pdf&lt;br /&gt;
&lt;br /&gt;
3. http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf&lt;br /&gt;
&lt;br /&gt;
4. http://www.cs.virginia.edu/~sullivan/&lt;br /&gt;
&lt;br /&gt;
5. http://www.marvin-steinberg.de/alternative-implementations-for-aspect-oriented-programming-language-constructs-a-case-study-in-ruby/&lt;br /&gt;
&lt;br /&gt;
6. http://www.theserverside.com/news/1364528/Implementing-Object-Caching-with-AOP&lt;br /&gt;
&lt;br /&gt;
7. http://aspectr.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
8. http://www.ironicwolf.com/2009/04/aspect-the-ruby-way/&lt;br /&gt;
&lt;br /&gt;
9. http://rubyforge.org/frs/?group_id=4281&lt;/div&gt;</summary>
		<author><name>Ajain9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=37627</id>
		<title>CSC/ECE 517 Fall 2010/ch3 3d AI</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=37627"/>
		<updated>2010-10-07T01:59:42Z</updated>

		<summary type="html">&lt;p&gt;Ajain9: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Aspect Oriented Programming is a programming style which isolates the business logic of the program from its secondary or supporting functions. The basis of the aspect oriented programming is to add a third dimension to pre-existing dimensions of the Procedural Programming and Object Oriented Programming, by describing aspects that cross-cut the structure of the program.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
If we look at the programming field from a distance we’ll generally divide programming&lt;br /&gt;
languages into two main camps: procedural programming(POP) and object-oriented programming (OOP). Like all programming techniques these were invented as ways to structure programming to achieve conceptual separation of components. This separation is obtained by dividing programs into sub-structures of some kind so that we can think and program each one&lt;br /&gt;
as a reasonably separate and autonomous entity.&lt;br /&gt;
&lt;br /&gt;
When using POP we divide our program into separate functions or procedures and compose the program flow by redirecting it from one to another in what is essentially a linear structure. With OOP a second dimension is added as we structure our code into encapsulated units linked to each other. The control flow is now defined dynamically by the object structure and&lt;br /&gt;
polymorphism. Aspect Oriented programming tries to add a third dimension to this structure by&lt;br /&gt;
describing so called aspects that cross-cut the structure of the program. &lt;br /&gt;
&lt;br /&gt;
==Motivation and Terminologies==&lt;br /&gt;
Traditional programming designs had poor modularity due to crosscutting dependencies. Especially in OOP each aspect is scattered by virtue of the function being spread over  numerous unrelated functions or modules which maybe using its functionality, this means changing logging in one function requires modifying all the modules using this functionality, this works on the logic that the users knows/maintains a log of all the functions that use the functionality of the aspect&lt;br /&gt;
Example. &lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure1.png|frame|center]]&lt;br /&gt;
&lt;br /&gt;
Let us consider the example all know and love, Twitter. The model for which is shown in figure 1. If this model were to be implemented in an Object Oriented manner then the security aspect like authentication would have been scattered by virtue of a function called a logging, which is used by both the Users and Posts, a database transaction should encapsulate the operation in order to prevent accidental data loss Also, this operation should be logged onto the system log. We already see that authentication together with logging and transactions are now exhibiting cross-cutting concerns. Now consider the scenario in which the security specifications change , then in order to complete these changes this would require a major effort as the security-related operations are scattered across numerous methods.&lt;br /&gt;
&lt;br /&gt;
==Aspect Oriented Programming==&lt;br /&gt;
Aspect Oriented Programming aims to solve this problem by including the concept called as aspects. Aspects are stand-alone modules used to express cross-cutting concerns. Figure demonstrates how our twitter module now looks with the inclusion of aspects.&lt;br /&gt;
In Java, the aspects contain advice and intertype declarations.&lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure2.png|frame|center]]        &lt;br /&gt;
 In our example our authentication module can include a security check for the users before he/she can access the posts posted by himself and his/her friends. &lt;br /&gt;
&lt;br /&gt;
Key Concepts&lt;br /&gt;
&lt;br /&gt;
Join Points: A well defined location at a point in the execution of a program.&lt;br /&gt;
&lt;br /&gt;
PointCut: A set of join points&lt;br /&gt;
&lt;br /&gt;
Advice: Code designed to run automatically at all join points in a particular pointcut. It can be marked as before, after or around i.e. in place of the join points in the pointcut.&lt;br /&gt;
&lt;br /&gt;
Lexical Introduction: Adding functionality to a class in place as opposed to extending it.&lt;br /&gt;
&lt;br /&gt;
==Comparison of Aspect Oriented programming with Object Oriented Programming==&lt;br /&gt;
Aspect oriented programming is not a complement to Object Oriented programming. It coexists together. AOP tries to lessen the limitations of traditional object oriented programming like cross-cutting in code, dependency in code change in repetitive methods which deal with aspects like logging, authentication and sessions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==AspectR==&lt;br /&gt;
Aspects such loggin, security login, database session, transactions need to be done at the start of each method. If for example an application starts a session at the beginning of the application start and releases the resource only at the termination. A lot of resources are wasted and also may cause starvation of other applications. Hence we need frequent access to resources every time a needy method is called. Implementing this logic inside the method makes the aspect code repeated and cluttered all over the application source. To avoid this problem Aspect oriented programming can be adopted into the Ruby applications. Where all the aspect oriented functionality can be placed inside one behaviour. This behaviour can then be called before and after each method invocation. Thus making changes in aspect behaviour easy.&lt;br /&gt;
Aspect oriented programming in Ruby can be implemented using Aquarium framework. &lt;br /&gt;
&lt;br /&gt;
===Creating a Simple Aspect in Ruby===&lt;br /&gt;
Let us understand how easily an aspect behavior can be setup.&lt;br /&gt;
&lt;br /&gt;
===Setup===&lt;br /&gt;
Install Aquarium gem from rubyForge website or alternatively use &amp;quot;gem install aquarium&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
Depending on the requirement of the application the aspect behavior may be changed from the one below. The snippet below shows the skeleton of a typical Aspect definition. &lt;br /&gt;
&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 before :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc      &lt;br /&gt;
 end&lt;br /&gt;
 after :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc  &lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Before advice tells what work needs to be done before the method is called.&lt;br /&gt;
After advice tells what work needs to be done after the method ends.&lt;br /&gt;
&lt;br /&gt;
Another way of implementing is using Around Advice.&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 around :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc&lt;br /&gt;
 result = join_point.proceed&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc&lt;br /&gt;
 result  # block returns the result of the proceed.&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
1. http://en.wikipedia.org/wiki/Aspect-oriented_programming&lt;br /&gt;
&lt;br /&gt;
2. http://www.objectmentor.com/resources/articles/AOP_in_Ruby.pdf&lt;br /&gt;
&lt;br /&gt;
3. http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf&lt;br /&gt;
&lt;br /&gt;
4. http://www.cs.virginia.edu/~sullivan/&lt;br /&gt;
&lt;br /&gt;
5. http://www.marvin-steinberg.de/alternative-implementations-for-aspect-oriented-programming-language-constructs-a-case-study-in-ruby/&lt;br /&gt;
&lt;br /&gt;
6. http://www.theserverside.com/news/1364528/Implementing-Object-Caching-with-AOP&lt;br /&gt;
&lt;br /&gt;
7. http://aspectr.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
8. http://www.ironicwolf.com/2009/04/aspect-the-ruby-way/&lt;br /&gt;
&lt;br /&gt;
9. http://rubyforge.org/frs/?group_id=4281&lt;/div&gt;</summary>
		<author><name>Ajain9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=37567</id>
		<title>CSC/ECE 517 Fall 2010/ch3 3d AI</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=37567"/>
		<updated>2010-10-07T01:37:58Z</updated>

		<summary type="html">&lt;p&gt;Ajain9: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Aspect Oriented Programming is a programming style which isolates the business logic of the program from its secondary or supporting functions. The basis of the aspect oriented programming is to add a third dimension to pre-existing dimensions of the Procedural Programming and Object Oriented Programming, by describing aspects that cross-cut the structure of the program.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
If we look at the programming field from a distance we’ll generally divide programming&lt;br /&gt;
languages into two main camps: procedural programming(POP) and object-oriented programming (OOP). Like all programming techniques these were invented as ways to structure programming to achieve conceptual separation of components. This separation is obtained by dividing programs into sub-structures of some kind so that we can think and program each one&lt;br /&gt;
as a reasonably separate and autonomous entity.&lt;br /&gt;
&lt;br /&gt;
When using POP we divide our program into separate functions or procedures and compose the program flow by redirecting it from one to another in what is essentially a linear structure. With OOP a second dimension is added as we structure our code into encapsulated units linked to each other. The control flow is now defined dynamically by the object structure and&lt;br /&gt;
polymorphism. Aspect Oriented programming tries to add a third dimension to this structure by&lt;br /&gt;
describing so called aspects that cross-cut the structure of the program. &lt;br /&gt;
&lt;br /&gt;
==Motivation and Terminologies==&lt;br /&gt;
Traditional programming designs had poor modularity due to crosscutting dependencies. Especially in OOP each aspect is scattered by virtue of the function being spread over  numerous unrelated functions or modules which maybe using its functionality, this means changing logging in one function requires modifying all the modules using this functionality, this works on the logic that the users knows/maintains a log of all the functions that use the functionality of the aspect&lt;br /&gt;
Example. &lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure1.png|frame|center]]&lt;br /&gt;
&lt;br /&gt;
Let us consider the example all know and love, Twitter. The model for which is shown in figure 1. If this model were to be implemented in an Object Oriented manner then the security aspect like authentication would have been scattered by virtue of a function called a logging, which is used by both the Users and Posts, a database transaction should encapsulate the operation in order to prevent accidental data loss Also, this operation should be logged onto the system log. We already see that authentication together with logging and transactions are now exhibiting cross-cutting concerns. Now consider the scenario in which the security specifications change , then in order to complete these changes this would require a major effort as the security-related operations are scattered across numerous methods.&lt;br /&gt;
&lt;br /&gt;
==Aspect Oriented Programming==&lt;br /&gt;
Aspect Oriented Programming aims to solve this problem by including the concept called as aspects. Aspects are stand-alone modules used to express cross-cutting concerns. Figure demonstrates how our twitter module now looks with the inclusion of aspects.&lt;br /&gt;
In Java, the aspects contain advice and intertype declarations.&lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure2.png|frame|center]]        &lt;br /&gt;
 In our example our authentication module can include a security check for the users before he/she can access the posts posted by himself and his/her friends. &lt;br /&gt;
&lt;br /&gt;
Key Concepts&lt;br /&gt;
&lt;br /&gt;
Join Points: A well defined location at a point in the execution of a program.&lt;br /&gt;
&lt;br /&gt;
PointCut: A set of join points&lt;br /&gt;
&lt;br /&gt;
Advice: Code designed to run automatically at all join points in a particular pointcut. It can be marked as before, after or around i.e. in place of the join points in the pointcut.&lt;br /&gt;
&lt;br /&gt;
Lexical Introduction: Adding functionality to a class in place as opposed to extending it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==AspectR==&lt;br /&gt;
Aspects such loggin, security login, database session, transactions need to be done at the start of each method. If for example an application starts a session at the beginning of the application start and releases the resource only at the termination. A lot of resources are wasted and also may cause starvation of other applications. Hence we need frequent access to resources every time a needy method is called. Implementing this logic inside the method makes the aspect code repeated and cluttered all over the application source. To avoid this problem Aspect oriented programming can be adopted into the Ruby applications. Where all the aspect oriented functionality can be placed inside one behaviour. This behaviour can then be called before and after each method invocation. Thus making changes in aspect behaviour easy.&lt;br /&gt;
Aspect oriented programming in Ruby can be implemented using Aquarium framework. &lt;br /&gt;
&lt;br /&gt;
===Creating a Simple Aspect in Ruby===&lt;br /&gt;
Let us understand how easily an aspect behavior can be setup.&lt;br /&gt;
&lt;br /&gt;
===Setup===&lt;br /&gt;
Install Aquarium gem from rubyForge website or alternatively use &amp;quot;gem install aquarium&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
Depending on the requirement of the application the aspect behavior may be changed from the one below. The snippet below shows the skeleton of a typical Aspect definition. &lt;br /&gt;
&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 before :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc      &lt;br /&gt;
 end&lt;br /&gt;
 after :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc  &lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Before advice tells what work needs to be done before the method is called.&lt;br /&gt;
After advice tells what work needs to be done after the method ends.&lt;br /&gt;
&lt;br /&gt;
Another way of implementing is using Around Advice.&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 around :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc&lt;br /&gt;
 result = join_point.proceed&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc&lt;br /&gt;
 result  # block returns the result of the proceed.&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
==AspectJ==&lt;br /&gt;
An AspectJ aspect is a crosscutting type consisting of an advice on pointcuts and lexical introduction of behavior into other types. It is a general-purpose aspect-oritented extension to Java. Like Classes, aspects can have internal state and behavior, can extend other aspects and classes, and can implement interfaces. AspectJ uses extensions to the Java programming language to specify the crossing rules. These extensions are designed in such a way that a Java programmer would find no difference in using them. The AspectJ extensions use the following constructs to specify the weaving rules programmatically; they are the building blocks that form the modules that express the crosscutting concern’s implementation.&lt;br /&gt;
&lt;br /&gt;
Join point&lt;br /&gt;
In AspectJ everything revolves around ajoin points, since they are the places where the crosscutting actions are woven in. Lets look at below code snippet:&lt;br /&gt;
&lt;br /&gt;
public class Post{&lt;br /&gt;
...&lt;br /&gt;
void addPost(String text){&lt;br /&gt;
//add to Post database the given text&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
The join points in the Post Class include the execution of the addPost() method and the access to the database table Post.&lt;br /&gt;
&lt;br /&gt;
Pointcut&lt;br /&gt;
A pointcut can select join point that is a call to a method, and it could also capture the method's context, such as the target object on which the method was called and the method's arguments.&lt;br /&gt;
&lt;br /&gt;
We can write a pointcut that will capture the execution of the addPost() method in the Post class shown earlier:&lt;br /&gt;
execution(void Post.addPost(String))&lt;br /&gt;
&lt;br /&gt;
The pointcut construct in AspectJ allows use of a few wildcards to capture related set of join points. For example,&lt;br /&gt;
the following pointcut captures the execution of all methods in Post class and its subclasses:&lt;br /&gt;
&lt;br /&gt;
execution(void Post+*(..))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
1. http://en.wikipedia.org/wiki/Aspect-oriented_programming&lt;br /&gt;
&lt;br /&gt;
2. http://www.objectmentor.com/resources/articles/AOP_in_Ruby.pdf&lt;br /&gt;
&lt;br /&gt;
3. http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf&lt;br /&gt;
&lt;br /&gt;
4. http://www.cs.virginia.edu/~sullivan/&lt;br /&gt;
&lt;br /&gt;
5. http://www.marvin-steinberg.de/alternative-implementations-for-aspect-oriented-programming-language-constructs-a-case-study-in-ruby/&lt;br /&gt;
&lt;br /&gt;
6. http://www.theserverside.com/news/1364528/Implementing-Object-Caching-with-AOP&lt;br /&gt;
&lt;br /&gt;
7. http://aspectr.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
8. http://www.ironicwolf.com/2009/04/aspect-the-ruby-way/&lt;br /&gt;
&lt;br /&gt;
9. http://rubyforge.org/frs/?group_id=4281&lt;/div&gt;</summary>
		<author><name>Ajain9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=37563</id>
		<title>CSC/ECE 517 Fall 2010/ch3 3d AI</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=37563"/>
		<updated>2010-10-07T01:35:47Z</updated>

		<summary type="html">&lt;p&gt;Ajain9: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Aspect Oriented Programming is a programming style which isolates the business logic of the program from its secondary or supporting functions. The basis of the aspect oriented programming is to add a third dimension to pre-existing dimensions of the Procedural Programming and Object Oriented Programming, by describing aspects that cross-cut the structure of the program.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
If we look at the programming field from a distance we’ll generally divide programming&lt;br /&gt;
languages into two main camps: procedural programming(POP) and object-oriented programming (OOP). Like all programming techniques these were invented as ways to structure programming to achieve conceptual separation of components. This separation is obtained by dividing programs into sub-structures of some kind so that we can think and program each one&lt;br /&gt;
as a reasonably separate and autonomous entity.&lt;br /&gt;
&lt;br /&gt;
When using POP we divide our program into separate functions or procedures and compose the program flow by redirecting it from one to another in what is essentially a linear structure. With OOP a second dimension is added as we structure our code into encapsulated units linked to each other. The control flow is now defined dynamically by the object structure and&lt;br /&gt;
polymorphism. Aspect Oriented programming tries to add a third dimension to this structure by&lt;br /&gt;
describing so called aspects that cross-cut the structure of the program. &lt;br /&gt;
&lt;br /&gt;
==Motivation and Terminologies==&lt;br /&gt;
Traditional programming designs had poor modularity due to crosscutting dependencies. Especially in OOP each aspect is scattered by virtue of the function being spread over  numerous unrelated functions or modules which maybe using its functionality, this means changing logging in one function requires modifying all the modules using this functionality, this works on the logic that the users knows/maintains a log of all the functions that use the functionality of the aspect&lt;br /&gt;
Example. &lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure1.png|frame|center]]&lt;br /&gt;
&lt;br /&gt;
Let us consider the example all know and love, Twitter. The model for which is shown in figure 1. If this model were to be implemented in an Object Oriented manner then the security aspect like authentication would have been scattered by virtue of a function called a logging, which is used by both the Users and Posts, a database transaction should encapsulate the operation in order to prevent accidental data loss Also, this operation should be logged onto the system log. We already see that authentication together with logging and transactions are now exhibiting cross-cutting concerns. Now consider the scenario in which the security specifications change , then in order to complete these changes this would require a major effort as the security-related operations are scattered across numerous methods.&lt;br /&gt;
&lt;br /&gt;
==Aspect Oriented Programming==&lt;br /&gt;
Aspect Oriented Programming aims to solve this problem by including the concept called as aspects. Aspects are stand-alone modules used to express cross-cutting concerns. Figure demonstrates how our twitter module now looks with the inclusion of aspects.&lt;br /&gt;
In Java, the aspects contain advice and intertype declarations.&lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure2.png|frame|center]]        &lt;br /&gt;
 In our example our authentication module can include a security check for the users before he/she can access the posts posted by himself and his/her friends. &lt;br /&gt;
&lt;br /&gt;
Key Concepts&lt;br /&gt;
&lt;br /&gt;
Join Points: A well defined location at a point in the execution of a program.&lt;br /&gt;
&lt;br /&gt;
PointCut: A set of join points&lt;br /&gt;
&lt;br /&gt;
Advice: Code designed to run automatically at all join points in a particular pointcut. It can be marked as before, after or around i.e. in place of the join points in the pointcut.&lt;br /&gt;
&lt;br /&gt;
Lexical Introduction: Adding functionality to a class in place as opposed to extending it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==AspectR==&lt;br /&gt;
Aspects such loggin, security login, database session, transactions need to be done at the start of each method. If for example an application starts a session at the beginning of the application start and releases the resource only at the termination. A lot of resources are wasted and also may cause starvation of other applications. Hence we need frequent access to resources every time a needy method is called. Implementing this logic inside the method makes the aspect code repeated and cluttered all over the application source. To avoid this problem Aspect oriented programming can be adopted into the Ruby applications. Where all the aspect oriented functionality can be placed inside one behaviour. This behaviour can then be called before and after each method invocation. Thus making changes in aspect behaviour easy.&lt;br /&gt;
Aspect oriented programming in Ruby can be implemented using Aquarium framework. &lt;br /&gt;
&lt;br /&gt;
===Creating a Simple Aspect in Ruby===&lt;br /&gt;
Let us understand how easily an aspect behavior can be setup.&lt;br /&gt;
&lt;br /&gt;
===Setup===&lt;br /&gt;
Install Aquarium gem from rubyForge website or alternatively use &amp;quot;gem install aquarium&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
Depending on the requirement of the application the aspect behavior may be changed from the one below. The snippet below shows the skeleton of a typical Aspect definition. &lt;br /&gt;
&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 before :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc      &lt;br /&gt;
 end&lt;br /&gt;
 after :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc  &lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Before advice tells what work needs to be done before the method is called.&lt;br /&gt;
After advice tells what work needs to be done after the method ends.&lt;br /&gt;
&lt;br /&gt;
Another way of implementing is using Around Advice.&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 around :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc&lt;br /&gt;
 result = join_point.proceed&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc&lt;br /&gt;
 result  # block returns the result of the proceed.&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
==AspectJ==&lt;br /&gt;
An AspectJ aspect is a crosscutting type consisting of an advice on pointcuts and lexical introduction of behavior into other types. It is a general-purpose aspect-oritented extension to Java. Like Classes, aspects can have internal state and behavior, can extend other aspects and classes, and can implement interfaces. AspectJ uses extensions to the Java programming language to specify the crossing rules. These extensions are designed in such a way that a Java programmer would find no difference in using them. The AspectJ extensions use the following constructs to specify the weaving rules programmatically; they are the building blocks that form the modules that express the crosscutting concern’s implementation.&lt;br /&gt;
&lt;br /&gt;
Join point&lt;br /&gt;
In AspectJ everything revolves around ajoin points, since they are the places where the crosscutting actions are woven in. Lets look at below code snippet:&lt;br /&gt;
&lt;br /&gt;
public class Post{&lt;br /&gt;
...&lt;br /&gt;
void addPost(String text){&lt;br /&gt;
  //add to Post database the given text&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
The join points in the Post Class include the execution of the addPost() method and the access to the database table Post.&lt;br /&gt;
&lt;br /&gt;
Pointcut&lt;br /&gt;
A pointcut can select join point that is a call to a method, and it could also capture the method's context, such as the target object on which the method was called and the method's arguments.&lt;br /&gt;
&lt;br /&gt;
We can write a pointcut that will capture the execution of the addPost() method in the Post class shown earlier:&lt;br /&gt;
execution(void Post.addPost(String))&lt;br /&gt;
&lt;br /&gt;
The pointcut construct in AspectJ allows use of a few wildcards to capture related set of join points. For example,&lt;br /&gt;
the following pointcut captures the execution of all methods in Post class and its subclasses:&lt;br /&gt;
&lt;br /&gt;
execution(void Post+*(..))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
1. http://en.wikipedia.org/wiki/Aspect-oriented_programming&lt;br /&gt;
&lt;br /&gt;
2. http://www.objectmentor.com/resources/articles/AOP_in_Ruby.pdf&lt;br /&gt;
&lt;br /&gt;
3. http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf&lt;br /&gt;
&lt;br /&gt;
4. http://www.cs.virginia.edu/~sullivan/&lt;br /&gt;
&lt;br /&gt;
5. http://www.marvin-steinberg.de/alternative-implementations-for-aspect-oriented-programming-language-constructs-a-case-study-in-ruby/&lt;br /&gt;
&lt;br /&gt;
6. http://www.theserverside.com/news/1364528/Implementing-Object-Caching-with-AOP&lt;br /&gt;
&lt;br /&gt;
7. http://aspectr.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
8. http://www.ironicwolf.com/2009/04/aspect-the-ruby-way/&lt;br /&gt;
&lt;br /&gt;
9. http://rubyforge.org/frs/?group_id=4281&lt;/div&gt;</summary>
		<author><name>Ajain9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=37512</id>
		<title>CSC/ECE 517 Fall 2010/ch3 3d AI</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=37512"/>
		<updated>2010-10-07T00:58:32Z</updated>

		<summary type="html">&lt;p&gt;Ajain9: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Aspect Oriented Programming is a programming style which isolates the business logic of the program from its secondary or supporting functions. The basis of the aspect oriented programming is to add a third dimension to pre-existing dimensions of the Procedural Programming and Object Oriented Programming, by describing aspects that cross-cut the structure of the program.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
If we look at the programming field from a distance we’ll generally divide programming&lt;br /&gt;
languages into two main camps: procedural programming(POP) and object-oriented programming (OOP). Like all programming techniques these were invented as ways to structure programming to achieve conceptual separation of components. This separation is obtained by dividing programs into sub-structures of some kind so that we can think and program each one&lt;br /&gt;
as a reasonably separate and autonomous entity.&lt;br /&gt;
&lt;br /&gt;
When using POP we divide our program into separate functions or procedures and compose the program flow by redirecting it from one to another in what is essentially a linear structure. With OOP a second dimension is added as we structure our code into encapsulated units linked to each other. The control flow is now defined dynamically by the object structure and&lt;br /&gt;
polymorphism. Aspect Oriented programming tries to add a third dimension to this structure by&lt;br /&gt;
describing so called aspects that cross-cut the structure of the program. &lt;br /&gt;
&lt;br /&gt;
==Motivation and Terminologies==&lt;br /&gt;
Traditional programming designs had poor modularity due to crosscutting dependencies. Especially in OOP each aspect is scattered by virtue of the function being spread over  numerous unrelated functions or modules which maybe using its functionality, this means changing logging in one function requires modifying all the modules using this functionality, this works on the logic that the users knows/maintains a log of all the functions that use the functionality of the aspect&lt;br /&gt;
Example. &lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure1.png|frame|center]]&lt;br /&gt;
&lt;br /&gt;
Let us consider the example all know and love, Twitter. The model for which is shown in figure 1. If this model were to be implemented in an Object Oriented manner then the security aspect like authentication would have been scattered by virtue of a function called a logging, which is used by both the Users and Posts, a database transaction should encapsulate the operation in order to prevent accidental data loss Also, this operation should be logged onto the system log. We already see that authentication together with logging and transactions are now exhibiting cross-cutting concerns. Now consider the scenario in which the security specifications change , then in order to complete these changes this would require a major effort as the security-related operations are scattered across numerous methods.&lt;br /&gt;
&lt;br /&gt;
==Aspect Oriented Programming==&lt;br /&gt;
Aspect Oriented Programming aims to solve this problem by including the concept called as aspects. Aspects are stand-alone modules used to express cross-cutting concerns. Figure demonstrates how our twitter module now looks with the inclusion of aspects.&lt;br /&gt;
In Java, the aspects contain advice and intertype declarations.&lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure2.png|frame|center]]        &lt;br /&gt;
 In our example our authentication module can include a security check for the users before he/she can access the posts posted by himself and his/her friends. &lt;br /&gt;
&lt;br /&gt;
Key Concepts&lt;br /&gt;
&lt;br /&gt;
Join Points: A well defined location at a point in the execution of a program.&lt;br /&gt;
&lt;br /&gt;
PointCut: A set of join points&lt;br /&gt;
&lt;br /&gt;
Advice: Code designed to run automatically at all join points in a particular pointcut. It can be marked as before, after or around i.e. in place of the join points in the pointcut.&lt;br /&gt;
&lt;br /&gt;
Lexical Introduction: Adding functionality to a class in place as opposed to extending it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==AspectR==&lt;br /&gt;
Aspects such loggin, security login, database session, transactions need to be done at the start of each method. If for example an application starts a session at the beginning of the application start and releases the resource only at the termination. A lot of resources are wasted and also may cause starvation of other applications. Hence we need frequent access to resources every time a needy method is called. Implementing this logic inside the method makes the aspect code repeated and cluttered all over the application source. To avoid this problem Aspect oriented programming can be adopted into the Ruby applications. Where all the aspect oriented functionality can be placed inside one behaviour. This behaviour can then be called before and after each method invocation. Thus making changes in aspect behaviour easy.&lt;br /&gt;
Aspect oriented programming in Ruby can be implemented using Aquarium framework. &lt;br /&gt;
&lt;br /&gt;
===Creating a Simple Aspect in Ruby===&lt;br /&gt;
Let us understand how easily an aspect behavior can be setup.&lt;br /&gt;
&lt;br /&gt;
===Setup===&lt;br /&gt;
Install Aquarium gem from rubyForge website or alternatively use &amp;quot;gem install aquarium&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
Depending on the requirement of the application the aspect behavior may be changed from the one below. The snippet below shows the skeleton of a typical Aspect definition. &lt;br /&gt;
&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 before :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc      &lt;br /&gt;
 end&lt;br /&gt;
 after :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc  &lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Before advice tells what work needs to be done before the method is called.&lt;br /&gt;
After advice tells what work needs to be done after the method ends.&lt;br /&gt;
&lt;br /&gt;
Another way of implementing is using Around Advice.&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 around :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc&lt;br /&gt;
 result = join_point.proceed&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc&lt;br /&gt;
 result  # block returns the result of the proceed.&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
==AspectJ==&lt;br /&gt;
An AspectJ aspect is a crosscutting type consisting of an advice on pointcuts and lexical introduction of behavior into other types. It is a general-purpose aspect-oritented extension to Java. Like Classes, aspects can have internal state and behavior, can extend other aspects and classes, and can implement interfaces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
1. http://en.wikipedia.org/wiki/Aspect-oriented_programming&lt;br /&gt;
&lt;br /&gt;
2. http://www.objectmentor.com/resources/articles/AOP_in_Ruby.pdf&lt;br /&gt;
&lt;br /&gt;
3. http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf&lt;br /&gt;
&lt;br /&gt;
4. http://www.cs.virginia.edu/~sullivan/&lt;br /&gt;
&lt;br /&gt;
5. http://www.marvin-steinberg.de/alternative-implementations-for-aspect-oriented-programming-language-constructs-a-case-study-in-ruby/&lt;br /&gt;
&lt;br /&gt;
6. http://www.theserverside.com/news/1364528/Implementing-Object-Caching-with-AOP&lt;br /&gt;
&lt;br /&gt;
7. http://aspectr.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
8. http://www.ironicwolf.com/2009/04/aspect-the-ruby-way/&lt;br /&gt;
&lt;br /&gt;
9. http://rubyforge.org/frs/?group_id=4281&lt;/div&gt;</summary>
		<author><name>Ajain9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=37509</id>
		<title>CSC/ECE 517 Fall 2010/ch3 3d AI</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=37509"/>
		<updated>2010-10-07T00:56:08Z</updated>

		<summary type="html">&lt;p&gt;Ajain9: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Aspect Oriented Programming is a programming style which isolates the business logic of the program from its secondary or supporting functions. The basis of the aspect oriented programming is to add a third dimension to pre-existing dimensions of the Procedural Programming and Object Oriented Programming, by describing aspects that cross-cut the structure of the program.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
If we look at the programming field from a distance we’ll generally divide programming&lt;br /&gt;
languages into two main camps: procedural programming(POP) and object-oriented programming (OOP). Like all programming techniques these were invented as ways to structure programming to achieve conceptual separation of components. This separation is obtained by dividing programs into sub-structures of some kind so that we can think and program each one&lt;br /&gt;
as a reasonably separate and autonomous entity.&lt;br /&gt;
&lt;br /&gt;
When using POP we divide our program into separate functions or procedures and compose the program flow by redirecting it from one to another in what is essentially a linear structure. With OOP a second dimension is added as we structure our code into encapsulated units linked to each other. The control flow is now defined dynamically by the object structure and&lt;br /&gt;
polymorphism. Aspect Oriented programming tries to add a third dimension to this structure by&lt;br /&gt;
describing so called aspects that cross-cut the structure of the program. &lt;br /&gt;
&lt;br /&gt;
==Motivation and Terminologies==&lt;br /&gt;
Traditional programming designs had poor modularity due to crosscutting dependencies. Especially in OOP each aspect is scattered by virtue of the function being spread over  numerous unrelated functions or modules which maybe using its functionality, this means changing logging in one function requires modifying all the modules using this functionality, this works on the logic that the users knows/maintains a log of all the functions that use the functionality of the aspect&lt;br /&gt;
Example. &lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure1.png|frame|center]]&lt;br /&gt;
&lt;br /&gt;
Let us consider the example all know and love, Twitter. The model for which is shown in figure 1. If this model were to be implemented in an Object Oriented manner then the security aspect like authentication would have been scattered by virtue of a function called a logging, which is used by both the Users and Posts, a database transaction should encapsulate the operation in order to prevent accidental data loss Also, this operation should be logged onto the system log. We already see that authentication together with logging and transactions are now exhibiting cross-cutting concerns. Now consider the scenario in which the security specifications change , then in order to complete these changes this would require a major effort as the security-related operations are scattered across numerous methods.&lt;br /&gt;
&lt;br /&gt;
==Aspect Oriented Programming==&lt;br /&gt;
Aspect Oriented Programming aims to solve this problem by including the concept called as aspects. Aspects are stand-alone modules used to express cross-cutting concerns. Figure demonstrates how our twitter module now looks with the inclusion of aspects.&lt;br /&gt;
In Java, the aspects contain advice and intertype declarations.&lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure2.png|frame|center]]        &lt;br /&gt;
 In our example our authentication module can include a security check for the users before he/she can access the posts posted by himself and his/her friends. &lt;br /&gt;
&lt;br /&gt;
Concepts&lt;br /&gt;
&lt;br /&gt;
Join Points: A well defined location at a point in the execution of a program.&lt;br /&gt;
PointCut: A set of join points&lt;br /&gt;
Advice: Code designed to run automatically at all join points in a particular pointcut. It can be marked as before, after or around i.e. in place of the join points in the pointcut.&lt;br /&gt;
Lexical Introduction: Adding functionality to a class in place as opposed to extending it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==AspectR==&lt;br /&gt;
Aspects such loggin, security login, database session, transactions need to be done at the start of each method. If for example an application starts a session at the beginning of the application start and releases the resource only at the termination. A lot of resources are wasted and also may cause starvation of other applications. Hence we need frequent access to resources every time a needy method is called. Implementing this logic inside the method makes the aspect code repeated and cluttered all over the application source. To avoid this problem Aspect oriented programming can be adopted into the Ruby applications. Where all the aspect oriented functionality can be placed inside one behaviour. This behaviour can then be called before and after each method invocation. Thus making changes in aspect behaviour easy.&lt;br /&gt;
Aspect oriented programming in Ruby can be implemented using Aquarium framework. &lt;br /&gt;
&lt;br /&gt;
===Creating a Simple Aspect in Ruby===&lt;br /&gt;
Let us understand how easily an aspect behavior can be setup.&lt;br /&gt;
&lt;br /&gt;
===Setup===&lt;br /&gt;
Install Aquarium gem from rubyForge website or alternatively use &amp;quot;gem install aquarium&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
Depending on the requirement of the application the aspect behavior may be changed from the one below. The snippet below shows the skeleton of a typical Aspect definition. &lt;br /&gt;
&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 before :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc      &lt;br /&gt;
 end&lt;br /&gt;
 after :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc  &lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Before advice tells what work needs to be done before the method is called.&lt;br /&gt;
After advice tells what work needs to be done after the method ends.&lt;br /&gt;
&lt;br /&gt;
Another way of implementing is using Around Advice.&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 around :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc&lt;br /&gt;
 result = join_point.proceed&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc&lt;br /&gt;
 result  # block returns the result of the proceed.&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
==AspectJ==&lt;br /&gt;
An AspectJ aspect is a crosscutting type consisting of an advice on pointcuts and lexical introduction of behavior into other types. It is a general-purpose aspect-oritented extension to Java. Like Classes, aspects can have internal state and behavior, can extend other aspects and classes, and can implement interfaces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
1. http://en.wikipedia.org/wiki/Aspect-oriented_programming&lt;br /&gt;
&lt;br /&gt;
2. http://www.objectmentor.com/resources/articles/AOP_in_Ruby.pdf&lt;br /&gt;
&lt;br /&gt;
3. http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf&lt;br /&gt;
&lt;br /&gt;
4. http://www.cs.virginia.edu/~sullivan/&lt;br /&gt;
&lt;br /&gt;
5. http://www.marvin-steinberg.de/alternative-implementations-for-aspect-oriented-programming-language-constructs-a-case-study-in-ruby/&lt;br /&gt;
&lt;br /&gt;
6. http://www.theserverside.com/news/1364528/Implementing-Object-Caching-with-AOP&lt;br /&gt;
&lt;br /&gt;
7. http://aspectr.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
8. http://www.ironicwolf.com/2009/04/aspect-the-ruby-way/&lt;br /&gt;
&lt;br /&gt;
9. http://rubyforge.org/frs/?group_id=4281&lt;/div&gt;</summary>
		<author><name>Ajain9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=37498</id>
		<title>CSC/ECE 517 Fall 2010/ch3 3d AI</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=37498"/>
		<updated>2010-10-07T00:47:56Z</updated>

		<summary type="html">&lt;p&gt;Ajain9: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Aspect Oriented Programming is a programming style which isolates the business logic of the program from its secondary or supporting functions. The basis of the aspect oriented programming is to add a third dimension to pre-existing dimensions of the Procedural Programming and Object Oriented Programming, by describing aspects that cross-cut the structure of the program.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
If we look at the programming field from a distance we’ll generally divide programming&lt;br /&gt;
languages into two main camps: procedural programming(POP) and object-oriented programming (OOP). Like all programming techniques these were invented as ways to structure programming to achieve conceptual separation of components. This separation is obtained by dividing programs into sub-structures of some kind so that we can think and program each one&lt;br /&gt;
as a reasonably separate and autonomous entity.&lt;br /&gt;
&lt;br /&gt;
When using POP we divide our program into separate functions or procedures and compose the program flow by redirecting it from one to another in what is essentially a linear structure. With OOP a second dimension is added as we structure our code into encapsulated units linked to each other. The control flow is now defined dynamically by the object structure and&lt;br /&gt;
polymorphism. Aspect Oriented programming tries to add a third dimension to this structure by&lt;br /&gt;
describing so called aspects that cross-cut the structure of the program. &lt;br /&gt;
&lt;br /&gt;
==Motivation and Terminologies==&lt;br /&gt;
Traditional programming designs had poor modularity due to crosscutting dependencies. Especially in OOP each aspect is scattered by virtue of the function being spread over  numerous unrelated functions or modules which maybe using its functionality, this means changing logging in one function requires modifying all the modules using this functionality, this works on the logic that the users knows/maintains a log of all the functions that use the functionality of the aspect&lt;br /&gt;
Example. &lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure1.png|frame|center]]&lt;br /&gt;
&lt;br /&gt;
Let us consider the example all know and love, Twitter. The model for which is shown in figure 1. If this model were to be implemented in an Object Oriented manner then the security aspect like authentication would have been scattered by virtue of a function called a logging, which is used by both the Users and Posts, a database transaction should encapsulate the operation in order to prevent accidental data loss Also, this operation should be logged onto the system log. We already see that authentication together with logging and transactions are now exhibiting cross-cutting concerns. Now consider the scenario in which the security specifications change , then in order to complete these changes this would require a major effort as the security-related operations are scattered across numerous methods.&lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure2.png|frame|center]]        &lt;br /&gt;
Aspect Oriented Programming aims to solve this problem by including the concept called as aspects. Aspects are stand-alone modules used to express cross-cutting concerns. Figure demonstrates how our twitter module now looks with the inclusion of aspects.&lt;br /&gt;
In Java, the aspects contain advice and intertype declarations. In our example our authentication module can include a security check for the users before he/she can access the posts posted by himself and his/her friends. The pointcuts in JAVA defines the times when one can access the user account, and the code in the advice body defines how the authentication implementation takes place.   &lt;br /&gt;
Join points in Aspect Oriented Programming&lt;br /&gt;
&lt;br /&gt;
==AspectR==&lt;br /&gt;
Aspects such loggin, security login, database session, transactions need to be done at the start of each method. If for example an application starts a session at the beginning of the application start and releases the resource only at the termination. A lot of resources are wasted and also may cause starvation of other applications. Hence we need frequent access to resources every time a needy method is called. Implementing this logic inside the method makes the aspect code repeated and cluttered all over the application source. To avoid this problem Aspect oriented programming can be adopted into the Ruby applications. Where all the aspect oriented functionality can be placed inside one behaviour. This behaviour can then be called before and after each method invocation. Thus making changes in aspect behaviour easy.&lt;br /&gt;
Aspect oriented programming in Ruby can be implemented using Aquarium framework. &lt;br /&gt;
&lt;br /&gt;
===Creating a Simple Aspect in Ruby===&lt;br /&gt;
Let us understand how easily an aspect behavior can be setup.&lt;br /&gt;
&lt;br /&gt;
===Setup===&lt;br /&gt;
Install Aquarium gem from rubyForge website or alternatively use &amp;quot;gem install aquarium&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
Depending on the requirement of the application the aspect behavior may be changed from the one below. The snippet below shows the skeleton of a typical Aspect definition. &lt;br /&gt;
&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 before :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc      &lt;br /&gt;
 end&lt;br /&gt;
 after :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc  &lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Before advice tells what work needs to be done before the method is called.&lt;br /&gt;
After advice tells what work needs to be done after the method ends.&lt;br /&gt;
&lt;br /&gt;
Another way of implementing is using Around Advice.&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 around :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc&lt;br /&gt;
 result = join_point.proceed&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc&lt;br /&gt;
 result  # block returns the result of the proceed.&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
==AspectJ==&lt;br /&gt;
An AspectJ aspect is a crosscutting type consisting of an advice on pointcuts and lexical introduction of behavior into other types. It is a general-purpose aspect-oritented extension to Java. Like Classes, aspects can have internal state and behavior, can extend other aspects and classes, and can implement interfaces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
1. http://en.wikipedia.org/wiki/Aspect-oriented_programming&lt;br /&gt;
&lt;br /&gt;
2. http://www.objectmentor.com/resources/articles/AOP_in_Ruby.pdf&lt;br /&gt;
&lt;br /&gt;
3. http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf&lt;br /&gt;
&lt;br /&gt;
4. http://www.cs.virginia.edu/~sullivan/&lt;br /&gt;
&lt;br /&gt;
5. http://www.marvin-steinberg.de/alternative-implementations-for-aspect-oriented-programming-language-constructs-a-case-study-in-ruby/&lt;br /&gt;
&lt;br /&gt;
6. http://www.theserverside.com/news/1364528/Implementing-Object-Caching-with-AOP&lt;br /&gt;
&lt;br /&gt;
7. http://aspectr.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
8. http://www.ironicwolf.com/2009/04/aspect-the-ruby-way/&lt;br /&gt;
&lt;br /&gt;
9. http://rubyforge.org/frs/?group_id=4281&lt;/div&gt;</summary>
		<author><name>Ajain9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=37490</id>
		<title>CSC/ECE 517 Fall 2010/ch3 3d AI</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=37490"/>
		<updated>2010-10-07T00:40:12Z</updated>

		<summary type="html">&lt;p&gt;Ajain9: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Aspect Oriented Programming is a programming style which isolates the business logic of the program from its secondary or supporting functions. The basis of the aspect oriented programming is to add a third dimension to pre-existing dimensions of the Procedural Programming and Object Oriented Programming, by describing aspects that cross-cut the structure of the program.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
If we look at the programming field from a distance we’ll generally divide programming&lt;br /&gt;
languages into two main camps: procedural programming(POP) and object-oriented programming (OOP). Like all programming techniques these were invented as ways to structure programming to achieve conceptual separation of components. This separation is obtained by dividing programs into sub-structures of some kind so that we can think and program each one&lt;br /&gt;
as a reasonably separate and autonomous entity.&lt;br /&gt;
&lt;br /&gt;
When using POP we divide our program into separate functions or procedures and compose the program flow by redirecting it from one to another in what is essentially a linear structure. With OOP a second dimension is added as we structure our code into encapsulated units linked to each other. The control flow is now defined dynamically by the object structure and&lt;br /&gt;
polymorphism. Aspect Oriented programming tries to add a third dimension to this structure by&lt;br /&gt;
describing so called aspects that cross-cut the structure of the program. &lt;br /&gt;
&lt;br /&gt;
==Motivation and Terminologies==&lt;br /&gt;
Traditional programming designs had poor modularity due to crosscutting dependencies. Especially in OOP each aspect is scattered by virtue of the function being spread over  numerous unrelated functions or modules which maybe using its functionality, this means changing logging in one function requires modifying all the modules using this functionality, this works on the logic that the users knows/maintains a log of all the functions that use the functionality of the aspect&lt;br /&gt;
Example. &lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure1.png|frame|center]]&lt;br /&gt;
&lt;br /&gt;
Let us consider the example all know and love, Twitter. The model for which is shown in figure 1. If this model were to be implemented in an Object Oriented manner then the security aspect like authentication would have been scattered by virtue of a function called a logging, which is used by both the Users and Posts, a database transaction should encapsulate the operation in order to prevent accidental data loss Also, this operation should be logged onto the system log. We already see that authentication together with logging and transactions are now exhibiting cross-cutting concerns. Now consider the scenario in which the security specifications change , then in order to complete these changes this would require a major effort as the security-related operations are scattered across numerous methods.&lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure2.png|frame|center]]        &lt;br /&gt;
Aspect Oriented Programming aims to solve this problem by including the concept called as aspects. Aspects are stand-alone modules used to express cross-cutting concerns. Figure demonstrates how our twitter module now looks with the inclusion of aspects.&lt;br /&gt;
In Java, the aspects contain advice and intertype declarations. In our example our authentication module can include a security check for the users before he/she can access the posts posted by himself and his/her friends. The pointcuts in JAVA defines the times when one can access the user account, and the code in the advice body defines how the authentication implementation takes place.   &lt;br /&gt;
Join points in Aspect Oriented Programming&lt;br /&gt;
&lt;br /&gt;
==AspectR==&lt;br /&gt;
Aspects such loggin, security login, database session, transactions need to be done at the start of each method. If for example an application starts a session at the beginning of the application start and releases the resource only at the termination. A lot of resources are wasted and also may cause starvation of other applications. Hence we need frequent access to resources every time a needy method is called. Implementing this logic inside the method makes the aspect code repeated and cluttered all over the application source. To avoid this problem Aspect oriented programming can be adopted into the Ruby applications. Where all the aspect oriented functionality can be placed inside one behaviour. This behaviour can then be called before and after each method invocation. Thus making changes in aspect behaviour easy.&lt;br /&gt;
Aspect oriented programming in Ruby can be implemented using Aquarium framework. &lt;br /&gt;
&lt;br /&gt;
===Creating a Simple Aspect in Ruby===&lt;br /&gt;
Let us understand how easily an aspect behavior can be setup.&lt;br /&gt;
&lt;br /&gt;
===Setup===&lt;br /&gt;
Install Aquarium gem from rubyForge website or alternatively use &amp;quot;gem install aquarium&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
Depending on the requirement of the application the aspect behavior may be changed from the one below. The snippet below shows the skeleton of a typical Aspect definition. &lt;br /&gt;
&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 before :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc      &lt;br /&gt;
 end&lt;br /&gt;
 after :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc  &lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Before advice tells what work needs to be done before the method is called.&lt;br /&gt;
After advice tells what work needs to be done after the method ends.&lt;br /&gt;
&lt;br /&gt;
Another way of implementing is using Around Advice.&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 around :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc&lt;br /&gt;
 result = join_point.proceed&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc&lt;br /&gt;
 result  # block returns the result of the proceed.&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
==References==&lt;br /&gt;
1. http://en.wikipedia.org/wiki/Aspect-oriented_programming&lt;br /&gt;
&lt;br /&gt;
2. http://www.objectmentor.com/resources/articles/AOP_in_Ruby.pdf&lt;br /&gt;
&lt;br /&gt;
3. http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf&lt;br /&gt;
&lt;br /&gt;
4. http://www.cs.virginia.edu/~sullivan/&lt;br /&gt;
&lt;br /&gt;
5. http://www.marvin-steinberg.de/alternative-implementations-for-aspect-oriented-programming-language-constructs-a-case-study-in-ruby/&lt;br /&gt;
&lt;br /&gt;
6. http://www.theserverside.com/news/1364528/Implementing-Object-Caching-with-AOP&lt;br /&gt;
&lt;br /&gt;
7. http://aspectr.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
8. http://www.ironicwolf.com/2009/04/aspect-the-ruby-way/&lt;br /&gt;
&lt;br /&gt;
9. http://rubyforge.org/frs/?group_id=4281&lt;/div&gt;</summary>
		<author><name>Ajain9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=37471</id>
		<title>CSC/ECE 517 Fall 2010/ch3 3d AI</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=37471"/>
		<updated>2010-10-07T00:32:23Z</updated>

		<summary type="html">&lt;p&gt;Ajain9: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Aspect Oriented Programming is a programming style which isolates the business logic of the program from its secondary or supporting functions. The basis of the aspect oriented programming is to add a third dimension to pre-existing dimensions of the Procedural Programming and Object Oriented Programming, by describing aspects that cross-cut the structure of the program.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
If we look at the programming field from a distance we’ll generally divide programming&lt;br /&gt;
languages into two main camps: procedural programming(POP) and object-oriented programming (OOP). Like all programming techniques these were invented as ways to structure programming to achieve conceptual separation of components. This separation is obtained by dividing programs into sub-structures of some kind so that we can think and program each one&lt;br /&gt;
as a reasonably separate and autonomous entity.&lt;br /&gt;
&lt;br /&gt;
When using POP we divide our program into separate functions or procedures and compose the program flow by redirecting it from one to another in what is essentially a linear structure. With OOP a second dimension is added as we structure our code into encapsulated units linked to each other. The control flow is now defined dynamically by the object structure and&lt;br /&gt;
polymorphism. Aspect Oriented programming tries to add a third dimension to this structure by&lt;br /&gt;
describing so called aspects that cross-cut the structure of the program. &lt;br /&gt;
&lt;br /&gt;
==Motivation and Terminologies==&lt;br /&gt;
Traditional programming designs had poor modularity due to crosscutting dependencies. Especially in OOP each aspect is scattered by virtue of the function being spread over  numerous unrelated functions or modules which maybe using its functionality, this means changing logging in one function requires modifying all the modules using this functionality, this works on the logic that the users knows/maintains a log of all the functions that use the functionality of the aspect&lt;br /&gt;
Example. &lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure1.png|frame|center]]&lt;br /&gt;
&lt;br /&gt;
Let us consider the example all know and love, Twitter. The model for which is shown in figure 1. If this model were to be implemented in an Object Oriented manner then the security aspect like authentication would have been scattered by virtue of a function called a logging, which is used by both the Users and Posts, a database transaction should encapsulate the operation in order to prevent accidental data loss Also, this operation should be logged onto the system log. We already see that authentication together with logging and transactions are now exhibiting cross-cutting concerns. Now consider the scenario in which the security specifications change , then in order to complete these changes this would require a major effort as the security-related operations are scattered across numerous methods.&lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure2.png|frame|center]]        &lt;br /&gt;
Aspect Oriented Programming aims to solve this problem by including the concept called as aspects. Aspects are stand-alone modules used to express cross-cutting concerns. Figure demonstrates how our twitter module now looks with the inclusion of aspects.&lt;br /&gt;
In Java, the aspects contain advice and intertype declarations. In our example our authentication module can include a security check for the users before he/she can access the posts posted by himself and his/her friends. The pointcuts in JAVA defines the times when one can access the user account, and the code in the advice body defines how the authentication implementation takes place.   &lt;br /&gt;
Join points in Aspect Oriented Programming&lt;br /&gt;
&lt;br /&gt;
==AspectR==&lt;br /&gt;
Aspects such loggin, security login, database session, transactions need to be done at the start of each method. If for example an application starts a session at the beginning of the application start and releases the resource only at the termination. A lot of resources are wasted and also may cause starvation of other applications. Hence we need frequent access to resources every time a needy method is called. Implementing this logic inside the method makes the aspect code repeated and cluttered all over the application source. To avoid this problem Aspect oriented programming can be adopted into the Ruby applications. Where all the aspect oriented functionality can be placed inside one behaviour. This behaviour can then be called before and after each method invocation. Thus making changes in aspect behaviour easy.&lt;br /&gt;
Aspect oriented programming in Ruby can be implemented using Aquarium framework. &lt;br /&gt;
&lt;br /&gt;
==Creating a Simple Aspect in Ruby==&lt;br /&gt;
Let us understand how easily an aspect behavior can be setup.&lt;br /&gt;
&lt;br /&gt;
===Setup===&lt;br /&gt;
Install Aquarium gem from rubyForge website or alternatively use &amp;quot;gem install aquarium&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
Depending on the requirement of the application the aspect behavior may be changed from the one below. The snippet below shows the skeleton of a typical Aspect definition. &lt;br /&gt;
&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 before :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc      &lt;br /&gt;
 end&lt;br /&gt;
 after :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc  &lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Before advice tells what work needs to be done before the method is called.&lt;br /&gt;
After advice tells what work needs to be done after the method ends.&lt;br /&gt;
&lt;br /&gt;
Another way of implementing is using Around Advice.&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 around :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc&lt;br /&gt;
 result = join_point.proceed&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc&lt;br /&gt;
 result  # block returns the result of the proceed.&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
==References==&lt;br /&gt;
1. http://en.wikipedia.org/wiki/Aspect-oriented_programming&lt;br /&gt;
&lt;br /&gt;
2. http://www.objectmentor.com/resources/articles/AOP_in_Ruby.pdf&lt;br /&gt;
&lt;br /&gt;
3. http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf&lt;br /&gt;
&lt;br /&gt;
4. http://www.cs.virginia.edu/~sullivan/&lt;br /&gt;
&lt;br /&gt;
5. http://www.marvin-steinberg.de/alternative-implementations-for-aspect-oriented-programming-language-constructs-a-case-study-in-ruby/&lt;br /&gt;
&lt;br /&gt;
6. http://www.theserverside.com/news/1364528/Implementing-Object-Caching-with-AOP&lt;br /&gt;
&lt;br /&gt;
7. http://aspectr.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
8. http://www.ironicwolf.com/2009/04/aspect-the-ruby-way/&lt;br /&gt;
&lt;br /&gt;
9. http://rubyforge.org/frs/?group_id=4281&lt;/div&gt;</summary>
		<author><name>Ajain9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=37466</id>
		<title>CSC/ECE 517 Fall 2010/ch3 3d AI</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=37466"/>
		<updated>2010-10-07T00:30:37Z</updated>

		<summary type="html">&lt;p&gt;Ajain9: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Aspect Oriented Programming is a programming style which isolates the business logic of the program from its secondary or supporting functions. The basis of the aspect oriented programming is to add a third dimension to pre-existing dimensions of the Procedural Programming and Object Oriented Programming, by describing aspects that cross-cut the structure of the program.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
If we look at the programming field from a distance we’ll generally divide programming&lt;br /&gt;
languages into two main camps: procedural programming(POP) and object-oriented programming (OOP). Like all programming techniques these were invented as ways to structure programming to achieve conceptual separation of components. This separation is obtained by dividing programs into sub-structures of some kind so that we can think and program each one&lt;br /&gt;
as a reasonably separate and autonomous entity.&lt;br /&gt;
&lt;br /&gt;
When using POP we divide our program into separate functions or procedures and compose the program flow by redirecting it from one to another in what is essentially a linear structure. With OOP a second dimension is added as we structure our code into encapsulated units linked to each other. The control flow is now defined dynamically by the object structure and&lt;br /&gt;
polymorphism. Aspect Oriented programming tries to add a third dimension to this structure by&lt;br /&gt;
describing so called aspects that cross-cut the structure of the program. &lt;br /&gt;
&lt;br /&gt;
==Motivation and Terminologies==&lt;br /&gt;
Traditional programming designs had poor modularity due to crosscutting dependencies. Especially in OOP each aspect is scattered by virtue of the function being spread over  numerous unrelated functions or modules which maybe using its functionality, this means changing logging in one function requires modifying all the modules using this functionality, this works on the logic that the users knows/maintains a log of all the functions that use the functionality of the aspect&lt;br /&gt;
Example. &lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure1.png|frame|center]]&lt;br /&gt;
&lt;br /&gt;
Let us consider the example all know and love, Twitter. The model for which is shown in figure 1. If this model were to be implemented in an Object Oriented manner then the security aspect like authentication would have been scattered by virtue of a function called a logging, which is used by both the Users and Posts, a database transaction should encapsulate the operation in order to prevent accidental data loss Also, this operation should be logged onto the system log. We already see that authentication together with logging and transactions are now exhibiting cross-cutting concerns. Now consider the scenario in which the security specifications change , then in order to complete these changes this would require a major effort as the security-related operations are scattered across numerous methods.&lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure2.png|frame|center]]        &lt;br /&gt;
Aspect Oriented Programming aims to solve this problem by including the concept called as aspects. Aspects are stand-alone modules used to express cross-cutting concerns. Figure demonstrates how our twitter module now looks with the inclusion of aspects.&lt;br /&gt;
In Java, the aspects contain advice and intertype declarations. In our example our authentication module can include a security check for the users before he/she can access the posts posted by himself and his/her friends. The pointcuts in JAVA defines the times when one can access the user account, and the code in the advice body defines how the authentication implementation takes place.   &lt;br /&gt;
Join points in Aspect Oriented Programming&lt;br /&gt;
&lt;br /&gt;
==AspectR==&lt;br /&gt;
Aspects such loggin, security login, database session, transactions need to be done at the start of each method. If for example an application starts a session at the beginning of the application start and releases the resource only at the termination. A lot of resources are wasted and also may cause starvation of other applications. Hence we need frequent access to resources every time a needy method is called. Implementing this logic inside the method makes the aspect code repeated and cluttered all over the application source. To avoid this problem Aspect oriented programming can be adopted into the Ruby applications. Where all the aspect oriented functionality can be placed inside one behaviour. This behaviour can then be called before and after each method invocation. Thus making changes in aspect behaviour easy.&lt;br /&gt;
Aspect oriented programming in Ruby can be implemented using Aquarium framework. &lt;br /&gt;
&lt;br /&gt;
==Creating a Simple Aspect in Ruby==&lt;br /&gt;
Let us understand how easily an aspect behavior can be setup.&lt;br /&gt;
&lt;br /&gt;
===Setup===&lt;br /&gt;
Install Aquarium gem from http://rubyforge.org/frs/?group_id=4281&lt;br /&gt;
alternatively use gem install aquarium&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
Depending on the requirement of the application the aspect behavior may be changed from the one below. The snippet below shows the skeleton of a typical Aspect definition. &lt;br /&gt;
&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 before :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc      &lt;br /&gt;
 end&lt;br /&gt;
 after :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc  &lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Before advice tells what work needs to be done before the method is called.&lt;br /&gt;
After advice tells what work needs to be done after the method ends.&lt;br /&gt;
&lt;br /&gt;
Another way of implementing is using Around Advice.&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 around :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc&lt;br /&gt;
 result = join_point.proceed&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc&lt;br /&gt;
 result  # block returns the result of the proceed.&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
==References==&lt;br /&gt;
1. http://en.wikipedia.org/wiki/Aspect-oriented_programming&lt;br /&gt;
&lt;br /&gt;
2. http://www.objectmentor.com/resources/articles/AOP_in_Ruby.pdf&lt;br /&gt;
&lt;br /&gt;
3. http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf&lt;br /&gt;
&lt;br /&gt;
4. http://www.cs.virginia.edu/~sullivan/&lt;br /&gt;
&lt;br /&gt;
5. http://www.marvin-steinberg.de/alternative-implementations-for-aspect-oriented-programming-language-constructs-a-case-study-in-ruby/&lt;br /&gt;
&lt;br /&gt;
6. http://www.theserverside.com/news/1364528/Implementing-Object-Caching-with-AOP&lt;br /&gt;
&lt;br /&gt;
7. http://aspectr.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
8. http://www.ironicwolf.com/2009/04/aspect-the-ruby-way/&lt;/div&gt;</summary>
		<author><name>Ajain9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=37462</id>
		<title>CSC/ECE 517 Fall 2010/ch3 3d AI</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=37462"/>
		<updated>2010-10-07T00:28:54Z</updated>

		<summary type="html">&lt;p&gt;Ajain9: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Aspect Oriented Programming is a programming style which isolates the business logic of the program from its secondary or supporting functions. The basis of the aspect oriented programming is to add a third dimension to pre-existing dimensions of the Procedural Programming and Object Oriented Programming, by describing aspects that cross-cut the structure of the program.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
If we look at the programming field from a distance we’ll generally divide programming&lt;br /&gt;
languages into two main camps: procedural programming(POP) and object-oriented programming (OOP). Like all programming techniques these were invented as ways to structure programming to achieve conceptual separation of components. This separation is obtained by dividing programs into sub-structures of some kind so that we can think and program each one&lt;br /&gt;
as a reasonably separate and autonomous entity.&lt;br /&gt;
&lt;br /&gt;
When using POP we divide our program into separate functions or procedures and compose the program flow by redirecting it from one to another in what is essentially a linear structure. With OOP a second dimension is added as we structure our code into encapsulated units linked to each other. The control flow is now defined dynamically by the object structure and&lt;br /&gt;
polymorphism. Aspect Oriented programming tries to add a third dimension to this structure by&lt;br /&gt;
describing so called aspects that cross-cut the structure of the program. &lt;br /&gt;
&lt;br /&gt;
==Motivation and Terminologies==&lt;br /&gt;
Traditional programming designs had poor modularity due to crosscutting dependencies. Especially in OOP each aspect is scattered by virtue of the function being spread over  numerous unrelated functions or modules which maybe using its functionality, this means changing logging in one function requires modifying all the modules using this functionality, this works on the logic that the users knows/maintains a log of all the functions that use the functionality of the aspect&lt;br /&gt;
Example. &lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure1.png|frame|center]]&lt;br /&gt;
&lt;br /&gt;
Let us consider the example all know and love, Twitter. The model for which is shown in figure 1. If this model were to be implemented in an Object Oriented manner then the security aspect like authentication would have been scattered by virtue of a function called a logging, which is used by both the Users and Posts, a database transaction should encapsulate the operation in order to prevent accidental data loss Also, this operation should be logged onto the system log. We already see that authentication together with logging and transactions are now exhibiting cross-cutting concerns. Now consider the scenario in which the security specifications change , then in order to complete these changes this would require a major effort as the security-related operations are scattered across numerous methods.&lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure2.png|frame|center]]        &lt;br /&gt;
Aspect Oriented Programming aims to solve this problem by including the concept called as aspects. Aspects are stand-alone modules used to express cross-cutting concerns. Figure demonstrates how our twitter module now looks with the inclusion of aspects.&lt;br /&gt;
In Java, the aspects contain advice and intertype declarations. In our example our authentication module can include a security check for the users before he/she can access the posts posted by himself and his/her friends. The pointcuts in JAVA defines the times when one can access the user account, and the code in the advice body defines how the authentication implementation takes place.   &lt;br /&gt;
Join points in Aspect Oriented Programming&lt;br /&gt;
&lt;br /&gt;
==AspectR==&lt;br /&gt;
Aspects such loggin, security login, database session, transactions need to be done at the start of each method. If for example an application starts a session at the beginning of the application start and releases the resource only at the termination. A lot of resources are wasted and also may cause starvation of other applications. Hence we need frequent access to resources every time a needy method is called. Implementing this logic inside the method makes the aspect code repeated and cluttered all over the application source. To avoid this problem Aspect oriented programming can be adopted into the Ruby applications. Where all the aspect oriented functionality can be placed inside one behaviour. This behaviour can then be called before and after each method invocation. Thus making changes in aspect behaviour easy.&lt;br /&gt;
Aspect oriented programming in Ruby can be implemented using Aquarium framework. &lt;br /&gt;
&lt;br /&gt;
==Creating a Simple Aspect==&lt;br /&gt;
Let us understand how easily an aspect behavior can be setup.&lt;br /&gt;
&lt;br /&gt;
===Setup===&lt;br /&gt;
Install Aquarium gem from http://rubyforge.org/frs/?group_id=4281&lt;br /&gt;
alternatively use gem install aquarium&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
Depending on the requirement of the application the aspect behavior may be changed from the one below. The snippet below shows the skeleton of a typical Aspect definition. &lt;br /&gt;
&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 before :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc      &lt;br /&gt;
 end&lt;br /&gt;
 after :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc  &lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Before advice tells what work needs to be done before the method is called.&lt;br /&gt;
After advice tells what work needs to be done after the method ends.&lt;br /&gt;
&lt;br /&gt;
Another way of implementing is using Around Advice.&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 around :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc&lt;br /&gt;
 result = join_point.proceed&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc&lt;br /&gt;
 result  # block returns the result of the proceed.&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
==References==&lt;br /&gt;
1. http://en.wikipedia.org/wiki/Aspect-oriented_programming&lt;br /&gt;
&lt;br /&gt;
2. http://www.objectmentor.com/resources/articles/AOP_in_Ruby.pdf&lt;br /&gt;
&lt;br /&gt;
3. http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf&lt;br /&gt;
&lt;br /&gt;
4. http://www.cs.virginia.edu/~sullivan/&lt;br /&gt;
&lt;br /&gt;
5. http://www.marvin-steinberg.de/alternative-implementations-for-aspect-oriented-programming-language-constructs-a-case-study-in-ruby/&lt;br /&gt;
&lt;br /&gt;
6. http://www.theserverside.com/news/1364528/Implementing-Object-Caching-with-AOP&lt;br /&gt;
&lt;br /&gt;
7. http://aspectr.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
8. http://www.ironicwolf.com/2009/04/aspect-the-ruby-way/&lt;/div&gt;</summary>
		<author><name>Ajain9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=37460</id>
		<title>CSC/ECE 517 Fall 2010/ch3 3d AI</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=37460"/>
		<updated>2010-10-07T00:28:26Z</updated>

		<summary type="html">&lt;p&gt;Ajain9: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Aspect Oriented Programming is a programming style which isolates the business logic of the program from its secondary or supporting functions. The basis of the aspect oriented programming is to add a third dimension to pre-existing dimensions of the Procedural Programming and Object Oriented Programming, by describing aspects that cross-cut the structure of the program.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
If we look at the programming field from a distance we’ll generally divide programming&lt;br /&gt;
languages into two main camps: procedural programming(POP) and object-oriented programming (OOP). Like all programming techniques these were invented as ways to structure programming to achieve conceptual separation of components. This separation is obtained by dividing programs into sub-structures of some kind so that we can think and program each one&lt;br /&gt;
as a reasonably separate and autonomous entity.&lt;br /&gt;
&lt;br /&gt;
When using POP we divide our program into separate functions or procedures and compose the program flow by redirecting it from one to another in what is essentially a linear structure. With OOP a second dimension is added as we structure our code into encapsulated units linked to each other. The control flow is now defined dynamically by the object structure and&lt;br /&gt;
polymorphism. Aspect Oriented programming tries to add a third dimension to this structure by&lt;br /&gt;
describing so called aspects that cross-cut the structure of the program. &lt;br /&gt;
&lt;br /&gt;
==Motivation and Terminologies==&lt;br /&gt;
Traditional programming designs had poor modularity due to crosscutting dependencies. Especially in OOP each aspect is scattered by virtue of the function being spread over  numerous unrelated functions or modules which maybe using its functionality, this means changing logging in one function requires modifying all the modules using this functionality, this works on the logic that the users knows/maintains a log of all the functions that use the functionality of the aspect&lt;br /&gt;
Example. &lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure1.png|frame|center]]&lt;br /&gt;
&lt;br /&gt;
Let us consider the example all know and love, Twitter. The model for which is shown in figure 1. If this model were to be implemented in an Object Oriented manner then the security aspect like authentication would have been scattered by virtue of a function called a logging, which is used by both the Users and Posts, a database transaction should encapsulate the operation in order to prevent accidental data loss Also, this operation should be logged onto the system log. We already see that authentication together with logging and transactions are now exhibiting cross-cutting concerns. Now consider the scenario in which the security specifications change , then in order to complete these changes this would require a major effort as the security-related operations are scattered across numerous methods.&lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure2.png|frame|center]]        &lt;br /&gt;
Aspect Oriented Programming aims to solve this problem by including the concept called as aspects. Aspects are stand-alone modules used to express cross-cutting concerns. Figure demonstrates how our twitter module now looks with the inclusion of aspects.&lt;br /&gt;
In Java, the aspects contain advice and intertype declarations. In our example our authentication module can include a security check for the users before he/she can access the posts posted by himself and his/her friends. The pointcuts in JAVA defines the times when one can access the user account, and the code in the advice body defines how the authentication implementation takes place.   &lt;br /&gt;
Join points in Aspect Oriented Programming&lt;br /&gt;
&lt;br /&gt;
==AspectR==&lt;br /&gt;
Aspects such loggin, security login, database session, transactions need to be done at the start of each method. If for example an application starts a session at the beginning of the application start and releases the resource only at the termination. A lot of resources are wasted and also may cause starvation of other applications. Hence we need frequent access to resources every time a needy method is called. Implementing this logic inside the method makes the aspect code repeated and cluttered all over the application source. To avoid this problem Aspect oriented programming can be adopted into the Ruby applications. Where all the aspect oriented functionality can be placed inside one behaviour. This behaviour can then be called before and after each method invocation. Thus making changes in aspect behaviour easy.&lt;br /&gt;
Aspect oriented programming in Ruby can be implemented using Aquarium framework. &lt;br /&gt;
&lt;br /&gt;
==Creating a Simple Aspect==&lt;br /&gt;
Let us understand how easily an aspect behavior can be setup.&lt;br /&gt;
&lt;br /&gt;
===Setup===&lt;br /&gt;
Install Aquarium gem from http://rubyforge.org/frs/?group_id=4281&lt;br /&gt;
alternatively use gem install aquarium&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
Depending on the requirement of the application the aspect behavior may be changed from the one below. The snippet below shows the skeleton of a typical Aspect definition. &lt;br /&gt;
&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 before :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc      &lt;br /&gt;
 end&lt;br /&gt;
 after :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc  &lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Before advice tells what work needs to be done before the method is called.&lt;br /&gt;
After advice tells what work needs to be done after the method ends.&lt;br /&gt;
&lt;br /&gt;
Another way of implementing is using Around Advice.&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 around :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc&lt;br /&gt;
 result = join_point.proceed&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc&lt;br /&gt;
 result  # block returns the result of the proceed.&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
==References==&lt;br /&gt;
1. http://en.wikipedia.org/wiki/Aspect-oriented_programming&lt;br /&gt;
2. http://www.objectmentor.com/resources/articles/AOP_in_Ruby.pdf&lt;br /&gt;
3. http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf&lt;br /&gt;
4. http://www.cs.virginia.edu/~sullivan/&lt;br /&gt;
5. http://www.marvin-steinberg.de/alternative-implementations-for-aspect-oriented-programming-language-constructs-a-case-study-in-ruby/&lt;br /&gt;
6. http://www.theserverside.com/news/1364528/Implementing-Object-Caching-with-AOP&lt;br /&gt;
7. http://aspectr.sourceforge.net/&lt;br /&gt;
8. http://www.ironicwolf.com/2009/04/aspect-the-ruby-way/&lt;/div&gt;</summary>
		<author><name>Ajain9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=37456</id>
		<title>CSC/ECE 517 Fall 2010/ch3 3d AI</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=37456"/>
		<updated>2010-10-07T00:27:25Z</updated>

		<summary type="html">&lt;p&gt;Ajain9: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Aspect Oriented Programming is a programming style which isolates the business logic of the program from its secondary or supporting functions. The basis of the aspect oriented programming is to add a third dimension to pre-existing dimensions of the Procedural Programming and Object Oriented Programming, by describing aspects that cross-cut the structure of the program.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
If we look at the programming field from a distance we’ll generally divide programming&lt;br /&gt;
languages into two main camps: procedural programming(POP) and object-oriented programming (OOP). Like all programming techniques these were invented as ways to structure programming to achieve conceptual separation of components. This separation is obtained by dividing programs into sub-structures of some kind so that we can think and program each one&lt;br /&gt;
as a reasonably separate and autonomous entity.&lt;br /&gt;
&lt;br /&gt;
When using POP we divide our program into separate functions or procedures and compose the program flow by redirecting it from one to another in what is essentially a linear structure. With OOP a second dimension is added as we structure our code into encapsulated units linked to each other. The control flow is now defined dynamically by the object structure and&lt;br /&gt;
polymorphism. Aspect Oriented programming tries to add a third dimension to this structure by&lt;br /&gt;
describing so called aspects that cross-cut the structure of the program. &lt;br /&gt;
&lt;br /&gt;
==Motivation and Terminologies==&lt;br /&gt;
Traditional programming designs had poor modularity due to crosscutting dependencies. Especially in OOP each aspect is scattered by virtue of the function being spread over  numerous unrelated functions or modules which maybe using its functionality, this means changing logging in one function requires modifying all the modules using this functionality, this works on the logic that the users knows/maintains a log of all the functions that use the functionality of the aspect&lt;br /&gt;
Example. &lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure1.png|frame|center]]&lt;br /&gt;
&lt;br /&gt;
Let us consider the example all know and love, Twitter. The model for which is shown in figure 1. If this model were to be implemented in an Object Oriented manner then the security aspect like authentication would have been scattered by virtue of a function called a logging, which is used by both the Users and Posts, a database transaction should encapsulate the operation in order to prevent accidental data loss Also, this operation should be logged onto the system log. We already see that authentication together with logging and transactions are now exhibiting cross-cutting concerns. Now consider the scenario in which the security specifications change , then in order to complete these changes this would require a major effort as the security-related operations are scattered across numerous methods.&lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure2.png|frame|center]]        &lt;br /&gt;
Aspect Oriented Programming aims to solve this problem by including the concept called as aspects. Aspects are stand-alone modules used to express cross-cutting concerns. Figure demonstrates how our twitter module now looks with the inclusion of aspects.&lt;br /&gt;
In Java, the aspects contain advice and intertype declarations. In our example our authentication module can include a security check for the users before he/she can access the posts posted by himself and his/her friends. The pointcuts in JAVA defines the times when one can access the user account, and the code in the advice body defines how the authentication implementation takes place.   &lt;br /&gt;
Join points in Aspect Oriented Programming&lt;br /&gt;
&lt;br /&gt;
==AspectR==&lt;br /&gt;
Aspects such loggin, security login, database session, transactions need to be done at the start of each method. If for example an application starts a session at the beginning of the application start and releases the resource only at the termination. A lot of resources are wasted and also may cause starvation of other applications. Hence we need frequent access to resources every time a needy method is called. Implementing this logic inside the method makes the aspect code repeated and cluttered all over the application source. To avoid this problem Aspect oriented programming can be adopted into the Ruby applications. Where all the aspect oriented functionality can be placed inside one behaviour. This behaviour can then be called before and after each method invocation. Thus making changes in aspect behaviour easy.&lt;br /&gt;
Aspect oriented programming in Ruby can be implemented using Aquarium framework. &lt;br /&gt;
&lt;br /&gt;
==Creating a Simple Aspect==&lt;br /&gt;
Let us understand how easily an aspect behavior can be setup.&lt;br /&gt;
&lt;br /&gt;
===Setup===&lt;br /&gt;
Install Aquarium gem from http://rubyforge.org/frs/?group_id=4281&lt;br /&gt;
alternatively use gem install aquarium&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
Depending on the requirement of the application the aspect behavior may be changed from the one below. The snippet below shows the skeleton of a typical Aspect definition. &lt;br /&gt;
&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 before :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc      &lt;br /&gt;
 end&lt;br /&gt;
 after :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc  &lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Before advice tells what work needs to be done before the method is called.&lt;br /&gt;
After advice tells what work needs to be done after the method ends.&lt;br /&gt;
&lt;br /&gt;
Another way of implementing is using Around Advice.&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 around :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc&lt;br /&gt;
 result = join_point.proceed&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc&lt;br /&gt;
 result  # block returns the result of the proceed.&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
==References==&lt;br /&gt;
http://en.wikipedia.org/wiki/Aspect-oriented_programming&lt;br /&gt;
http://www.objectmentor.com/resources/articles/AOP_in_Ruby.pdf&lt;br /&gt;
http://paginas.fe.up.pt/~ei01036/artigos/aop.pdf&lt;br /&gt;
http://www.cs.virginia.edu/~sullivan/&lt;br /&gt;
http://www.marvin-steinberg.de/alternative-implementations-for-aspect-oriented-programming-language-constructs-a-case-study-in-ruby/&lt;br /&gt;
http://www.theserverside.com/news/1364528/Implementing-Object-Caching-with-AOP&lt;br /&gt;
http://aspectr.sourceforge.net/&lt;br /&gt;
http://www.ironicwolf.com/2009/04/aspect-the-ruby-way/&lt;/div&gt;</summary>
		<author><name>Ajain9</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=37407</id>
		<title>CSC/ECE 517 Fall 2010/ch3 3d AI</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch3_3d_AI&amp;diff=37407"/>
		<updated>2010-10-06T23:59:41Z</updated>

		<summary type="html">&lt;p&gt;Ajain9: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Aspect Oriented Programming is a programming style which isolates the business logic of the program from its secondary or supporting functions. The basis of the aspect oriented programming is to add a third dimension to pre-existing dimensions of the Procedural Programming and Object Oriented Programming, by describing aspects that cross-cut the structure of the program.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
If we look at the programming field from a distance we’ll generally divide programming&lt;br /&gt;
languages into two main camps: procedural programming(POP) and object-oriented programming (OOP). Like all programming techniques these were invented as ways to structure programming to achieve conceptual separation of components. This separation is obtained by dividing programs into sub-structures of some kind so that we can think and program each one&lt;br /&gt;
as a reasonably separate and autonomous entity.&lt;br /&gt;
&lt;br /&gt;
When using POP we divide our program into separate functions or procedures and compose the program flow by redirecting it from one to another in what is essentially a linear structure. With OOP a second dimension is added as we structure our code into encapsulated units linked to each other. The control flow is now defined dynamically by the object structure and&lt;br /&gt;
polymorphism. Aspect Oriented programming tries to add a third dimension to this structure by&lt;br /&gt;
describing so called aspects that cross-cut the structure of the program. &lt;br /&gt;
&lt;br /&gt;
==Motivation and Terminologies==&lt;br /&gt;
Traditional programming designs had poor modularity due to crosscutting dependencies. Especially in OOP each aspect is scattered by virtue of the function being spread over  numerous unrelated functions or modules which maybe using its functionality, this means changing logging in one function requires modifying all the modules using this functionality, this works on the logic that the users knows/maintains a log of all the functions that use the functionality of the aspect&lt;br /&gt;
Example. &lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure1.png|frame|center]]&lt;br /&gt;
&lt;br /&gt;
Let us consider the example all know and love, Twitter. The model for which is shown in figure 1. If this model were to be implemented in an Object Oriented manner then the security aspect like authentication would have been scattered by virtue of a function called a logging, which is used by both the Users and Posts, a database transaction should encapsulate the operation in order to prevent accidental data loss Also, this operation should be logged onto the system log. We already see that authentication together with logging and transactions are now exhibiting cross-cutting concerns. Now consider the scenario in which the security specifications change , then in order to complete these changes this would require a major effort as the security-related operations are scattered across numerous methods.&lt;br /&gt;
&lt;br /&gt;
                                                 [[Image:Figure2.png|frame|center]]        &lt;br /&gt;
Aspect Oriented Programming aims to solve this problem by including the concept called as aspects. Aspects are stand-alone modules used to express cross-cutting concerns. Figure demonstrates how our twitter module now looks with the inclusion of aspects.&lt;br /&gt;
In Java, the aspects contain advice and intertype declarations. In our example our authentication module can include a security check for the users before he/she can access the posts posted by himself and his/her friends. The pointcuts in JAVA defines the times when one can access the user account, and the code in the advice body defines how the authentication implementation takes place.   &lt;br /&gt;
Join points in Aspect Oriented Programming&lt;br /&gt;
&lt;br /&gt;
==AspectR==&lt;br /&gt;
Aspects such loggin, security login, database session, transactions need to be done at the start of each method. If for example an application starts a session at the beginning of the application start and releases the resource only at the termination. A lot of resources are wasted and also may cause starvation of other applications. Hence we need frequent access to resources every time a needy method is called. Implementing this logic inside the method makes the aspect code repeated and cluttered all over the application source. To avoid this problem Aspect oriented programming can be adopted into the Ruby applications. Where all the aspect oriented functionality can be placed inside one behaviour. This behaviour can then be called before and after each method invocation. Thus making changes in aspect behaviour easy.&lt;br /&gt;
Aspect oriented programming in Ruby can be implemented using Aquarium framework. &lt;br /&gt;
&lt;br /&gt;
==Creating a Simple Aspect==&lt;br /&gt;
Let us understand how easily an aspect behavior can be setup.&lt;br /&gt;
&lt;br /&gt;
===Setup===&lt;br /&gt;
Install Aquarium gem from http://rubyforge.org/frs/?group_id=4281&lt;br /&gt;
alternatively use gem install aquarium&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
Depending on the requirement of the application the aspect behavior may be changed from the one below. The snippet below shows the skeleton of a typical Aspect definition. &lt;br /&gt;
&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 before :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc      &lt;br /&gt;
 end&lt;br /&gt;
 after :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc  &lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Before advice tells what work needs to be done before the method is called.&lt;br /&gt;
After advice tells what work needs to be done after the method ends.&lt;br /&gt;
&lt;br /&gt;
Another way of implementing is using Around Advice.&lt;br /&gt;
 class Aspect_Name&lt;br /&gt;
 include Aquarium::DSL&lt;br /&gt;
 around :calls_to =&amp;gt; :all_methods, :in_types =&amp;gt; /Service$/ do |join_point, object, *args|&lt;br /&gt;
 #Do Aspect Work Like Creating Session, loggin, transaction, security etc&lt;br /&gt;
 result = join_point.proceed&lt;br /&gt;
 #Do Aspect Work Like Ending Session, loggin, transaction, security etc&lt;br /&gt;
 result  # block returns the result of the proceed.&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;/div&gt;</summary>
		<author><name>Ajain9</name></author>
	</entry>
</feed>