I was going to migrate a desktop application which is done in java in to a web app. It has almost 15 packages and more than 100 classes. And I was planing to use JSF(with Primefaces) + Hibernate + Spring. I have got only a little knowledge about how to integrate Hibernate and Spring and I haven’t integrated them with JSF before. I have only three weeks and I can only spend less than five hour a day on this project.
One of my friend wrote me this (copy and pasted):
“You said you want to import your old project (JSF & Primfaces) to
Spring and Hibernate, you see there are some issues with that: 1- Do
you still want to use JSF as the UI? Or switch to Spring all together.
2- You can have JSF and Spring as the front and back end, and you can
have only Spring (that is my knowledge)3- If you switch to Spring all together I don’t think you can use
Primefaces anymore (just a guess, since Primefaces is simply a
collection of custom component for JSF).4- On the other hand JSF is not integrated with Hibernate, you cannot
easily use it. You must use a full Java EE container and have a full Java EE
project that is the only way you can get Persistence and Hibernate in
JSF, otherwise you will end up writing your own Persistence management
layer (not something fun to do) to enable the linking between your JSF
sessions JPA sessions. And many other things to manage transactions
and more.5- Going with Spring framework is much better, it already supports
Hibernate. “
I think I have misunderstood on managing sessions in JSF and in Hibernate. One thing I wanted to do in this project is, learn the efficient way of using those frameworks together. Even if I found it easy to use JPA to Hibernate, I will do that way. But I have to dig out and read some books and complete the project with in less than 3 weeks.
I came up with this two decisions
1.use either JSF with Hibernate and manage all the transactions.or
2.use JSF + Hibernate + Spring all together … But I need to have a deep understanding of the concepts before integrating them.
Do your have any similar experience? Can you please explain how the concept will look like if I choose no 2? …
So, basically, you are saying you have 75 man-hours (two weeks) to convert what sounds like a fairly complex desktop app into a web app based on an architecture you don’t understand using technologies that you are not sure work well together? I’m going to give you two answers for the price of one..
Consulting 101
Unless you have a solid understanding of the architecture involved, be very careful what you promise and include time to research (“fail gracefully”). Keep in mind that you are racing against two calendars: man-hours required to complete the work, and physical due date (not to mention a myriad of “soft” dates: start of testing, “drop-dead” date, design completion date, etc.). Often management drives these kinds of decisions (“we need a web version of this great app/tool!”) without fully understanding what is involved in converting a system.
The Notes from Your Buddy
It’s good to hear that you have resources that you can go to when you need help making these decisions. That is going to be key when attempting to tackle this problem. As to his suggestions:
Wrapping It Up
Returning to what seems to be the core question: What architecture do I choose to convert this desktop application into a web application in two weeks? I hate to give you the common consultant answer, but: It depends. Which which technologies are you most familiar? With which technologies are you willing to take a risk (and full Java EE stack vs. an ORM is a big decision)? What is your goal (are you looking to learn something new, or delivering a working, tested, and satisfactory implementation on-time)? Honestly, this probably isn’t the best answer to the question, however, identifying the real goals involved is one of the key skills of a solid technical lead. My opinion? JFaces + Spring sounds like a decent decision. So does some soul-searching..