0% found this document useful (0 votes)
49 views

Factory, Builder, Decorator, and Service Locator To Compose The Various Classes and Object

spring framework

Uploaded by

AshwynSatyawan
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views

Factory, Builder, Decorator, and Service Locator To Compose The Various Classes and Object

spring framework

Uploaded by

AshwynSatyawan
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Introduction

Spring Framework is a Java platform that provides comprehensive infrastructure support for
developing Java applications. Spring handles the infrastructure so you can focus on your
application. Spring enables you to build applications from “plain old Java objects” (POJOs)
and to apply enterprise services non-invasively to POJOs. This capability applies to the Java
SE programming model and to full and partial Java EE.

Java applications -- a loose term that runs the gamut from constrained applets to n-tier
server-side enterprise applications -- typically consist of objects that collaborate to form the
application proper. Thus the objects in an application have dependencies on each other.

Although the Java platform provides a wealth of application development functionality,


it lacks the means to organize the basic building blocks into a coherent whole, leaving that task
to architects and developers. True, you can use design patterns such as Factory, Abstract
Factory, Builder, Decorator, and Service Locator to compose the various classes and object
instances that make up an application. However, these patterns are simply that: best practices
given a name, with a description of what the pattern does, where to apply it, the problems it
addresses, and so forth. Patterns are formalized best practices that you must implement
yourself in your application.

In today’s world, with the advent of information technology and communication media many
of the organizations use frameworks for making the development of applications easier. The
business nowadays demands web applications so it is very important to take care of the
architecture. Framework can be thought of as a set of functions helping the developers in
creating the applications. The Spring Framework is an application framework that helps to
customize applications. Even though Java EE is widely
Used, it has some limitations such as reusability of code is less, heavy development
burden. Spring framework when used with Java EE makes the development easier. Spring is a
layered architecture so whenever an E-commerce system is developed using spring it has clear
separation of the layers. Because of its layered architecture it allows users to select about which
of its components users can use.
[Bottlenecks of traditional J2EE system]

[1]Java succeeded primarily because of the standardization of several common services for
enterprise applications, which J2EE later called Java EE. This platform was adopted by IT
giants like Oracle, IBM, Sun, and SAP. Despite its huge acceptance, many Java EE projects
failed as these applications were complex and took a lot of time and effort to build. Few
reasons for the shortfall of Java EE are:

 EJB (Enterprise Java Beans) is complicated and promotes a distributed component


model in which the server needs to be on a separate machine from the web server.
This increases overheads of remote calls that leads to performance issues.
 J2EE applications are hard to unit test and have huge amounts of plumbing codes
which don’t do anything like JNDI lookup code, Transfer Objects, try/catch blocks to
acquire and release JDBC resources.
 Because of the time needed for deployment, testing the application on the Application
Server was a slow process. Dependencies of the written code on the Application
Server made running the code outside a difficult task. All this led to software
becoming untestable.
 A single artifact had both design and logic as JSP allowed inclusion of Java code in
web pages. The designers and developers had to modify it alike, and it turned out hard
to maintain.
 Loading larger data sets resulted in one database query for each item in the set. For
example, loading 10,000 customers meant executing 10,000 database queries, which
led to performance disasters. The alternative use of JDBC was also difficult as it was
hard to avoid resource leaks and implement error handling correctly. Even if done
properly, it still meant writing many lines of code for even the simplest database
queries.

Tools based on code generation approach have showcased problems of their own. In
comparison, frameworks perform better than tool based code generation as they are more
flexible at runtime. Though many organisations have developed their own frameworks, it is
always best to use a widely accepted and tested framework.
References:

[1] Spring Framework Reference Documentation

[https://docs.spring.io/spring/docs/3.2.18.RELEASE/spring-framework-
reference/htmlsingle/]

Authors
Rod Johnson, Juergen Hoeller, Keith Donald, Colin Sampaleanu, Rob Harrop, Thom
as Risberg, Alef Arendsen, Darren Davison, Dmitriy Kopylenko, Mark Pollack, Thierr
y Templier, Erwin Vervaet, Portia Tung, Ben Hale, Adrian Colyer, John Lewis, Costin
Leau, Mark Fisher, Sam Brannen, Ramnivas Laddad, Arjen Poutsma, ChrisBeams,
Tareq Abedrabbo, Andy Clement, Dave Syer, Oliver Gierke, Rossen Stoyanchev, Ph
illip Webb

3.2.18.RELEASE

Copyright © 2004-2016

[2]

You might also like