The Benefits of Using a Web Application Framework
There are often several different approaches available to solve a particular design issue. If you are in a development team, with say six members, you might have six different ways of handling everything ranging from data access to how the design should be implemented. This usually means that developers will have to spend long hours in design meetings arguing about which design methodology is better. This laid the foundation for the development of web frame works. The aim of a web framework is to over come these development issues and also make development more productive and less error prone. A web application framework is a collection of code libraries, programming rules and best practices that has evolved as a result of the research and experience of the developer community. By using an application framework for development, developers spend less time deciding what patterns to use, how to implement a particular feature or how to deal with some technical problem that was already solved by others. The adage “Let’s not reinvent the wheel” is a guiding principle for developers using web frameworks.
Currently, there are many software frameworks in the enterprise development domain especially for the Java/J2EE platform. Although the underlying mechanics of each of these frameworks are different, the API’s that developers use to design and implement their web applications are similar. The frame works differ from one another in the extensions that they provide such as tag libraries or java server faces and also in the technique that they use to navigation within a web application such as the XML configuration file, java property files, or custom properties. Most of the user - interface related patterns are built using the Model - View - Controller architecture. The MVC architecture recommends the separation of the business logic from the presentation layer and the use of a controller to coordinate the flow of requests from the client to the server and the actions taken on those requests.
Apache Struts was one of the earliest frameworks developed based on the MVC architecture. By separating the model, view and controller layers Struts promotes a design practice that eliminates the inclusion of database code, page design code, and control flow code in the same Java-Server Pages file, there by making application maintenance easier. Web frameworks like Struts address the View and Controller in detail while leaving the Model portion intentionally flexible to allow the developer some latitude in the design. Some of the newer frameworks take a more holistic approach and give attention to all three pieces of the MVC pattern. Great examples are Spring Framework and EJB 3. These frameworks are built around the design architecture called Inversion of Control also referred to as Dependency Injection. I will be writing more about each of these frame works in detail in succeeding blogs.