1

Topic: Question on a pattern Strategy (data access)

Greetings to All! According to a pattern Strategy it is necessary to carry out algorithm from C class in separate class S. But how the algorithm which has been carried out in separate class S, receives data access stored in initial C class? It turns out, what is necessary that the initial C class provided, by means of public methods, access to the data which are required to algorithm (implemented in class S)?

2

Re: Question on a pattern Strategy (data access)

Hello, Maxim Rogozhin, you wrote: > Greetings to All! > According to a pattern Strategy it is necessary to carry out algorithm from C class in separate class S. But how the algorithm which has been carried out in separate class S, receives data access stored in initial C class? It turns out, what is necessary that the initial C class provided, by means of public methods, access to the data which are required to algorithm (implemented in class S)? In most cases strategy is service which obtains the data and returns result. For example: receives the sheet and considers the salary to the employee, access for this purpose to all class is not necessary to it.

3

Re: Question on a pattern Strategy (data access)

Hello, Maxim Rogozhin, you wrote: > Greetings to All! > According to a pattern Strategy it is necessary to carry out algorithm from C class in separate class S. But how the algorithm which has been carried out in separate class S, receives data access stored in initial C class? It turns out, what is necessary that the initial C class provided, by means of public methods, access to the data which are required to algorithm (implemented in class S)? Anonymous classes and lambdas do not approach?

4

Re: Question on a pattern Strategy (data access)

Hello, Maxim Rogozhin, you wrote: > Greetings to All! > According to a pattern Strategy it is necessary to carry out algorithm from C class in separate class S. But how the algorithm which has been carried out in separate class S, receives data access stored in initial C class? It turns out, what is necessary that the initial C class provided, by means of public methods, access to the data which are required to algorithm (implemented in class S)? The C object will incapsulate now only the data, and any behavior except provision of the data.