I do not follow SOLID strictly in general, but I do try making sure to separate responsibilities of my classes.
I was developing a small app with a Windows service powered by Topshelf and realized that I don't quite understand what should Program
class do. Obviously I could probably shove most code into Main
, but what is the reasonable amount of responsibilities that this class should have?
My options:
Program
is just a housing forMain
, which is just an entry-point for the app, and the rest of the code should be moved to a separate class.Main
should only be a composition root of the application, with a separate class handling general workflow (like graceful shutdowns on exceptions) and calls to business logic.Another static method in
Program
should be handling the composition and calls to application class.Program
is the application workflow class and its nonstatic methods call business logic, whileMain
is an entry point.