26-09-2014, 12:28 PM
WEB APPLICATION FRAMEWORKS IN JAVA
WEB APPLICATION.docx (Size: 70.11 KB / Downloads: 13)
INTRODUCTION
Earlier it was very hard to develop a complex web applications. Think of a framework as a bridge that will help you code faster and easier. A web application framework (WAF) is a software framework that is designed to support the development of dynamic websites, web applications, web services and web resources. The framework aims to alleviate the overhead associated with common activities performed in web development. For example, many frameworks provide libraries for database access, templating frameworks and session management, and they often promote code reuse. The majority of Web frameworks are exclusively server-side technology. By using an appropriate framework, a developer can often save a significant amount of time building a web site. Each framework is different, but many provide a variety of useful features. By using a framework, a developer avoids having to re-implement these same features for each web application they create.
A Web framework is a collection of packages or modules which allow developers to write Web applications or services without having to handle such low-level details as protocols, sockets or process/thread management.
WEB FRAMEWORKS
A web application framework (WAF) is a software framework that is designed to support the development of dynamic websites, web applications, web services and web resources. Web frameworks provide many typical website components right out of the box, such as user management functionality which might otherwise take months of custom development to build. Web frameworks are designed to be reused.
Communities of users and developers spring up around web frameworks where ideas can be shared and knowledge can be captured. Add-ons, themes, plugins, widgets are all names for things which develop within web framework communities and enable further rapid customization of your website. The rapid build of basic website components and ease of customization leads to large scale time and cost savings. Frameworks can into your way, as they have made certain choices. How much they are constraining depends on the frameworks, your experience with it, and what you are trying to accomplish. The first time around you use a framework for something that it is good at, you are going to be impressed at how easy it was to accomplish your task. Before long however, you might become so used to the benefits that a frameworks brings that you won’t even notice what the framework is doing for you anymore; it’s now in the background. And humans are much attuned to pain, so the pain points are going to remain.
WHO SHOULD USE A FRAMEWORK.
Different frameworks might aim for different goals, but in general they all aim for supporting developers in their work of creating an application with as little effort as possible with as little hinder as possible. A framework can be used for many purposes, not only serve common functionalities; it can also help learning a design pattern. Therefore new developers, that knows some programming but do not know so much about design patterns and best practice, can benefit from a framework by gaining understanding and programming skills. A beginner will not feel that the framework is getting in the way as much as an experienced developer. An experienced developer already knows the basics and how everything functions and the various parts are related to each other and might therefore sees hinders instead of possibilities. Experienced developers are also more likely work on more advanced projects where a framework might not be suitable, due to the broad use of the application and greater demand for high performance. The advantages of using a framework should be greater than the disadvantages, otherwise it would, obviously, not be any point of using a framework
JAVA TECHNOLOGIES
Java is not only a programming language but it also provides a platform is the name given to the computing platform from Oracle that helps users to run and develop Java applications. The platform does not just enable a user to run and develop Java application, but also features a wide variety of tools that can help developers work efficiently with the Java programming language. The platform consists of two essential softwares, Java Runtime Environment (JRE) and Java Development Kit (JDK).
The Java Runtime Environment (JRE) sits on top of the machine's operating system, platform and architecture. If and when a Java application is run, the JRE acts as a liaison between the underlying platform and that application. It interprets the Java application to run in accordance with the underlying platform, such that upon running the application, it looks and behaves like a native application. The part of the JRE that accomplishes this complex liaison agreement is called the Java Virtual Machine (JVM). Native Java applications are preserved in a special format called the byte-code. Byte-code remains the same, no matter what hardware architecture, operating system, or software platform it is running under. On a file-system, Java byte-code resides in files that have the .class (also known as a class file) or the .jar (also known as a Java archive) extension. To run byte-code, the JRE comes with a special tool. The most important part of the JRE is the Java Virtual Machine (JVM).
Spring MVC
If you’re looking for a framework to help you generate an application fast and clean, Spring really shouldn’t be your go to. It’s MASSIVE and hard to grasp if you’re just starting out. For a quick template, you can always download the Petclinic package and strip all of the unnecessary stuff out – but even that will take time, and you need to be able to tell what is necessary.
Score: 2.5/5 – Much preexisting Spring knowledge is needed. Plain JSP & Controllers do not provide out-of -the-box components and widgets that can be used
Grails
Grails comes with a reloading mechanism out of the box, but it has some limitations and you may still want to use JRebel if a part of your project is in Java. The setup is very fast and scaffolding (code generation) saves a lot of time. Convention over configuration principle helps you to forget almost all of the configuration hassle.
Score: 5/5 – Top marks here. Scaffolding, conventions and hot code reloading, what else could you want?
Framework Complexity
This section is where we explore each framework’s construction. Here, we’ll discuss how many moving parts exist in each framework and how the complexity of the framework affects you. There are also other considerations when choosing frameworks, such as whether the extra features and benefits outweigh the extra complexity levied against frameworks for your application.
HOW TO CHOOSE A WEBFRAMEWORK
Software Pattern
Almost every framework out there exclusively uses the MVC pattern. MVC, which stands for Model-View-Controller, helps you keep your data: the model, the logic: the controller and the user interface: the view, separate from each other. Just because almost everyone uses MVC doesn’t mean that is everything you need to know though. There are a couple of variants including MVP: Model-View-Presenter, MVA: Model-View-Adapter and AVC: Application-View-Controller
Hosting Requirements
As web developers, we may be inclined to building applications on cutting edge platforms but often the need and budget of the client comes first. Often it may be out of the budget to get a dedicated host to place our applications on and we’ll have to settle with shared hosting with normal modules and settings.
OBJECT RELATIONAL MAPPING
Object-relational mapping (ORM, O/RM, and O/R mapping) in computer software is a programming technique for converting data between incompatible type systems in relational databases and object-oriented programming languages. This creates, in effect, a "virtual object database" that can be used from within the programming language. Databases usually work on relational model: you have tables (simplifying: like a spreadsheet), and relations between them - one-to-one, one-to-many, many-to-many, etc, meaning for instance that one record in table A has many related records in table B. You can retrieve data from them as rows Object-Relational Impedance Mismatch (sometimes called the paradigm mismatch) is just a fancy way of saying that object models and relational models do not work very well together. RDBMSs represent data in a tabular format (a spreadsheet is a good visualization for those not familiar with RDBMSs), whereas object-oriented languages, such as Java, represent it as an interconnected graph of objects. Loading and storing graphs of objects using a tabular relational database exposes us to mismatch problems they are
JAVA SERVER FACES
Java server faces is java specification for building component based user interfaces for web applications. It is a standardized display technology which was formalized in a specification through the java community process.
JSF EVENT HANDLING
When a user clicks a JSF button or link or changes any value in text field, JSF UI component fires event which will be handled by the application code. To handle such event, event handlers are to be registered in the application code or managed bean. When a UI component checks that a user event has happened, it creates an instance of the corresponding event class and adds it to an event list. Then, Component fires the event, i.e., checks the list of listeners for that event and call the event notification method on each listener or handler. JSF also provide system level event handlers which can be used to do some tasks when application start or are stopping.
CONCLUSION
We live in exciting times to be building websites; we liken using web frameworks in web development to the industrial revolution in manufacturing. Earlier it was very hard to develop a complex web applications. The main purpose of web application framework is to support the development of dynamic websites, web applications, web services, and web resources and it also helps the programmers to build the application quickly.
As a developer using a framework, you typically write code which conforms to some kind of conventions that lets you plug in to the framework, delegating responsibility for the communications, infrastructure and low-level stuff to the framework while concentrating on the logic of the application in your own code.