CSC/ECE 517 Fall 2010/ch3 3h ss: Difference between revisions
No edit summary |
No edit summary |
||
Line 9: | Line 9: | ||
== Dynamic Languages == | == Dynamic Languages == | ||
The use of the Strategy design pattern in dynamic languages requires a variable that has a function as the value. Separate classes are not needed in dynamic languages. <sup>(3)</sup> | |||
== References == | == References == | ||
Line 16: | Line 16: | ||
(2) [http://www.google.com/url?sa=t&source=web&cd=6&ved=0CDMQFjAF&url=http%3A%2F%2Fmb-pde.googlecode.com%2Ffiles%2FMasterThesis.pdf&rct=j&q=strategy%20design%20pattern%20static&ei=4MirTMuIJ8L78Aah8rSFBw&usg=AFQjCNHmD-Y7ojHKraML4IO3khrRrv-Ljw&sig2=AratIpJa6hit5xsOs6MJRQ OBJECTED-ORIENTED DESIGN PATTERN DETECTION USING STATIC AND DYNAMIC ANALYSIS IN JAVA SOFTWARE] | (2) [http://www.google.com/url?sa=t&source=web&cd=6&ved=0CDMQFjAF&url=http%3A%2F%2Fmb-pde.googlecode.com%2Ffiles%2FMasterThesis.pdf&rct=j&q=strategy%20design%20pattern%20static&ei=4MirTMuIJ8L78Aah8rSFBw&usg=AFQjCNHmD-Y7ojHKraML4IO3khrRrv-Ljw&sig2=AratIpJa6hit5xsOs6MJRQ OBJECTED-ORIENTED DESIGN PATTERN DETECTION USING STATIC AND DYNAMIC ANALYSIS IN JAVA SOFTWARE] | ||
(3) [http://norvig.com/design-patterns/ppframe.htm Design Patterns in Dynamic Programming] |
Revision as of 01:45, 6 October 2010
The Strategy Pattern in Static and Dynamic Languages
The Strategy pattern is a common design pattern that defines algorithms into familial groupings. It encapsulates the individual algorithms and makes those algorithms interchangeable. Strategy allows the algorithms to differ autonomously from the clients who use them. (1)
Static Languages
The use of the Strategy design pattern in static languages requires the relations between classes and interfaces to be referenced by extending classes, implementing interfaces, instantiating objects, invoking methods, etc. (2)
Dynamic Languages
The use of the Strategy design pattern in dynamic languages requires a variable that has a function as the value. Separate classes are not needed in dynamic languages. (3)
References
(1) Head First Design Patterns Freeman & Freeman
(2) OBJECTED-ORIENTED DESIGN PATTERN DETECTION USING STATIC AND DYNAMIC ANALYSIS IN JAVA SOFTWARE