jose chiramal wrote:What design pattern does Struts framework follow ?
Struts controller uses the Command design pattern and the action classes use the Adapter design pattern. The process() method of the RequestProcessor uses the Template method design pattern. Struts also implement the following J2EE design patterns.
* Service to Worker
* Dispatcher View
* Composite View (Struts Tiles)
* Front Controller
* View Helper
* Synchronizer Token
Is it Inversion of Control ???
If yes, how does inversion of control happen in struts ?
I have heard that this concept is used in Spring but not sure if it is in struts.
Struts2 is based on WebWork which has IoC. Struts2 supports interface injection (IOC).
For Struts 1 it depends on which version, but the concept is relatively limited (as it was with most Java code back in those days). Struts 1 did integrate with Spring, however, allowing some injection, and it was possible to identify which implementation classes to use for various things (like custom request processors) in the Struts configuration file (again depending on version). So I'd say yes, Struts 1 supported IoC, but in a limited way.
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop