Use Frameworks

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 19

Use Frameworks

In depth discussion of a widely used


Framework such as Struts
• Struts2 is a popular and mature web application framework based on the MVC
design pattern. Struts2 is not just a new version of Struts 1, but it is a complete
rewrite of the Struts architecture.
• The Webwork framework initially started with Struts framework as the basis and
its goal was to offer an enhanced and improved framework built on Struts to
make web development easier for the developers.
• After a while, the Webwork framework and the Struts community joined hands
to create the famous Struts2 framework.
Struts 2 Framework Features

Here are some of the great features that may force you to consider Struts2 −
• POJO Forms and POJO Actions − Struts2 has done away with the Action Forms that were an integral part of the
Struts framework. With Struts2, you can use any POJO to receive the form input. Similarly, you can now see any
POJO as an Action class.
• Tag Support − Struts2 has improved the form tags and the new tags which allow the developers to write less code.
• AJAX Support − Struts2 has recognized the take over by Web2.0 technologies, and has integrated AJAX support
into the product by creating AJAX tags, this function is very similar to the standard Struts2 tags.
• Easy Integration − Integration with other frameworks like Spring, Tiles and SiteMesh is now easier with a variety of
integration available with Struts2.
• Template Support − Support for generating views using templates.
• Plugin Support − The core Struts2 behavior can be enhanced and augmented by the use of plugins. A number of
plugins are available for Struts2.
• Profiling − Struts2 offers integrated profiling to debug and profile the application. In addition to this, Struts also
offers integrated debugging with the help of built in debugging tools.
• Easy to Modify Tags − Tag markups in Struts2 can be tweaked using Freemarker templates. This does not require
JSP or java knowledge. Basic HTML, XML and CSS knowledge is enough to modify the tags.
• Promote Less configuration − Struts2 promotes less configuration with the help of using default values for
various settings. You don't have to configure something unless it deviates from the default settings set by
Struts2.
• View Technologies − Struts2 has a great support for multiple view options (JSP, Freemarker, Velocity and XSLT)
Struts 2 Disadvantages

Though Struts 2 comes with a list of great features, there are some limitations of the current
version - Struts 2 which needs further improvement. Listed are some of the main points −
• Bigger Learning Curve − To use MVC with Struts, you have to be comfortable with the standard
JSP, Servlet APIs and a large & elaborate framework.
• Poor Documentation − Compared to the standard servlet and JSP APIs, Struts has fewer online
resources, and many first-time users find the online Apache documentation confusing and poorly
organized.
• Less Transparent − With Struts applications, there is a lot more going on behind the scenes than
with normal Java-based Web applications which makes it difficult to understand the framework.
Final note, a good framework should provide generic behavior that many
different types of applications can make use of it.
Struts 2 is one of the best web frameworks and being highly used for the
development of Rich Internet Applications (RIA).
Review of Other
Frameworks
What is Framework in Java

• Java Framework is the body or platform of pre-written codes used by Java


developers to develop Java applications or web applications. In other
words, Java Framework is a collection of predefined classes and functions
that is used to process input, manage hardware devices interacts with
system software. It acts like a skeleton that helps the developer to develop
an application by writing their own code.
What is a framework?

• Framework are the bodies that contains the pre-written codes (classes and
functions) in which we can add our code to overcome the problem. We can
also say that frameworks use programmer's code because the framework is
in control of the programmer. We can use the framework by calling its
methods, inheritance, and supplying "callbacks", listeners, or other
implementations of the Observer pattern.
Popular Java Frameworks

Some of the most popular Java frameworks are:


• Spring
• Hibernate
• Grails
• Play
• JavaServer Faces (JSF)
• Google Web Toolkit (GWT)
• Quarkus
Spring

It is a light-weighted, powerful Java application development framework. It is used for JEE. Its other
modules are Spring Security, Spring MVC, Spring Batch, Spring ORM, Spring Boot and Spring Cloud
 etc.
Advantages
• Loose coupling
• Lightweight
• Fast Development
• Powerful abstraction
• Easy to test
Hibernate

Hibernate is ORM (Object-Relation Mapping) framework that allows us establish


communication between Java programming language and the RDBMS.
Advantages
• Portability, productivity, maintainability.
• Open source framework.
• It avoids repetitive code from the JDBC API.
Grails

It is a dynamic framework created by using the Groovy programming language. It is an OOPs language.


Its purpose is to enhance the productivity. The syntax of Grails is matched with Java and the code is
compiled to JVM. It also works with Java, JEE, Spring and Hibernate.
Advantages
• It uses Groovy programming standard instead of Java programming standard because Groovy is
similar to Java.
• Its object mapping feature is easy to use.
• It provides the facility of reusing the code (in the form of plugin) between different Grail applications.
• Provides flexible profiles.
Play

It is a unique Java framework because it does not follow JEE standards. It follows MVC architecture
pattern. It is used when we want to develop highly scalable Java application. Using Play framework,
we can develop lightweight and web-friendly Java application for both mobile and desktop.
Advantages
• No configuration is required.
• It enhances the developer productivity and target the RESTful architectures.
• It offers hot code reload and error message in the browser.
• It also supports popular IDEs.
JavaServer Faces

It stands for JavaServer Faces. It is a component-based UI framework


developed by Oracle that is used to build user interfaces for Java-based
applications. It follows MVC design pattern. The application developed using 
JSF has an architecture that defines a distinction
Advantages
• It is an important part of JEE.
• Provides rich libraries.
Google Web Toolkit (GWT)

It is an open-source framework that allows developers to write client-side Java code. With the
help of GWT, we can rapidly develop complex browse application. The advantages to use GWT is
that we can easily develop and debug Ajax application. the product of Google, such as Google
AdSense, Blogger are developed using GWT.
Advantages
• It employs reusability for web application development
• We can use Google API to develop application.
• It provides functionality such as, internationalization, UI abstraction, and history management.
Quarkus

It is a modern, full-stack, and Kubernetes-native Java framework. It offers small memory footprint


and reduced boot time. It works well if the infrastructure is cloud-native. It optimizes Java specifically
for Kubernetes and enables it to become an effective platform for serverless, cloud, and Kubernetes
environments.
Advantages
• It is used in cloud, containers, and serverless environments.
• It supports microservices architecture and development.
• The developers are free to choose own development model.
• It is compatible with popular frameworks like, Eclipse, Spring Dependency Injection, and Hibernate.
Advantages of Java Frameworks

The advantages of the Java Frameworks are as follows:


• Security: It is the most important advantage of the Java framework. If we found any security loop hole or vulnerability
in an application, we can directly move to the official website of the framework to fix the security related issues.
• Support: The widely used framework provides large forums or groups where we can put our problem for the solution.
It also provides the documentation of the framework that helps us to understand the working of the framework.
• Efficiency: If we are doing a task without using the framework, it may take time to complete. But if we are doing the
same work by using the framework, we can complete that task in easy and fast way. Therefore, using the Java
framework development become faster, easier and effective. It also saves time and efforts.
• Expenses: Another advantage of using the framework is to reduce the cost of the application. Because the
maintenance cost of the framework is low.
END

You might also like