- Posts: 2
- Joined: Thu Jan 25, 2018 4:52 am
Identify the objectives of the Strategy pattern?
1) To define an object that encapsulates how a set of objects interact --> Facade
2) To define the skelcton of an algorithm, deferring some steps to subclasses --> template methode
3) To decauple an abstraction from its implementation so that the two can vary independently --> Bridge or something
4) To define a family of algorithms, encapsulate each one, and make them interchangeable --> Strategy - (Abstract factory pattern is "famliy of related objects")
5) To allow subclasses to redefine certain steps of an algorithm without changing the algorithm's structure --> template methode / run-time polymorphism
6) To provide a way to configure a class with one of many behaviors --> Strategy -> many behaviors
- Posts: 9
- Joined: Mon Mar 12, 2018 1:17 pm
The Strategy pattern provides a way to define a family of algorithms, encapsulate each one as an object, and make them interchangeable.
In this case, the business logic of the two applications are two strategies of calculating payroll.
So, this it's wrong answer
Users browsing this forum: No registered users and 2 guests