醒也罢 梦也罢 人生苦短
Java web framework 之选择
相比 PHP, Ruby, Python 等语言,用 Java 来做 web 开发面临着太多的选择。不过也许正因为 Java 的选择更多,所以才有更多的人选择 Java?这一点不能确定。来这里看看,光是持久层的 ORM 工具就有这么一大坨。当然这里面还是 Hibernate 为王,这个选择比较容易做。 然而到了表现层,虽然框架不是那么多,但是选择起来可不容易。每个框架需要评估的方面至少包括性能、学习/开发速度、可维护性、用户群体 (community) 等。 Matt Raible 曾经对 Java web framework 们做了比较 (PDF 下载,建议右键另存为),我觉得这个 presentation 可以从39页开始看。第43、43页的建议和 tips 非常有价值: Don’t believe blogs and articles – 也就是说,该 presentation 39页之前的内容要谨慎对待 🙂 Try it yourself Believe developers, not evangelists Believe developers that are experienced with the framework and have used it in production Beware of corporate interests – they can twist marketing Books are a good sign 如何选择呢?”Pick 2-3 frameworks for your type of application… and prototype! If prototyping is painful, switch.” 嗯,不要仅仅看各种派别的人整天在那争论孰优孰劣,虽然他们的争论很有价值,但是每个框架都有自己的优点和缺点,甚至有些优缺点是主观的。你选择的框架应该在你的项目环境(项目本身以及团队情况)中扬长避短,将优势发挥到最大。”You should try a framework before dissing it!” ...