I originally asked this on SO, where it was closed and recommended that I ask it here instead.  I'm trying to figure out how to group all the functions necessary for my project into classes. The goal of the project is to execute the following process:Get the user's FTP credentials (username & password).Check to make sure the credentials establish a valid connection to the FTP server.Query several Sharepoint lists and join the results of those queries to create a list of items that need to have action taken on them.Each item in the list has a folder. For each item:Zip the contents of the folder.Upload the folder to the FTP server using SFTPUpdate the item's Sharepoint data.Email the user an Excel report showing, e.g.,Items without folder pathsItems that failed to zip or uploadSteps 2-5 are performed on a periodic basis; if step 2 returns an invalid connection, the user is alerted and the process returns to step 1. If at any point the user presses a certain key, the process terminates.I've defined the following set of classes, each of which is in its own .cs file:SFTP: file transfer processesDataHandler: Sharepoint data retrieval/querying/updating processes. Also makes and uploads the zip files.Exceptions: Not just one class, this is the .cs file where I have all of my exception classes.Report: Builds and sends the report.Program: The main class for running the program.I recognize that the DataHandler class is a god object, but I don't have a good idea of how to refactor it. I feel like it should be more fine-grained than just breaking it into Sharepoint, Zip, and Upload, but maybe that's it.Also, I haven't yet worked out how to combine the periodic behavior with the wait for user input at any point in the process part; I think that involves threads, which means other classes to manage the threads...I'm not that well-versed in design patterns, but is there one that fits this project well?If this is too big of a topic to neatly explain in an SO answer, I'll also accept a link to a good tutorial on what I'm trying to do here.
What is the right way to group this project into classes?
c#;design patterns;refactoring
@Emmad has hit the nail on the head on the note about Single Responsibility.If you follow a Behaviour Driven approach to class design (ignoring all the unit testing stuff for the moment and thinking more along the lines of the Behaviours which your program needs to support), you might start with entities which represent individual areas of functionality, for example, you may end up with individual classes for each of the followingUser Input HandlerUser Credentials (simple data object or struct?)User Credentials ValidatorSharepoint QueryFolder CompressorFolder SenderFTP ConnectionSharepoint UpdaterSharepoint ConnectionReport (simple data object or struct?)Report BuilderReport SenderEmail ConnectionThe reason for using these as a starting point is not necessarily to model exactly what will appear in your final code, but to provide you loose coupling until you have some code in front of you which gives you a better understanding of the problem and how everything fits together.In general, it is easier to add complexity to a simple class than it is to simplify something which started out complex in the first place;  Similarly, if you end up with a working solution and decide that some of the classes should be merged together, then this is also easier to do than splitting up a single class which had started out doing too much.(Remember that problems are seldom as trivial as they seem at first, especially not when you start thinking about error flow control, debug logging, disposable resources, etc - something which starts out as Oh, we can do this with one line of code might turn out to be a lot more than one line)Doing this you might also notice patterns in the kinds of method names you're using which may lend themselves to interfaces and abstractions which previously weren't obvious from looking at the original problem. 