CSC/ECE 517 Fall 2010/ch7 7a ed: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
Line 2: Line 2:


Dynamic languages such as Ruby and Javascript allow many novel implementations of the design patterns we cover in previous chapters, which would not be possible or feasible in complied languages such as Java and C. Language features only available in dynamic languages give developers an increased amount of flexibility in how they can implement design patterns. These language features and the some examples of the implementations they allow are detailed in this section.
Dynamic languages such as Ruby and Javascript allow many novel implementations of the design patterns we cover in previous chapters, which would not be possible or feasible in complied languages such as Java and C. Language features only available in dynamic languages give developers an increased amount of flexibility in how they can implement design patterns. These language features and the some examples of the implementations they allow are detailed in this section.
=Language Features=
"These behaviors can be emulated in nearly any language of sufficient complexity, but dynamic languages provide direct tools to make use of them" [http://en.wikipedia.org/wiki/Dynamic_programming_language]. Some of the most helpful tools are as follows:
==Closures==
[http://jibbering.com/faq/notes/closures/]
==Metaprogramming==
===eval===
In dynamic languages, any arbitrary code can be executed dynamically at runtime. This can include code that is generated from user input. This is a subset of metaprogramming.


=References=
=References=
# Wikipedia. Dynamic programming language. 2 October 2010. http://en.wikipedia.org/wiki/Dynamic_programming_language
# Cornford, Richard. Javascript Closures. March 2004. http://jibbering.com/faq/notes/closures/

Revision as of 03:47, 2 December 2010

Novel Implementations of Design Patterns in Dynamic Languages

Dynamic languages such as Ruby and Javascript allow many novel implementations of the design patterns we cover in previous chapters, which would not be possible or feasible in complied languages such as Java and C. Language features only available in dynamic languages give developers an increased amount of flexibility in how they can implement design patterns. These language features and the some examples of the implementations they allow are detailed in this section.

Language Features

"These behaviors can be emulated in nearly any language of sufficient complexity, but dynamic languages provide direct tools to make use of them" [1]. Some of the most helpful tools are as follows:

Closures

[2]

Metaprogramming

eval

In dynamic languages, any arbitrary code can be executed dynamically at runtime. This can include code that is generated from user input. This is a subset of metaprogramming.

References

  1. Wikipedia. Dynamic programming language. 2 October 2010. http://en.wikipedia.org/wiki/Dynamic_programming_language
  2. Cornford, Richard. Javascript Closures. March 2004. http://jibbering.com/faq/notes/closures/