A Little Java, A Few Patterns - Matthias Felleisen, Daniel P. Friedman

A Little Java, A Few Patterns

Matthias Felleisen, Daniel P. Friedman

出版社

The MIT Press

出版时间

1997-12-19

ISBN

9780262561150

评分

★★★★★
书籍介绍
Java is a new object-oriented programming language that was developed by Sun Microsystems for programming the Internet and intelligent appliances. In a very short time it has become one of the most widely used programming languages for education as well as commercial applications.Design patterns, which have moved object-oriented programming to a new level, provide programmers with a language to communicate with others about their designs. As a result, programs become more readable, more reusable, and more easily extensible.In this book, Matthias Felleisen and Daniel Friedman use a small subset of Java to introduce pattern-directed program design. With their usual clarity and flair, they gently guide readers through the fundamentals of object-oriented programming and pattern-based design. Readers new to programming, as well as those with some background, will enjoy their learning experience as they work their way through Felleisen and Friedman's dialogue.
AI导读
核心看点
  • 用Java子集讲解函数式编程思想
  • 循序渐进推导访问者模式原理
  • 一问一答式引导理解OOP概念
适合谁读
  • 有函数式编程基础的Java初学者
  • 想深入理解设计模式本质的开发者
  • 对王垠推荐书单感兴趣的程序员
读前提醒
  • 切勿跳读,需跟随对话逐行思考
  • 习惯食物命名及类嵌套写法
  • 最后一章较难,可结合FP知识阅读
读者共识
  • 讲解清晰,自然引出设计模式
  • 将Java当作函数式语言来玩
  • 示例简练,适合入门学习Java

本导读基于书籍简介、目录、原文摘录、短评和书评生成,不等同于全文精读。

精彩摘录
  • "And a third? 21 Here's one more: new Onion( new Lamb( new Onion( new Skewer()))). Are there only Onions on this Shish: new Skewer()? 22 true, because there is neither Lamb nor Tomato on new Skewer()"
  • "If Java had parametric polymorphism for methods, no downward cast would be necessary for our visitors (Martin Odersky and Philip Wadler, Pizza into Java: Translating Theory into Practice, Conference Record on Principles of Programming Languages, 146-159. Paris, 1997)"
  • "Does that mean that anybody can write yy.p = new Bot() and thus change a pieman like yy? 36 No, because yy's type is Peiman, p isn't available. Only addTop, remTop, substTop, and occTop are visible. Isn't it good that we didn't include p in Peiman? 37 Yes, with this trick we can prevent others from "
用户评论
沒見過把 OOP 當 FP 玩兒的,但非常有趣,看他循序漸進,去到某處就有似曾相識的感覺,慢慢就更懂了 class interface object 之間的關係,最後掌握 visitor pattern。有意思,但說這是 Java 精粹的話,不知道是在黑 Java 還是鼓勵讀者研究 FP 呢,反正我看完對 FP 更感興趣些。王垠推薦就看了,不錯。
看完了,把OOP当成FP来玩,佩服。至于实用性?看这书的,睡在乎? visitor模式很漂亮!
示例简练,可用作学习Java的第一本书
visitor pattern讲透了;最后用interface实现的Y组合字还没太看懂
看了两章,看不下去了。。。
这是一本不浮躁的书,从减少模版代码的角度挺有意义的
牵强的用scheme的思路讲了讲visitor pattern, 但是考虑成书时间,彼时design patterns刚初登舞台,所以开阔思路可以,visitor pattern本身应用是很窄的
抽象,框架。出现accept方法的时候,惊呆了
有点啰嗦,主要就是讲了一个visitor pattern,还是有点意思的,虽然工作中几乎不可能这么写代码。书写于1997年,如果现在用范型重写一遍示例代码应该会更优雅一点。
一刷后,有点不明觉历。特别是第十章,不知道主要是说什么,看起来是出现了对状态的改变。这本书对类、继承的描述很特别。总体值得一看,过几天二刷……
收藏