Web Development with Clojure cover

Web Development with Clojure

No rating yet
Word count
191K words
Chapters
40
ISBN
9787115398932

Tags

Summary

Web Development with Clojure is the Chinese translation of Web Development with Clojure, devoted to practical web application development with Clojure, a Lisp dialect. Clojure runs on the JVM, borrowing from the rich Java ecosystem while excelling in functional programming, immutable data, and concise expression, making it well suited to building concurrency-friendly, easily evolving web services. The book has seven chapters: starting from environment setup and a first project, it introduces the Ring/Compojure stack, routing, and application architecture, then covers building RESTful services with Liberator, accessing relational databases and generating reports, and then uses a fully functional photo gallery site as the main thread, linking typical tasks such as account registration, login and logout, image upload, display and deletion, and account cancellation, and finally covers styling, unit testing, logging, configuration and packaging/deployment, plus advanced topics including Selmer templates, ClojureScript, and SQLKorma. Three appendices cover IDE choice, a Clojure quick start, and document-oriented database access. Concise in length, the book leads readers through the complete process from conception to launch by learning through doing.

Editor's review

Clojure 在国内开发者圈子里长期属于“小而美”的语言,系统性的中文实战书屈指可数,这本《Clojure Web开发实战》正是其中一本难得的选择。它由 The Pragmatic Programmers 出版,作者 Dmitri Sotnikov 是 Luminus 微框架的作者,十多年专注 Web 应用开发,书里的技术路线基本就是他本人在真实项目中的做法。全书只有两百来页,却没有把篇幅用在语法罗列上,而是以一个个递进的任务推进:先用 Ring/Compojure 打通请求与路由,再用 Liberator 讲清 REST 资源的状态转移,接着落到关系型数据库取数出报表,最后用一个相册网站把注册、登录、上传、展示、删除、部署串成完整闭环。读者跟着敲一遍,就能对 Clojure Web 栈形成整体认知。第七章还演示了如何把服务端代码平滑升级到 ClojureScript,让前后端共用同一门语言。附录的 Clojure 入门足够零基础读者起步,IDE 与文档数据库两节也补上了工程细节。适合想跳出 Java/Python 舒适区、体验函数式 Web 开发的一线工程师。

Who it's for

A good fit for

  • 已有 Web 开发经验、想系统学习 Clojure Web 栈的后端工程师
  • 对函数式编程感兴趣、希望用 Lisp 方言落地真实项目的开发者
  • 需要快速搭建 RESTful 服务与小型网站的技术负责人
  • 熟悉 Java 或 JavaScript、希望在 JVM 上尝试新语言的技术爱好者

Not a good fit for

  • 完全没有编程基础、尚未掌握任何一门语言的初学者
  • 只想要 Clojure 语法速查手册或语言理论大全的读者
  • 需要前端框架、微服务架构等当下热门主题深入讲解的从业者

Reading tips

  1. 先按附录2 了解 Clojure 的基本语法与 REPL,再回到正文第1章动手搭环境。
  2. 第5章相册项目是全书主线,建议边读边敲,先跑通再回头理解设计取舍。
  3. 对 REST 设计不熟的话,可在第3章 Liberator 部分多花时间,理解资源与状态转移。
  4. 书中库版本较老,实践时注意对照官方文档更新依赖,重点学习方法而非拷贝代码。

About the publisher

Posts & Telecom Press China · Founded in 1953

Posts & Telecom Press is known for its strengths in science and technology, computing, and information and communications titles, and has extended its publishing into photography, art, software learning, and inspirational growth, giving it a fairly diverse range. Its catalog includes computing and communications works such as Refactoring and Patterns (Revised Edition) and Huawei Switch Learning Guide (Second Edition), alongside bilingual collector's editions such as The Little Prince (Chinese-English-French illustrated collector's edition), The Great Gatsby, and Three Days to See. Beijing Ten Years: 1980-1990 and Ghost Blade: WLOP Personal Illustration Collection reflect its presence in photography and art. Its authors include Antoine de Saint-Exupéry, Helen Keller, Joshua Kerievsky, Wang Da, Zhang Zhaozeng, and WLOP.

Contents

  1. Chapter 1 Getting Started
  2. 1.1 Setting Up the Environment
  3. 1.2 Your First Project
  4. Chapter 2 The Clojure Web Stack
  5. 2.1 Routing Requests with Ring
  6. 2.2 Defining Compojure Routes
  7. 2.3 Application Architecture
  8. 2.4 Beyond Compojure and Ring
  9. 2.5 What You Learned
  10. Chapter 3 Liberator Service Components
  11. 3.1 Creating a Project
  12. 3.2 Defining Resources
  13. 3.3 Putting It Together
  14. 3.4 What You Learned
  15. Chapter 4 Accessing Databases
  16. 4.1 Using Relational Databases
  17. 4.2 Generating Reports
  18. 4.3 What You Learned
  19. Chapter 5 The Photo Gallery
  20. 5.1 Development Workflow
  21. 5.2 What the Gallery Does
  22. 5.3 Creating the Application
  23. 5.4 The Application Data Model
  24. 5.5 Task 1: Account Registration
  25. 5.6 Task 2: Login and Logout
  26. 5.7 Task 3: Uploading Images
  27. 5.8 Task 4: Displaying Images
  28. 5.9 Task 5: Deleting Images
  29. 5.10 Task 6: Deleting Accounts
  30. 5.11 What You Learned
  31. Chapter 6 Wrapping Up
  32. 6.1 Adding Some Style
  33. 6.2 Unit Testing
  34. 6.3 Logging
  35. 6.4 Application Configuration Files
  36. 6.5 Packaging the Application
  37. 6.6 What You Learned
  38. Chapter 7 Mixing It Up
  39. 7.1 Using Selmer
  40. 7.2 Upgrading to ClojureScript

FAQ

这本书适合零 Clojure 基础的人读吗?
适合。附录2 提供了 Clojure 快速入门,涵盖函数式理念、数据类型、高阶函数、命名空间等内容;正文第1章也从环境搭建讲起。不过读者最好已有其他语言的 Web 开发经验,读起来会更顺畅。
本书和英文原版是什么关系?
本书是 The Pragmatic Programmers 出版的《Web Development with Clojure》的中文译本,由张恒翻译、人民邮电出版社出版,据 2014 年英文原著译出。英文原书后续已更新到第3版,内容有较大变化。
书中的技术栈现在还能用吗?
Ring、Compojure、Liberator、Selmer、ClojureScript 等核心库沿用至今,思路依然有效;但具体版本、项目模板和部分依赖配置已经过时,实践时建议参照各库的最新文档调整。
读这本书需要什么前置知识?
作者表示具备一些函数式编程经验会有所帮助,但并非必需。建议至少熟悉一门编程语言,了解 HTTP 请求响应、路由、数据库等 Web 基本概念,这样能更快进入实战部分。

Comments

Find this book

This site is an index: you start “Search all sources” in your browser, and the entries it lists all point to third-party sites; please judge their availability yourself.

Top rated in the same category