Search code examples
javadesign-patternsweb-applicationsstruts2chain-of-responsibility

Understanding the need for struts 2 and commons chain in simple CRUD website


I have a simple CRUD website in development process, almost done. I was asked to refactor the code but this time use struts 2 and commons chain. I read a couple of sites like this but wasn't able to know exactly what will be the key roles done by these two (struts 2 and commons chain) in my project. I was also asked that don't worry about struts tags like in this tutorial as the code that i made earlier can be used.

Can anyone give me an insight. Thanks

Note: A day back I started to see about struts 2


Solution

  • Well any framework is designed (most of them) to provide some sort of ease of use. That should be the driver when you chose one.

    In your case, I can comment on Struts2. Using Struts2 provides and enforces a better design in terms of separation of your code responsibilities (model view controller). This way the over all application design is well formed. On top of this, framework provides many interesting features like interceptors, out of box request parameter assignments, validation, ui tags etc etc which you can benefit from.

    So if you are still in the starting phase, yes - go through various frameworks available and weigh them out in terms of what ease you are looking for.