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 is entity graph in entity framework?
How route table has been created in asp.net mvc?
What is session state management?
What is stateless model?
Why is the .net framework 3.0 a major version number of the .net framework if it uses the .net framework 2.0 runtime and compiler?
What is poco proxy? : Entity framework
What are the 3 main components of an asp.net mvc application?
Explain what is the difference between view and partial view?
What is presentation framework?
Will c# 3.0, vb.net 9.0, atlas, or linq be included in the .net framework 3.0?
what is entity framework?
Mention some action filters which are used regularly in ASP.Net MVC?
How would you deploy your old applications with .net framework 4.0? Are the old applications compatible?
How to update one of my table in database at 4pm every day how it is possible?
How do I use partial view?