{"id":34988,"date":"2016-05-27T12:29:33","date_gmt":"2016-05-27T06:59:33","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=34988"},"modified":"2016-05-31T14:25:20","modified_gmt":"2016-05-31T08:55:20","slug":"why-should-you-adopt-spring-framework","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/why-should-you-adopt-spring-framework\/","title":{"rendered":"Why should you adopt Spring Framework?"},"content":{"rendered":"<p><span style=\"font-weight: 400;\">Spring is an open source framework for Java platform that provides comprehensive infrastructure support for developing robust Java applications. <\/span><span style=\"font-weight: 400;\">Spring Framework is essentially a skeleton that offers a solid foundation upon which an application can be built.This skeleton structure guides and helps developers throughout the <a title=\"spring application development services\" href=\"http:\/\/www.tothenew.com\/java-development-services\">application development<\/a> process. <\/span><span style=\"font-weight: 400;\">Unlike single-tier frameworks such as Struts and Hibernate, Spring aims to consolidate the application in a consistent, productive manner, pulling together the best of all single-tier frameworks. <\/span><\/p>\n<h3><b>Bottlenecks in the Traditional Approach to Java EE<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">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:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">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.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">J2EE applications are hard to unit test and have huge amounts of plumbing codes which don\u2019t do anything like JNDI lookup code, Transfer Objects, try\/catch blocks to acquire and release JDBC resources. <\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">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.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">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.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">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.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">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. <\/span><\/p>\n<h3><b>The Spring Effect<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Spring can efficiently organize middle tier objects irrespective of whether or not EJB is used. It has transformed EJB to an implementation choice rather than a determinant of applications. It can effectively reduce the rapid growth of Singletons thereby improving testability and object orientation. Spring configuration management services can be used in any architectural layer that facilitates efficient usage. Here are a few ways in which Spring can leverage your business:<\/span><\/p>\n<ul>\n<li><b><b>Modularity<\/b><\/b><\/li>\n<\/ul>\n<p style=\"padding-left: 40px; padding-top: 0px; padding-bottom: 0px;\"><span style=\"font-weight: 400;\">Spring is a layered framework with many modules like AOP, DAO, ORM, JEE, etc. that enable seamless integration with other frameworks such as JSF, Hibernate, Strut, etc. This modularity gives developers the freedom to work with a module of their choice.<\/span><\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li><b><b>Inversion of Control <\/b><\/b><\/li>\n<\/ul>\n<p style=\"padding-left: 40px; padding-top: 0px; padding-bottom: 0px;\"><span style=\"font-weight: 400;\">Inversion of Control is the core of Spring Framework. It can be best translated and understood through the term, \u201cDon\u2019t call me, I\u2019ll call you\u201d. In a traditional method, an application code is responsible for the flow of control and calls out for class libraries. But in an Inversion of Control framework, the framework invokes the application code and coordinates the workflow.<\/span><\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li><b><b>Dependency Injection <\/b><\/b><\/li>\n<\/ul>\n<p style=\"padding-left: 40px; padding-top: 0px; padding-bottom: 0px;\"><span style=\"font-weight: 400;\">Dependency Injection is built on Java language constructs and not on framework interfaces. Unlike the traditional method, application classes expose their dependencies using methods that can be directly called by the framework.<\/span><\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li><b><b>Aspect-Oriented Programming<\/b><\/b><\/li>\n<\/ul>\n<p style=\"padding-left: 40px; padding-top: 0px; padding-bottom: 0px;\"><span style=\"font-weight: 400;\">The AOP model applies services like transaction management to POJOs without any actual need for implementing APIS. It also provides declarative enterprise services as the POJOs can be implemented without affecting the business code.<\/span><\/p>\n<p>&nbsp;<\/p>\n<h3><b>Conclusion<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">The Spring Framework is a stable and high-quality platform supported by Java EE platforms such as IBM WebSphere, Oracle OC4J, and BEA Weblogic. It supports the adoption of new platforms like Apache Tomcat and OSGi. Because of the flexibility and independence it offers in terms of easy migration, smooth integration, and enhanced application performance, several large companies have deployed Spring for myriad applications including those that are mission-critical.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Spring is an open source framework for Java platform that provides comprehensive infrastructure support for developing robust Java applications. Spring Framework is essentially a skeleton that offers a solid foundation upon which an application can be built.This skeleton structure guides and helps developers throughout the application development process. Unlike single-tier frameworks such as Struts and [&hellip;]<\/p>\n","protected":false},"author":863,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":15},"categories":[446,1994,1],"tags":[4844,4841,2684,3335,3401,2591],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/34988"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/863"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=34988"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/34988\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=34988"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=34988"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=34988"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}