Answer Posted / encapsulation
(I) Can you explain strategy pattern?
Strategy pattern are algorithms inside a class which can be
interchanged depending on the class used. This pattern is
useful when you want to decide on runtime which algorithm
to be used.
Let's try to see an example of how strategy pattern works
practically. Let's take an example of a math's calculation
where we have strategies like add and substract.
Figure 'Strategy in action' shows the same in a pictorial
format. It takes two numbers and the depending on the
strategy it gives out results. So if it's an addition
strategy it will add the numbers, if it's a substraction
strategy it will give the substracted results. These
strategies are nothing but algorithms. Strategy pattern are
nothing but encapsulation of algorithms inside classes.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What are the advantages of razor view engine?
Will c# 3.0, vb.net 9.0, atlas, or linq be included in the .net framework 3.0?
How would you deploy your old applications with .net framework 4.0? Are the old applications compatible?
How to use Jquery Plugins in ASP.Net MVC validation?
Asp.net mvc application, makes use of settings at 2 places for routing to work correctly. What are these 2 places?
What is entity sql? : Entity framework
What are the new features 3.5 framework against with the tool?
What is entitytype? : Entity framework
what is ssdl?
Explain tempdata in asp.net mvc?
Explain the advantage of packaging over xcopy in .net?
What is Differnce between html.action and ajax.action?
How do you specify comments using razor syntax?
What is Peek method in Tempdata in ASP.Net MVC?
Is razor a server side?