I have a visual studio solution with the following projects:
- UI
- DataAccess
- BusiessLogic
- BusinessObjects
I now have a bunch of code that generates reports that are sent out via email or saved as csv files.
These ReportGenerators classes take in business objects and output either files or strings.
which project would you put them in? I am leaning toward an answer but wanted to see what others thought?
I would create a separate reporting project. It doesn’t belong in the UI (I assume they run in the background) – it is effectively a ‘reporting logic’ layer.
If you think about how you might want to support reportng, you may want a backend service but you might want to expose the data via a web service as well in the future. If you need to provide users a front-end reporting facility you plug into the reporting logic as you would a normal UI -> Logic -> Data Access architecture.
Also, if you separate your reporting code out you are then free to extract it to a dedicated reporting tier in the future.