I suppose this is a strange question to the huge majority of programmers that work daily with Java. I don't. I know Java-the-language, because I worked on Java projects, but not Java-the-world. I never made a web app from scratch in Java. If I have to do it with Python, Ruby, I know where to go (Django or Rails), but if I want to make a web application in Clojure, not because I'm forced to live in a Java world, but because I like the language and I want to give it a try, what libraries and frameworks should I use?
当前回答
我将对来自@weavejester (Compojure和Ring的维护者)的pipe发表我的意见。
它的核心是将Component和Ring路由器放在一个屋檐下。我使用管道的原因:
Excellent philosophical foundation: it encourages you to build your app as a series of small components, and it strikes a nice balance between holding few opinions while providing sane defaults. Stable path: I speak for myself, but over the years I've felt that the Clojure community has presented one less-than-credible web framework after another. A couple simply felt too experimental (my experience with Om and client-side Pedestal) for "getting things done" (not that they won't prove superior down the road). On the other hand, I feel like @weavejester has brought the same stability and measured progress to Duct that he did to Compojure and Ring, which have been superbly born out in the community. It's super lightweight, and out of the way of my components.
主要特点:
通过“端点”组织路由,你可以把这些小组件想象成迷你web服务器(或者,HTTP路由的小截面)。 重新加载工作流的开箱即用支持。 与Ring和Compojure完美集成。 开发和生产配置(这是我在其他地方发现的明显缺失的部分)。 带有示例的良好文档。
注意:这是不言而喻的,但对于web开发新手来说,就像大多数Clojurey的东西一样,pipe要求扎实掌握Clojure语言。我还建议先阅读Component。
在另一个个人注意,我已经在几个生产应用程序中使用了一年多了,对它非常满意。
其他回答
到目前为止,我所遇到的最好的Clojure web框架是Compojure: http://github.com/weavejester/compojure/tree/master
它很小,但功能强大,并且具有漂亮优雅的语法。(它在底层使用Jetty,但它对您隐藏了Servlet API,除非您需要它,但这种情况不会经常发生)。去看看那个URL的README,然后下载一个快照并开始播放。
Webjure, Clojure的web编程框架。
特性:分派servlet调用Clojure函数。动态HTML生成。SQL查询接口(通过JDBC)。
这个答案是Webjure信息的占位符。
我将对来自@weavejester (Compojure和Ring的维护者)的pipe发表我的意见。
它的核心是将Component和Ring路由器放在一个屋檐下。我使用管道的原因:
Excellent philosophical foundation: it encourages you to build your app as a series of small components, and it strikes a nice balance between holding few opinions while providing sane defaults. Stable path: I speak for myself, but over the years I've felt that the Clojure community has presented one less-than-credible web framework after another. A couple simply felt too experimental (my experience with Om and client-side Pedestal) for "getting things done" (not that they won't prove superior down the road). On the other hand, I feel like @weavejester has brought the same stability and measured progress to Duct that he did to Compojure and Ring, which have been superbly born out in the community. It's super lightweight, and out of the way of my components.
主要特点:
通过“端点”组织路由,你可以把这些小组件想象成迷你web服务器(或者,HTTP路由的小截面)。 重新加载工作流的开箱即用支持。 与Ring和Compojure完美集成。 开发和生产配置(这是我在其他地方发现的明显缺失的部分)。 带有示例的良好文档。
注意:这是不言而喻的,但对于web开发新手来说,就像大多数Clojurey的东西一样,pipe要求扎实掌握Clojure语言。我还建议先阅读Component。
在另一个个人注意,我已经在几个生产应用程序中使用了一年多了,对它非常满意。
Arachne是一个新的web框架。 引用网站的描述:
Arachne是一个完整的、高度模块化的web开发框架 Clojure。它强调轻松、简单和可靠、可扩展 设计。
它有一个 kickstarter运动 声称提供类似Rails的“入门”体验。它是 由一个Cognitect开发。
这是 与鲁米努斯(瑜伽)的作者进行了很好的讨论。
你也可以看看下面这些框架(摘自clojure/projects):
级联 召唤
关于Stack Overflow还有一个相关的问题:成熟的Clojure web框架?