I'm currently working with what you could call legacy code at work. I basically have a class that deals with the workflow and is only instantiated once every time the machine is booted up. Each time a new user uses this machines and logs onto it, a new "session" is started, but we keep the same instance of this class. To keep things simple lets say this machine is a self service machine.

This basically means every time a new user session starts, we need to reset all the flow variables back to their default values.

So normally I would have instance/member variables such as:

```
boolean didUserPressYes;
boolean didUserTakeHisReceipt;
int numberOfInsertedItems;

```

and then a resetVars() method that is called at the start of the flow/user session:

```
public void resetVars() {
 didUserPressYes = false;
 didUserTakeHisReceipt = false;
 numberOfInsertedItems = 0;
}

```

Normally I would just reinstantiate this class and avoid having this resetVars() method. Unfortunately, we are tied to a framework that does not allow us to do this and we must keep the same instance of the class.

In our actual code we have about 12 of these variables, and will almost certainly add more in the future. I can see great potential for bugs where these variables are not properly reset to their default value when each user session starts - especially if someone new comes onto the project and forgets to add his new variables into this resetVars() method. 

To work around this issue I have made a WorkflowVariables class that contains these variables and has getters and setters where appropiate, and a couple of small utility methods. At the start of each user session we simply reinstantiate this WorkflowVariables class and can now know for a fact that all the variables have been put back to their default values. No need to worry about certain instance variables not being reset, as we just have one:

```
private WorkFlowVariables workFlowVariables;

public void resetVars() {
    workFlowVariables = new WorkFlowVariables();
}

```

However, after some "code smell" reading, it seems that this what is known as a "Data Class" and is bad practice to implement. 

Does anyone see this as being a bad idea in my situation, or is this suitable for this specific situation? Perhaps there is a better way to solve this issue? Am I wrong to be too worried about the potential for bugs if we keep multiple instance variables?

Thanks in advance!