开发者

Spring MVC vs JSF [duplicate]

This question already has an answer here: 开发者_开发百科 Difference between Request MVC and Component MVC [closed] (1 answer) Closed 6 years ago.

I haved used Struts framework in all my past applications and for the new application,my client has requested to use either Spring MVC or JSF? I am not familiar with these two frameworks but our timelines are strict. So, I am not sure which framework I will choose to build the application.

Can anyone please suggest me which framework will be easy to learn in quick time?

Thanks


Of course, it's going to be different for everyone, but I'd suggest Spring MVC, as it's a request-based framework like Struts. Of course, you'll want to learn about core Spring stuff like Inversion of Control / Dependency Injection (but I'd consider that a plus...) and whatever you're going to use for database access (just JDBC? Hibernate? iBatis? etc.).

JSF is component-based, which is a bit different paradigm from request-based frameworks. If you do plan to go the JSF route, I'd suggest looking at Seam from JBoss. It's more of a front-to-back framework that uses JSF as the web/presentation end and EJB as the backend. And pretty much all the people who've used it claim it makes JSF and EJB more usable than they are by themselves.

Good luck on whichever technology you choose, though. (Sounds like you'll need it - strict timelines and a client that's prescribing web frameworks?)


I'd suggest SpringMVC, because of the timeframe:

  • you need something with less steep learning curve. SpringMVC is more like Struts than JSF
  • in order to use the power of JSF you need to get familiar with many "tricks", while SpringMVC is more or less straightforward


I'd suggest JSF + Primefaces component library. I am using this combination to build most of our projects. As I remember, I spent one week to learn the technology and finished my first project in one month. The development time at least 30% faster than Struts.

SpringMVC is not a bad technology and it's quite popular.

Really depends on which one your like the most.


JSF is just the view layer of the MVC and wil need to be used with other technologies like Spring/Hibernate or EJB for a full MVC.

I have been using the Spring MVC for about 1 months now, whilst it's probably not the latyest version of SpringMVC I've found it a little annoying that we have so much XML to deal with. All the managed beans and DAO has XML config to it. Also everything seems to have to go thorugh a method called onSubmit().

JSF with something like EJB is far simplier in my opinion... Everything can be done using Annotations so simply use @ManagedBean=theBean in your backing bean and in your JSF put {thebean.param} and you have access to the backing bean's data. Also you can use the Session beans of your EJB as the backing beans for JSF then have direct acces to the DAO (Model layer) Entity bean. Again simply by using the @Entity annotation and the EntityManager class

Spring MVC is a web framework inside the Spring framework. It does provide features as those in JSF 2.0: ajax-support validation dependency-injection etc Yet, you can use Spring (not Spring MVC) together with JSF 2.0, with spring providing the dependency-injection, aop, transaction management mechanisms, and JSF providing the web layer.


Of course, you'll want to learn about core Spring stuff like Inversion of Control / Dependency Injection (but I'd consider that a plus...)

JSF is indeed based on IoC, and much simpler than the Spring learning curve.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜