I’m developing a webapp and I’m not sure which pattern design should I use. In spite of the current trend towards MVC, this is a good choice for applications that deals with a lot of models, CRUD operations, etc. Our application has a different intern structure:
What we do is:
- Allow user to upload a data file and be redirected to another page.
- That page will be filled by some informations about that data file.
- User will have to select some parameters, and click a button.
- Depending on the button, some action will be performed and the result may be a number or another file to be downloaded.
As you can see, the only model I have is the user that will own a “session”. The only table I have on my DB is the ‘users’ table. All other usability of the application is performed during the session and no data is persisted.
Is there any Design Pattern that fits well my needs? I’m using Java!
Thanks!
What’s important in an application, is not the design pattern used but properly addressing separation of concerns.
MVC is just an example in that direction. It allows you to separate the application data and all the logic that goes with it (Model) from the presentation of that data (View). User’s interactions with the View is coordinated by the Controller who also transforms those interactions to actions to be performed by the Model.
A lot of applications fit into this behavior, so MVC is the obvious choice for them. If you think that MVC is overkill, then maybe go for a simplification of it like the Model Delegate (sometimes also referred as the Model/View Pattern). But again, the pattern is not important; what’s important is to properly separate the responsibilities within the application.
In your comments you mention that your application is already MVC, so I would leave it at that. I can’t see how that’s overkill and as your application will grow (and I’m sure it will) you’ll be glad it was designed like that from the start.