Category Archives: JEE

Spring Framework Vs. JEE – Part III

This is my final blog on this topic, hopefully. Part I of the blog can be found in here and Part II of this blog can be found in here.

I do at times think that my blog title itself is misleading or rather incorrect as I don’t feel that there needs to be a comparison between the two as both can exists together in one application without any issues at all. In fact if that’s the case we can use the best of both and be happy. But, there does exist this debate for a very long time and now a days Oracle also at times gives a comment to kill Spring Framework (buy and kill it to reduce competition, Oracle’s buying spree logic) and go with standards. Being the creators and maintainers of the Java language they do have the right to promote JEE but I feel they don’t have to have such a stance IMHO.

The community with full adoption of language has made it to a be a standard. Similarly when Spring Framework came in existence it was indeed helping Java developers use Java and avoid the complexities to develop enterprise application. In fact we have to give full credit to Spring Framework in keeping Java language alive and kicking. I have heard many times, even from my own managers that Java is too heavy and not that good for application development when you compare .NET. Spring to some extent have been bale to bring that easiness to it by taking the complexities away. At the moment also there might not be that much comparison between easiness with respect to .NET, but community is ready to develop applications using Java. Again for enterprise application comparing .NET and Java (JEE) is not that of a good idea because of so many reasons. Don’t want to divulge too much off the topic here.

As Kelly Tisdell mentions in his blog, JEE has definitely taken some page out of Spring Book and added onto its big Java bible and spreads a word across that “Java is standard, so migrate to JEE from Spring to be in standard”. It doesn’t say directly that stop using Spring but it has that tone in it.

Even after taking those pages, to develop an enterprise application from scratch using JEE does have its won complexities and Spring does have that easiness to it (might be subjective and debatable, but that what i feel). Most of nicer features in Spring has now crept into JEE under different names and much refined fashion (JEE have learned from mistakes and corrected it) for sure and that’s the reason developers have been prompted to think for this migration.

I wanted to put more facts in here rather than my opinions, but after so long I have indeed lost interest in filling in more details and i thought that i will just give my opinion and close this not so ending blog post.  Apologies for same.

In my opinion, Spring and JEE should marry each other and an enterprise application should be developed taking into good points from both. I am in no way saying that JEE or Spring scores over the other because both are really good platforms to develop your enterprise applications.

Page Visitors: 241

Weblogic 11g and JMS

Write once, run anywhere….. This is Java as we know…. is it practically like that? Hmmm…. i don’t think so….

Running your once written application and deploying it in various containers according to your requirement is tedious and is very time consuming figuring out the nitty-gritties involved in doing so. Recently i had a project in which i am trying to do just that, write a web application, in fact a web service web application having capability of connecting to queues created in JBoss and Weblogic. I struggled initially trying to do this with JBoss (sounds amateur but i really did… yes as you call in Java world.. Jar hell). I struggled even beyond when i was trying to do this with Weblogic. I couldn’t do this till now but while searching in the internet there were some very cool blogs written on the Weblogic and JMS (yes basic stuff for senior developers). I felt these blogs as well written, easy to understand ones. Spending time writing such blogs really takes a hell lot of time and effort and in my blog i just want you guys to point to the right ones. I congratulate these bloggers and pat on their back. Here are some of these, purely with respect to Weblogic 11g and JMS.

Note:- I am not a great fan of Weblogic… 🙂

https://blogs.oracle.com/soaproactive/entry/how_to_create_a_simple

Basic stuff. Well written in easy reading pattern. By skimming through, you ca complete reading this in hardly 15-20 minutes.

Other following parts are also well written just giving those links as well below:-

https://blogs.oracle.com/soaproactive/entry/jms_step_2_using_the

https://blogs.oracle.com/soaproactive/entry/jms_step_3_using_the

https://blogs.oracle.com/soaproactive/entry/jms_step_4_how_to

https://blogs.oracle.com/soaproactive/entry/jms_step_5_how_to

https://blogs.oracle.com/soaproactive/entry/jms_step_6_how_to

That’s it folks. I am going to categorize these kinds of blogs under “Interesting Blogs” and corresponding technology equivalent.

 

Page Visitors: 540

Spring Framework Vs. JEE – Part II

As promised this is my second part of my blog. The first part of the blog can be accessed from here.

As part writing this blog i browsed through various blogs on the same topic. As i told in my first blog, this really is a holy war and over coming few months and years, this will rage even harder.

I bust out into laugh after reading one of the blogs, the link for which is as given below:-

http://broadleaf.tumblr.com/post/31333966305/broadleaf-continues-to-choose-spring-framework

The point that i burst outlaughing when the author stated as below:-

<quote>

…… Java EE 5 took a few pages out of Spring’s book and simplified the development of enterprise components with…….

</quote>

Yes, JEE sure did take some very crucial and important pages out of Spring book and because of which it is becoming superior day-by-day if not by huge margin. Spring with full support from its community is not far behind and with foundation in place, its building up components one after another. Its also adding in more and more support for open source libraries with ever growing sub-projects under the Spring Framework umbrella.

Also now its is slowly becoming a norm when considering a new open source for development to see how strongly it can be integrated into Spring and how seamless Spring configurations can be used. In my web service framework comparison, you wouldn’t believe, this was considered as one of the requirements and it will be a bonus for any open source to state that “they can be integrated into Spring” with some few lines of Java or XML configuration.

Spring has an edge by keeping it open for good open source libraries to plug on at any time and replace these libraries with a new one by mere configurations (at-least theoretically possible… :)). Java theoretically is “Write once run anywhere”, but is it truly that easy for a a production application to move from one environment to a new one… Hmmm… I don’t think so… 🙂

I am sort of exhausted already writing this blog. I will have to put you all in some suspense and put everything else that i plan to write in a new blog part. Hold on tight and i am sure i wouldn’t make you unhappy. Expect third part in another 3 days time. Its weekend here and i am really looking forward to it in a big way.

Page Visitors: 314

Spring Framework Vs. JEE – Part I

Am I playing with fire here. Perhaps Yes.

As many say, this truly classify itself to be a holy war for predominance and will surely stir some dirty stuff out into the air.

One of my colleagues recently came to me and had a small debate as to why the our organization selected Spring over JEE. He was very much in favor of JEE especially JEE 6.

We sometime back (more than an year) had an exercise in which the task was to choose organization wide Java framework. As you guessed right, we did have Spring Framework and JEE as strong candidates. Our approach was really methodical and a methodology which was devised internal to the organization was used.

In this methodology the two candidates was put into test. First of all, various architecture quality attributes were put in such as Performance, Scalability, Testability etc. and then various requirements in these attributes were classified/grouped together. Once we have that, we get the various stakeholders involved and get their buy in and their stand on the overall acceptance of these quality attributes and rank it. We then went on with POC (Proof of Concept) and each requirement was rated against each of the chosen frameworks.

Finally after a grueling exercise of rating various requirement for each of the framework, a final rating comes out which give good indication as to which on quality attributes gets favored for each of the framework and according to the stakeholders, which one to choose out of these two. The choice was made and there was no surprise, it was Spring Framework.

For our company now the chosen default framework is Spring and anything else if it is taken, it goes as an exception.

For me when i say that i use Spring Framework, it doesn’t in any way mean that i don’t use JEE. They cannot be mutually exclusive, rather when combined together, it gives immense advantage to the project that you are developing. We do use Spring as our choice of framework but haven’t just taken out JEE in any sense out of the window, rather when the right time comes another evaluation as detailed above will be done to asses the situation even further. Till that time i feel choosing Spring as the default framework is a good one in all aspects.

In my next blog (Click here), I would try to give some of the major points, which made us choose Spring as a default framework of choice for developing any application within the organization.

Earlier i have done couple of comparisons as detailed below:-

Spring Integration Vs. Apache Camel

Web Service Framework Comparison – 2013 – Part I

Web Service Framework Comparison – 2013 – Part II

Page Visitors: 797

Basic Core Java Concepts

First of all, advance bail on my behalf if my content is insignificant at this point. I thought of writing this blog post after searching through Google Trends and noting that there are good amount of search queries till now looking for these basic core java concepts.

I don’t want to split this blogs into multiple parts as i feel it wouldn’t be good for a reader to go onto various parts and would like to keep it an ever evolving blog post with full support from my readers.

[TODO]

My previous blogs could give some inputs in bulleted points to new Java developers as given below:-

Basic Java FAQ – Part 1

Basic Java FAQ – Part 2

Basic Java FAQ – Part 3

SCJP – Quick Notes

and finally and small mock example to check knowledge

Mock Exam

Page Visitors: 417

Web Service Framework Comparison – 2013 – Part II

As promised here is my Part II of the blog. You can find Part I of the blog in here. Also my chapter on Spring WS in my Spring book in here.

The Blog is still under construction but i would like to publish it and then keep on updating with more content. Apologies for incomplete blog post.

Apache CXF

The project is a merger between two open source projects namely Celtix developed by IONA technologies and XFire developed by Codehaus. As you would have already figure why the name CXF – Celtix XFire. Rather than me plagiarizing, I would suggest reading the Wikipedia for more details http://en.wikipedia.org/wiki/Apache_CXF.

Some of the advantages associated with Apache CXF is as follows:-

  • Good cohesive support for the Spring Framework.
  • Good OSGi support (How much this is a valid constraint for the evaluation is questionable, i agree).
  • Good support for more strong web service functionalities like WS-Security, WS-Policy etc. to name a few.
  • It also has a compliant JAX-RS implementation allowing it to expose web service as REST and SOAP based.
  • It also has W3C compliant SOAP/JMS implementation if they are required.
  • Much easier to use and implement.
  • Less verbose when it generates basic classes for WS/WS-Client from the WSDL.
  • More “standards based” API’s. The API’s are slim and trim with good performance and ease of use.
  • Considered more “embeddable” as opposed to other WS frameworks, especially with the Spring Framework.
  • CXF provides support for code first and contract first development, and provides ability to plug-in various flexible binding mechanisms.
  • The front end programming API’s is spectated from the core code making it really flexible.

Some of the disadvantages associated with Apache CXF is as follows:-

  • Doesn’t support Orchestration and WS transactions yet (I really don’t know how relevant this is, i plagiarized it from Ankur Kumar blog, refer reference section of this blog post. As he is well-versed with WS, i think i should believe him. Might be Daniel Kulp will help me with this.)
  • WSDL 2.0 support is not yet there.
  • Again, CXF is very good with SOAP, so for web services based on REST, due to its very good support for SOAP, CXF brings in added weight and complexity (I am expecting Daniel Kulp to help on this as well)

Apache Axis2

As explained earlier is a completely re-written version of the famous Apache Axis SOAP stack. While doing so it has to some extend looked upon various lessons learnt and corrected it. Some of the advantages of using Axis2 are as detailed below:-

  • Good support for more strong web service functionalities like WS-Security, WS-Policy etc. to name a few.
  • Good integration support for binding frameworks like XMLBeans, making it suitable for creating web services having complex schema definitions.
  • Somewhat better integration support with the Spring Framework. More details can be found at http://axis.apache.org/axis2/java/core/docs/spring.html.
  • Considering performance aspects, it performs a bit faster compared to Apache Axis2 due to use of proprietary API’s.
  • Supports bothe Contract-First and Contract-Last approach, which gives good flexibility and choice to the users. This is key to some extend.

Some of the disadvantages attributed to Axis2 are as detailed below:-

  • Lack of cohesive support with JAX-WS. the support is detailed in the following URL: http://axis.apache.org/axis2/java/core/docs/jaxws-guide.html.
  • Again good cohesive support between Axis2 and Spring Framework as opposed to other WS frameworks.
  • Good amount of classes, a bit hard to understand and difficult to refactor in case if it is required.
  • Churns out more proprietary API’s and you as a developer would have to handle these.
  • Quick turnaround with fixes and releases. You could read Part I of this blog which compared these aspects in detail.
  • Slowly Apache is phasing out Axis2 in favour of Apache CXF (Please dont quote me on this, but this is slowly happening)
  • It’s a web application by its own with all the services deployed in WEB-INF/services folder as AAR (Axis 2 Archives). This structure as a whole can be problematic while deploying, maintaining, upgrading, versioning and testing to a greater extend.

Spring WS

Some of the advantages associated with Spring WS is as follows:-

  • Full support of the Spring programming model and this can be a very good advantage to take this framework on. The Spring Framework is leading the Java web framework race, now almost single handedly and this advantage is key according to me.
  • Clean API’s (same as above because Spring having clean API’s has influenced this to a larger extend)
  • Clean mapping of the incoming SOAP messages to the methods
  • If your web application framework is based on Spring MVC, Spring WS gives easy and clean mixing between WS endpoints and Spring MVC’s controllers. Also coding of endpoints is as easy as coding a new controller in Spring MVC.
  • Easy unit/integration testing capabilities.
  • Support for different XML marshallers.
  • No generated code/deployment descriptors.

Some of the disadvantages associated with Spring WS is as follows:-

  • Supports only Contract-First approach, which could result in lack of flexibility to the users.
  • Most of WS-* support might be questionable. By the way how much of WS-* things we use?

Technologies grow faster and with open community development, issues identified gets fixed quickly. Having said that, there is an article which i would like to share; http://www.ibm.com/developerworks/java/library/j-jws19/index.html; which rates Apache CXF more as compared with Apache Axis2 in security aspects. Many issues identified would have got corrected over the period of 3 years, but its worth noting these.

Although my comparison is not that well structured, i found a blog released on the same day as i was typing mine, which details the set of criteria which should be used for evaluating the web service frameworks. If i have to do this extensive comparison, it would take me at least 3 months. Since i don’t have much time at this point, i still don’t want the reader not to see these evaluation criteria, which is well structured and though through:

http://naveenbalani.com/index.php/2010/05/evaluating-web-service-frameworks/

Things which I think (Purely my own)

  • For almost 80% of the projects the capabilities required can be covered in a good way by using either Apache CXF or Apache Axis2. If already you application is based on Spring Framework, I would suggest using Apache CXF along with Spring Framework OR using Spring WS with use of CXF as the web service engine.
  • Spring WS similar to the Spring programming model has good and clean API’s, making it easy for developers (juniors) to code web services in Spring WS fast and easy. If you would like more standards, i think Apache CXF is a good choice over Apache Axis2. Again Apache Axis2 is slowly getting itself eaten up by Apache CXF. Fro an enterprise application point of view longevity and community support id required and here CXF scores well compared to Axis2.

Spring WS > Apache CXF > Apache Axis2

I cannot really say that Spring WS is above Apache CXF, because they are very very good fraewmorks. According to your application requirement, i would suggest using either Spring WS or Apache CXF.

Finally to finish off the blog, i would again like to share a picture, which gives Google Search Trends for these Web Service Frameworks in the year 2013 – WorldWide. How much it gives an edge to Apache CXF is questionable, nevertheless gives an indication as to what people are looking for in Google with regards to these frameworks and which is more active.

GoogleTrendsWSFrameworks

There is a beautiful page maintained in Apache which compares the various WS frameworks as a whole. The page is edit last in the year 2011, but I felt the page is a good share in my blog (note Spring WS is missing in the list because it is not an Apache project).

http://wiki.apache.org/ws/StackComparison

References

Page Visitors: 5909

Web Service Framework Comparison – 2013 – Part I

I have done a similar blog post earlier, namely Spring Integration Vs. Apache Camel, surprisingly it received good review from the community and i thought i will do a similar exercise on one of the other big topic of comparison these days, Web Services Framework.

I have a Spring Book Chapter in Spring Web Service, which you can find in my Spring Book, Chapter 16.

Again, i am not biased on selecting any of the frameworks. The view expressed are solely mine. To be honest i don’t have a great deal of experience in the field of web services, but again as part of one of my projects i came into a scenario where i have to select on these frameworks and i thoughts to share the details that i collected. Again, i don’t want to give a verdict, as i don’t consider myself capable of doing so. Just so that anyone in situation can go through the blog and get details, compile it, present it to the team and based on it take the final decision for your project.

Also i have taken three web service framework, which i felt was top in the industry as of now. If anyone disagrees, please feel free to comment on the blog and looking at its relevance i will correct it, as i don’t want this blog to a misleading one for the community as a whole.

Apache CXF

Apache CXF is an open source services framework. CXF helps you build and develop services using frontend programming APIs, like JAX-WS and JAX-RS. These services can speak a variety of protocols such as SOAP, XML/HTTP, RESTful HTTP, or CORBA and work over a variety of transports such as HTTP, JMS or JBI.

– http://cxf.apache.org

Axis2

Apache Axis2™ is a Web Services / SOAP / WSDL engine, the successor to the widely used Apache Axis SOAP stack. There are two implementations of the Apache Axis2 Web services engine – Apache Axis2/Java and Apache Axis2/C.

– http://axis.apache.org

Spring WS

Spring Web Services is a product of the Spring community focused on creating document-driven Web services. Spring Web Services aims to facilitate contract-first SOAP service development, allowing for the creation of flexible web services using one of the many ways to manipulate XML payloads.

– http://static.springsource.org/spring-ws/sites/2.0

Comparison from ohloh.net for the two projects:-

WebServiceComparison1

WebServiceComparison2

I think the comparison figure that is shown above doesn’t convey the exact comparison that we expect. Just by looking the figure above, Spring WS scores very low and can be taken out immediately from comparison. BUT that’s not the case IMHO. Lets get dirty and try the various comparison in some detail.

This is something new in this post, job trends on these technologies from indeed.com is as shown below. What it shows? It might not be relevant, but it shows what companies are looking at hiring when it comes to these technologies. It might be misleading but it shows that what companies are thinking and which technology is popular in various organization’s mind.

JobTrend

JobTrend1

The above comparison figure on the various web service framework’s job opening’s doesnt really give any technical comparison between them but is a good to know fact. It also gives some trends followed by various companies.

Note:- Spring Web Service project was added by me in ohloh.net, solely for comparison perspective. The code location was already added in the main Spring Framework project. If anyone feels that this is not the right way, please feel free to send me a comment and i will do the needful. Also, if it is violating any of the legal terms doing so, please don’t sue me.. :). If given proper directions, i will correct it as early as possible.

In Part II of the post, i will be covering the comparison of these frameworks in detail, looking at various aspects and trying to get some conclusion as to which framework has an edge over the other and what is the reason for me to think so.

Let me have my short and sweet weekend and by next week you can read my blog post, which will be more useful and informative.

 

Page Visitors: 1197