Code covered by the BSD License  

Highlights from
Strategy Design Pattern in Matlab 2008b

from Strategy Design Pattern in Matlab 2008b by Paul Williamson
Strategy Pattern defined by "Gang of Four" in: "Design Patterns: Elements of ...," Gamma, et al.

Strategy
classdef Strategy < handle
%STRATEGY Summary of this class goes here
%   Detailed explanation goes here

   properties
       m_Type = {};
   end

   methods
       function obj = Strategy(value)
            obj.SetStrategy(value);
       end
       
       function SetStrategy(obj, value)
            obj.m_Type = StrategyType.newType(value); 
       end
       
       function RunStrategy(obj, ts)
            obj.m_Type.RunStrategy(ts);
       end
   end
end 

%EOF

Contact us at files@mathworks.com