I am working on a software[runs on a public computer] which helps to create pdf files from word files. User have plethora of options for payment and specifying the properties of the final pdf output. Program now manages this situation using global variables.
I need to develop a user interaction object/class that will store information of every user activity in the program so that at the time of generation of output I’ve only one place to find all information. I will also record the path user selected to reach a particular point,errors happened,time spent,etc. An interaction/recording starts when user clicks on the button by storing the name of the button clicked and ends when the pdf is generated and money has debited from his account[Will store the amount debited,total pages converted,etc]. Eventually I may serialize this object.
I am contemplating about decorator pattern for implementing this module. Am I on the right path? Is there any better pattern/approach for this?
Thanks for the attention.
If the “user activity” is considered as set of methods he invokes so it looks like Command pattern here. Moveover you can add to the Command class a serialization mechanism and logging functionality.