I'm using ASP.NET, but I'm sure this pertains to any (or most) MVC frameworks.
When a new web project is created, you get a basic folder/semantic structure for your code:
- Controllers (service requests from browsers)
- Models (store and manipulate data)
- Views (HTML pages)
- Content (static content
- Scripts (JavaScript)
- App_Data (database files)
That's fine, but what if I want to have code that runs separately of browser requests -- for example, maybe a request runs some code, but in another thread, and continues executing after the request is completed. Or if the code is just run periodically independent of a request altogether.
In my case, the code would work on data -- generating it, cleaning it up, etc -- which makes me think it should go in models. But it doesn't really "model" data, it just works on it in the background. Is there a semantic place for this kind of thing?