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
Are there any parts of the .net framework 3.0 that only work on windows vista?
If we write any code for DataGrid methods, what is the access specifier used for that methods in the code behind file and why?
Why we need a separate mobile project template, while we can render our web application in mobile ?
Explain ASP.NET MVC Identity and Security?
What is .net framework in simple terms?
What are html helpers in asp.net mvc?
What is the use of the default route {resource}.axd/{*pathinfo} ?
What are Non Action methods in ASP.Net MVC?
How we can add the css in mvc?
What is ViewStart Page in ASP.Net MVC?
what is msl?
What is the purpose of a web form?
What is managed extensibility framework?
What is the greatest advantage of using asp.net mvc over asp.net webforms?
I have 2+ years of fake experience,actually i could not answer for project questions..?how can i answer please suggest me..?