CSC/ECE 517 Fall 2012/ch2b 2w48 aa: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
 
(19 intermediate revisions by 2 users not shown)
Line 12: Line 12:
==== Drawbacks ====
==== Drawbacks ====
Although the page provides a good introduction to the Interpreter, it is by no means comprehensive. It does not discuss the advantages and disadvantages of the pattern, nor does it compare it with other patterns.
Although the page provides a good introduction to the Interpreter, it is by no means comprehensive. It does not discuss the advantages and disadvantages of the pattern, nor does it compare it with other patterns.
==== Interpreter (vincehuston.org) ====
 
=== Interpreter Pattern | Object Oriented Design (oodesign.com) ===
This site is a very useful tool to learn any concept about object oriented design and has a good and simple explanation of all the patterns. It gives a basic introduction in the beginning and a motivation about the need for such a pattern. Then it compares the pattern with the Composite Pattern and says that the two can be coupled together in some cases. Then it goes on to give two practical applications of the pattern: Roman Numeral Converter and a rule validator. It concludes saying that this pattern is used for too specific scenarios and that it makes it one of the least frequently used one.
 
=== Interpreter (vincehuston.org) ===
  http://www.vincehuston.org/dp/interpreter.html
  http://www.vincehuston.org/dp/interpreter.html


This website describes the interpreter pattern in simple terms with a real world example. It begins with a two step approach to be followed in order to identify the need for and to implement an interpreter pattern in any problem.Following this is a real world example of the interpreter pattern where it is compared with Musicians represent the musical notation on a staff.
This website describes the interpreter pattern in simple terms with a real world example. It begins with a two step approach to be followed in order to identify the need for and to implement an interpreter pattern in any problem. Following this is a real world example of the interpreter pattern where it is compared with Musicians represent the musical notation on a staff.
The site also provide a checklist that consists of a few simple rules that begin with identifying the need for an interpreter pattern for a given problem and then specify the key steps involved in it’s implementation.
The site also provide a checklist that consists of a few simple rules that begin with identifying the need for an interpreter pattern for a given problem and then specify the key steps involved in it’s implementation.


==== Drawbacks ====
==== Drawbacks ====
The example code that is provided attempts to contrast the interpreter pattern design with an older pattern, but it’s not straightforward which makes it difficult to understand the differences between the two approaches.
The example code that is provided attempts to contrast the interpreter pattern design with an older pattern, but it’s not straightforward which makes it difficult to understand the differences between the two approaches.It also doesn't provide the disadvantages of using the pattern.
 
=== Interpreter - (oodesign.com) ===
http://www.oodesign.com/interpreter-pattern.html
This site provides a brief explanation of the pattern and straightaway dives into it's implementation. The code samples that are provided are simple and clear. They help us understand the basic structure of the interpreter pattern.
 
==== Drawbacks ====
While the site is a good resource for the implementation of the pattern, there's very little information on the actual concept of the interpreter pattern and the motivation for using it.


==== Interpreter Design Pattern (CodeProject) ====
=== Interpreter Design Pattern (CodeProject) ===
  http://www.codeproject.com/Articles/186183/Interpreter-Design-Pattern
  http://www.codeproject.com/Articles/186183/Interpreter-Design-Pattern


This website provides more information on how to build expression trees and parse them using the [http://en.wikipedia.org/wiki/Depth_first_search Depth First Search Pattern].
This website provides more information on how to build expression trees and parse them using the [http://en.wikipedia.org/wiki/Depth_first_search Depth First Search Pattern].


==== Interpreter(Silversoft.net) ====
=== Interpreter(Silversoft.net) ===
  http://www.silversoft.net/docs/dp/hires/pat5cfso.htm
  http://www.silversoft.net/docs/dp/hires/pat5cfso.htm


Line 34: Line 45:
The order in which the examples appear can discourage further reading since, the simpler [http://en.wikipedia.org/wiki/C%2B%2B C++] code appears after the  slightly complicated example in [http://en.wikipedia.org/wiki/Smalltalk SmallTalk] (which is lesser known when compared to C++)
The order in which the examples appear can discourage further reading since, the simpler [http://en.wikipedia.org/wiki/C%2B%2B C++] code appears after the  slightly complicated example in [http://en.wikipedia.org/wiki/Smalltalk SmallTalk] (which is lesser known when compared to C++)


==== Interpreter - Java Developer Tool (Google Developers) ====
=== Interpreter - Java Developer Tool (Google Developers) ===
  https://developers.google.com/java-dev-tools/codepro/doc/features/patterns/interpreter_pattern
  https://developers.google.com/java-dev-tools/codepro/doc/features/patterns/interpreter_pattern


This site gives detailed instructions on how to use the Java developer tool to create a new project using the interpreter pattern.It walks through the wizard that is used to create an interpreter pattern.
This site gives detailed instructions on how to use the Java developer tool to create a new project using the interpreter pattern.It walks through the wizard that is used to create a new project based on this pattern.


==== Drawbacks ====
==== Drawbacks ====
This is not a good reference for understanding the basic concept of the interpreter pattern. With the basic knowledge of the pattern, one can use this site as a reference to go about implementing it. Also, this site is useful only if the implementation language is Java.
This is not a good reference for understanding the basic concepts of the interpreter pattern. With the basic knowledge of the pattern, one can use this site as a reference to go about implementing it. Also, this site is useful only if the implementation language is Java.
 
=== Interpreter Pattern for Runtime Queries (eye-on-objects.com)===
 
  http://eye-on-objects.com/archive1/c_brown.htm
 
This page is an article on Interpreter pattern and delves deeper into its realm and discusses the application of Interpreter pattern for a particular problem. It says how a very specific pattern like the Interpreter Pattern can be applied to a slightly general problem of querying a system for information like patients' details in a hospital. This article is for advanced users and should not be used to understand the basics of the pattern.


== Comparison ==
== Comparison ==
===klk===
The table below provides a comparison of the above mentioned sites and rates them on different parameters on a scale of 1 to 5 which is represented by the number of ☆ symbol.
koj
{| class="wikitable"
|-
! Characteristic !! Site 1 !! Site 2 !! Site 3 !! Site 4 !! Site 5 !! Site 6 !! Site 7 !! Site 8
|-
| Clarity of content & fullness || ☆☆☆☆ || ☆☆☆☆ || ☆☆ || ☆ ||  || ☆ || ☆☆ || ☆☆☆
|-
| Most suitable examples(code) || ☆☆☆ || ☆☆☆ || ☆☆☆ || ☆☆ || ☆☆☆ || ☆☆ || ☆☆ || ☆☆☆
|-
| Comparison with closely related patterns ||  || ☆☆ ||  ||  || ☆☆☆ ||  ||  ||
|-
| Structure of the represented information || ☆☆☆☆ || ☆☆☆☆ || ☆☆ || ☆☆ || ☆ || ☆ || ☆☆ || ☆☆
|-
| Real World usages ||☆☆☆ || ☆☆☆ || ☆☆☆☆ ||  ||  || ☆☆☆ ||  || ☆☆☆
|-
| Disadvantages of the pattern ||  ||☆  ||  || ☆☆☆☆ ||  ||  || ||
|}

Latest revision as of 04:56, 20 November 2012

Interpreter Pattern - Directory of sites

Introduction

This page provides a directory of sites that can be used as reference to learn about the Interpreter Design Pattern that is used in Object Oriented Programming.

Directory of sites

Interpreter Pattern (Wikipedia)

  http://en.wikipedia.org/wiki/Interpreter_pattern

Wikipedia page is the first place one would go to get an introduction about a new topic. The page provides a good introduction to Interpreter Pattern and explains where it can be used. The page also gives a few common examples where the pattern is used, and also gives a programming example by explaining how Reverse Polish Notation can be implemented using Java.

Drawbacks

Although the page provides a good introduction to the Interpreter, it is by no means comprehensive. It does not discuss the advantages and disadvantages of the pattern, nor does it compare it with other patterns.

Interpreter Pattern | Object Oriented Design (oodesign.com)

This site is a very useful tool to learn any concept about object oriented design and has a good and simple explanation of all the patterns. It gives a basic introduction in the beginning and a motivation about the need for such a pattern. Then it compares the pattern with the Composite Pattern and says that the two can be coupled together in some cases. Then it goes on to give two practical applications of the pattern: Roman Numeral Converter and a rule validator. It concludes saying that this pattern is used for too specific scenarios and that it makes it one of the least frequently used one.

Interpreter (vincehuston.org)

http://www.vincehuston.org/dp/interpreter.html

This website describes the interpreter pattern in simple terms with a real world example. It begins with a two step approach to be followed in order to identify the need for and to implement an interpreter pattern in any problem. Following this is a real world example of the interpreter pattern where it is compared with Musicians represent the musical notation on a staff. The site also provide a checklist that consists of a few simple rules that begin with identifying the need for an interpreter pattern for a given problem and then specify the key steps involved in it’s implementation.

Drawbacks

The example code that is provided attempts to contrast the interpreter pattern design with an older pattern, but it’s not straightforward which makes it difficult to understand the differences between the two approaches.It also doesn't provide the disadvantages of using the pattern.

Interpreter - (oodesign.com)

http://www.oodesign.com/interpreter-pattern.html

This site provides a brief explanation of the pattern and straightaway dives into it's implementation. The code samples that are provided are simple and clear. They help us understand the basic structure of the interpreter pattern.

Drawbacks

While the site is a good resource for the implementation of the pattern, there's very little information on the actual concept of the interpreter pattern and the motivation for using it.

Interpreter Design Pattern (CodeProject)

http://www.codeproject.com/Articles/186183/Interpreter-Design-Pattern

This website provides more information on how to build expression trees and parse them using the Depth First Search Pattern.

Interpreter(Silversoft.net)

http://www.silversoft.net/docs/dp/hires/pat5cfso.htm

This website is one of the most comprehensive references for the interpreter pattern. It provides detailed information about the classes and all the collaborators in the pattern. It also lists out the advantages of using this pattern and also some of the issues one may face when using this pattern.There are two example programs, that are clearly explained in full detail.

Drawbacks

The order in which the examples appear can discourage further reading since, the simpler C++ code appears after the slightly complicated example in SmallTalk (which is lesser known when compared to C++)

Interpreter - Java Developer Tool (Google Developers)

https://developers.google.com/java-dev-tools/codepro/doc/features/patterns/interpreter_pattern

This site gives detailed instructions on how to use the Java developer tool to create a new project using the interpreter pattern.It walks through the wizard that is used to create a new project based on this pattern.

Drawbacks

This is not a good reference for understanding the basic concepts of the interpreter pattern. With the basic knowledge of the pattern, one can use this site as a reference to go about implementing it. Also, this site is useful only if the implementation language is Java.

Interpreter Pattern for Runtime Queries (eye-on-objects.com)

  http://eye-on-objects.com/archive1/c_brown.htm

This page is an article on Interpreter pattern and delves deeper into its realm and discusses the application of Interpreter pattern for a particular problem. It says how a very specific pattern like the Interpreter Pattern can be applied to a slightly general problem of querying a system for information like patients' details in a hospital. This article is for advanced users and should not be used to understand the basics of the pattern.

Comparison

The table below provides a comparison of the above mentioned sites and rates them on different parameters on a scale of 1 to 5 which is represented by the number of ☆ symbol.

Characteristic Site 1 Site 2 Site 3 Site 4 Site 5 Site 6 Site 7 Site 8
Clarity of content & fullness ☆☆☆☆ ☆☆☆☆ ☆☆ ☆☆ ☆☆☆
Most suitable examples(code) ☆☆☆ ☆☆☆ ☆☆☆ ☆☆ ☆☆☆ ☆☆ ☆☆ ☆☆☆
Comparison with closely related patterns ☆☆ ☆☆☆
Structure of the represented information ☆☆☆☆ ☆☆☆☆ ☆☆ ☆☆ ☆☆ ☆☆
Real World usages ☆☆☆ ☆☆☆ ☆☆☆☆ ☆☆☆ ☆☆☆
Disadvantages of the pattern ☆☆☆☆