{"id":1088,"date":"2010-10-19T21:56:27","date_gmt":"2010-10-19T16:26:27","guid":{"rendered":"http:\/\/naveenbalani.com\/?p=1088"},"modified":"2016-09-17T09:59:28","modified_gmt":"2016-09-17T04:29:28","slug":"do-you-need-to-move-from-spring-to-java-ee-6","status":"publish","type":"post","link":"https:\/\/navveenbalani.dev\/index.php\/articles\/do-you-need-to-move-from-spring-to-java-ee-6\/","title":{"rendered":"Do you need to move from Spring to Java EE 6"},"content":{"rendered":"<p>I recently read an interesting post on TSS- \u201c<a href=\"http:\/\/www.theserverside.com\/discussions\/thread.tss?thread_id=61023\" target=\"_blank\">Moving from Spring to Java EE 6: The Age of Frameworks is Over<\/a>\u201d.\u00a0 I am sure, everyone would have its perspective on the above blog and here are my views on this.<\/p>\n<p>But before that, let\u2019s step back and look and why frameworks like Spring was invented in the first place. In my view, primarily it was created as an alternative to J2EE stack, to keep it simplified, POJO centric and testable without the need for a container. Then came in support for various abstractions layers \u2013 JDBC, Transactions, ORM, JMS which can be applied POJO in a consistent manner and support for plugging in any web framework , all backed by principle of dependency injection. What it offered was a choice to programmers (and that\u2019s very important) and didn\u2019t restrict it usage to any specific API directly.\u00a0 Using Spring, one could create modular components which could be run against a J2SE environment(derby and local transaction manager for your local test environment) and then promoted to use capabilities offered by J2EE Applications servers like JNDI, JTA and so on.<\/p>\n<p>Over the years, J2EE tried to catch on, tried to create specifications and standardizations which were well adopted and tested by the framework like Spring or ORM providers like Hibernate. Specifications are good, but lot of time goes in creating specifications and it takes even lot more to get these specifications incorporated into the release of J2EE servers and stacks.<!--more--> Though specifications were created, you would still see vendor specific extensions required to run a particular feature. I mean, can you still take an Enterprise application (running on latest J2EE spec), which has couple of EJBs (3.0 or 3.x), uses transaction and JMS services and run it on a server which supports the same J2EE specs. Probably No, Yes, May be with the latest specification, may be with vendor specific extensions (?).\u00a0 Let\u2019s look at the latest release features to find more of this information.<\/p>\n<p>The latest release of J2EE has support for Dependency injection (JSR-299 contexts and Dependency Injection for the Java EE platform specification), which is same as offered by Spring, Bean Validation (standard Bean validation offered by Apache projects, but now using standard annotations), streamlined development (through the use of POJO, JPA for persistence and revised EJB approach) and extensibility to add in vendor specific extensions in a consistent way. If you look at these goals, these matches with principles which I had listed earlier on why Spring was invented, only thing it took J2EE probably too long (probably 6-7 years assuming Spring starting gaining widely adopted in 2003) to arrive at this specification.\u00a0 Even though J2EE has the principles now, it still restricts its usage to that of a container, for instance I can run spring in a standalone environment (J2SE environment with local database and transaction support) as well as promote it to full fledged J2EE application, running on multiple application servers.Also there are no approaches provided on how to test individual components (in and outside the container) using a pure J2EE stack. I seriously feel, there should be specification around testing of components.<br \/>\nTo conclude with some thoughts &#8211;<\/p>\n<ul>\n<li>I can achieve everything in Java EE 6 using Spring , but not the other way round.<\/li>\n<\/ul>\n<ul>\n<li>I can get Java EE 6 (or 7.x or 8.x\u00a0 ) features in a container that\u2019s doesn\u2019t uses Java EE 6 (or 7.x or 8.x ..) using Spring.<\/li>\n<\/ul>\n<ul>\n<li>I don\u2019t think having a vendor specific extension in Java EE 6 can categorize to all vendor requirements, given that getting anything as part of standard usually takes a very long time. The choice needs to be provided, whether I use pure Hibernate APIs or JPA using a standard way.<\/li>\n<\/ul>\n<ul>\n<li>J2EE 5.x and now 6.x Spec is good start, but will take a while for J2EE 6.X (and future versions) to be adopted and catch up with Spring.<\/li>\n<\/ul>\n<ul>\n<li>J2EE future versions should be streamlined further to Java (POJO) with enterprise services, along with a test driven methodology.<\/li>\n<\/ul>\n<ul>\n<li>Finally it\u2019s up to your requirements and what applications you are building.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>I recently read an interesting post on TSS- \u201cMoving from Spring to Java EE 6: The Age of Frameworks is Over\u201d.\u00a0 I am sure, everyone would have its perspective on the above blog and here are my views on this. But before that, let\u2019s step back and look and why frameworks like Spring was invented [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2128,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[3,5,126],"tags":[129,130,128],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v16.0.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Do you need to move from Spring to Java EE 6 - Current and Future Technology Trends by Navveen Balani<\/title>\n<meta name=\"description\" content=\"Do you need to move from Spring to Java EE 6 -\" \/>\n<link rel=\"canonical\" href=\"https:\/\/navveenbalani.dev\/index.php\/articles\/do-you-need-to-move-from-spring-to-java-ee-6\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Do you need to move from Spring to Java EE 6 - Current and Future Technology Trends by Navveen Balani\" \/>\n<meta property=\"og:description\" content=\"Do you need to move from Spring to Java EE 6 -\" \/>\n<meta property=\"og:url\" content=\"https:\/\/navveenbalani.dev\/index.php\/articles\/do-you-need-to-move-from-spring-to-java-ee-6\/\" \/>\n<meta property=\"og:site_name\" content=\"Current and Future Technology Trends by Navveen Balani\" \/>\n<meta property=\"article:published_time\" content=\"2010-10-19T16:26:27+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2016-09-17T04:29:28+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/navveenbalani.dev\/wp-content\/uploads\/2016\/09\/bk6.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"450\" \/>\n\t<meta property=\"og:image:height\" content=\"374\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\">\n\t<meta name=\"twitter:data1\" content=\"3 minutes\">\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/navveenbalani.dev\/#website\",\"url\":\"https:\/\/navveenbalani.dev\/\",\"name\":\"Current and Future Technology Trends by Navveen Balani\",\"description\":\"Current and Future Technology Trends by Navveen Balani\",\"publisher\":{\"@id\":\"https:\/\/navveenbalani.dev\/#\/schema\/person\/51f7ab14b20611d95e3c7fd4ea0950bf\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/navveenbalani.dev\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/navveenbalani.dev\/index.php\/articles\/do-you-need-to-move-from-spring-to-java-ee-6\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/navveenbalani.dev\/wp-content\/uploads\/2016\/09\/bk6.jpg\",\"width\":450,\"height\":374},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/navveenbalani.dev\/index.php\/articles\/do-you-need-to-move-from-spring-to-java-ee-6\/#webpage\",\"url\":\"https:\/\/navveenbalani.dev\/index.php\/articles\/do-you-need-to-move-from-spring-to-java-ee-6\/\",\"name\":\"Do you need to move from Spring to Java EE 6 - Current and Future Technology Trends by Navveen Balani\",\"isPartOf\":{\"@id\":\"https:\/\/navveenbalani.dev\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/navveenbalani.dev\/index.php\/articles\/do-you-need-to-move-from-spring-to-java-ee-6\/#primaryimage\"},\"datePublished\":\"2010-10-19T16:26:27+00:00\",\"dateModified\":\"2016-09-17T04:29:28+00:00\",\"description\":\"Do you need to move from Spring to Java EE 6 -\",\"breadcrumb\":{\"@id\":\"https:\/\/navveenbalani.dev\/index.php\/articles\/do-you-need-to-move-from-spring-to-java-ee-6\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/navveenbalani.dev\/index.php\/articles\/do-you-need-to-move-from-spring-to-java-ee-6\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/navveenbalani.dev\/index.php\/articles\/do-you-need-to-move-from-spring-to-java-ee-6\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/navveenbalani.dev\/\",\"url\":\"https:\/\/navveenbalani.dev\/\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"position\":2,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/navveenbalani.dev\/index.php\/articles\/do-you-need-to-move-from-spring-to-java-ee-6\/\",\"url\":\"https:\/\/navveenbalani.dev\/index.php\/articles\/do-you-need-to-move-from-spring-to-java-ee-6\/\",\"name\":\"Do you need to move from Spring to Java EE 6\"}}]},{\"@type\":\"Article\",\"@id\":\"https:\/\/navveenbalani.dev\/index.php\/articles\/do-you-need-to-move-from-spring-to-java-ee-6\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/navveenbalani.dev\/index.php\/articles\/do-you-need-to-move-from-spring-to-java-ee-6\/#webpage\"},\"author\":{\"@id\":\"https:\/\/navveenbalani.dev\/#\/schema\/person\/51f7ab14b20611d95e3c7fd4ea0950bf\"},\"headline\":\"Do you need to move from Spring to Java EE 6\",\"datePublished\":\"2010-10-19T16:26:27+00:00\",\"dateModified\":\"2016-09-17T04:29:28+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/navveenbalani.dev\/index.php\/articles\/do-you-need-to-move-from-spring-to-java-ee-6\/#webpage\"},\"commentCount\":2,\"publisher\":{\"@id\":\"https:\/\/navveenbalani.dev\/#\/schema\/person\/51f7ab14b20611d95e3c7fd4ea0950bf\"},\"image\":{\"@id\":\"https:\/\/navveenbalani.dev\/index.php\/articles\/do-you-need-to-move-from-spring-to-java-ee-6\/#primaryimage\"},\"keywords\":\"JAVA EE 6,JAVA EE SPRING COMPARE,SPRING JAVA EE 6\",\"articleSection\":\"Articles,Spring framework,Views &amp; Opinions\",\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/navveenbalani.dev\/#\/schema\/person\/51f7ab14b20611d95e3c7fd4ea0950bf\",\"name\":\"Navveen\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/navveenbalani.dev\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/navveenbalani.dev\/wp-content\/uploads\/2019\/07\/navveen_balani.jpeg\",\"width\":200,\"height\":200,\"caption\":\"Navveen\"},\"logo\":{\"@id\":\"https:\/\/navveenbalani.dev\/#personlogo\"},\"sameAs\":[\"http:\/\/naveenbalani.com\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/navveenbalani.dev\/index.php\/wp-json\/wp\/v2\/posts\/1088"}],"collection":[{"href":"https:\/\/navveenbalani.dev\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/navveenbalani.dev\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/navveenbalani.dev\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/navveenbalani.dev\/index.php\/wp-json\/wp\/v2\/comments?post=1088"}],"version-history":[{"count":10,"href":"https:\/\/navveenbalani.dev\/index.php\/wp-json\/wp\/v2\/posts\/1088\/revisions"}],"predecessor-version":[{"id":2154,"href":"https:\/\/navveenbalani.dev\/index.php\/wp-json\/wp\/v2\/posts\/1088\/revisions\/2154"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/navveenbalani.dev\/index.php\/wp-json\/wp\/v2\/media\/2128"}],"wp:attachment":[{"href":"https:\/\/navveenbalani.dev\/index.php\/wp-json\/wp\/v2\/media?parent=1088"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/navveenbalani.dev\/index.php\/wp-json\/wp\/v2\/categories?post=1088"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/navveenbalani.dev\/index.php\/wp-json\/wp\/v2\/tags?post=1088"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}