`
zhang_xzhi_xjtu
  • 浏览: 536564 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

Effective Java第二版变更之 Classes and Interfaces

阅读更多
第2版  Classes and Interfaces

Item 13: Minimize the accessibility of classes and members

Item 14: In public classes, use accessor methods, not public fields
Item14为新加的条目。

Item 15: Minimize mutability
Item15原为Favor immutability. 现在改成了Minimize mutability,覆盖的范围更广一点。

Item 16: Favor composition over inheritance

Item 17: Design and document for inheritance or else prohibit it

Item 18: Prefer interfaces to abstract classes

Item 19: Use interfaces only to define types

Item 20: Prefer class hierarchies to tagged classes
Item20为新加的条目。解释了在类的设计中引入tag field的坏处,以及如何用类的继承体系去实现相似的功能。

Item 21: Use function objects to represent strategies
Item21为新加的条目。这个条目好像意义不大,讲解了java在没有原生函数指针的情况下如何用其他手段完成函数指针的功能。

Item 22: Favor static member classes over nonstatic







分享到:
评论

相关推荐

    Effective Java 3rd edition(Effective Java第三版英文原版)附第二版

    4 Classes and Interfaces Item 15: Minimize the accessibility of classes and members Item 16: In public classes, use accessor methods, not public fields Item 17: Minimize mutability Item 18: Favor ...

    effective-java 配套代码

    《Effective Java》是Java开发领域的一本经典著作,由Joshua Bloch撰写,书中提出了一系列编程最佳实践和设计模式,帮助开发者写出更高效、更可靠、更易于维护的Java代码。配套代码`effective-java-examples-master`...

    Part 3:GridWorld Classes and Interfaces - 2015年软件工程实训 - SoYa Wik

    在Part 3:GridWorld Classes and Interfaces中,我们将深入探讨这些关键组件。 首先,`Actor`类是所有GridWorld中演员对象的基类。用户通常会创建继承自`Actor`的自定义类来表示他们想要的行为和外观。每个`Actor`...

    Digital Video and HDTV, Algorithms and Interfaces

    2. **《Texturing & Modeling: A Procedural Approach》第三版** - David S. Ebert等人合著,重点介绍了纹理映射与建模方面的高级技术和方法。 3. **《Geometric Tools for Computer Graphics》** - Philip ...

    Digital Video And HDTV Algorithms And Interfaces.pdf

    Rapidly evolving computer and communications technologies have achieved data transmission rates and data storage capacities high enough for digital video. But video involves much more than just ...

    Digital Video and HD Algorithms and Interfaces, Second Edition

    根据提供的文件信息,本书《Digital Video and HD Algorithms and Interfaces, Second Edition》由Charles Poynton撰写,是一本关于数字视频及高清技术领域的专业教材。本书深入探讨了数字视频与高清视频处理中的...

    effectice_java第二版 英文

    《Effective Java》是Java编程领域的一本经典著作,由Joshua Bloch撰写,第二版针对Java 5.0及以后的版本进行了更新。这本书包含了369页的珍贵内容,旨在帮助开发者掌握编写高效、可维护和设计优良的Java代码的最佳...

    Functional Interfaces in Java.pdf

    Java是一种广泛应用于软件开发领域的编程语言,其强大的特性之一就是对接口的支持。近年来,随着函数式编程概念的普及和Java 8的发布,Java引入了“函数式接口”的概念,给Java的接口设计带来了全新的变革。函数式...

    Java Methods-Class Hierarchies and Interfaces.ppt

    在编程领域,特别是Java语言中,理解类层次结构(Class Hierarchies)和接口(Interfaces)对于实现面向对象编程(Object-Oriented Programming, OOP)至关重要。本讲义将详细介绍这些概念,并探讨如何利用它们来...

    javaee API

    javax.persistence The javax.persistence package contains the classes and interfaces that define the contracts between a persistence provider and the managed classes and the clients of the Java ...

    Java IO, NIO and NIO.2 原版pdf by Friesen

    Appendix B provides a tutorial on sockets and network interfaces. Although not directly related to classic I/O, NIO, and NIO.2, they leverage I/O capabilities and are mentioned elsewhere in this book.

    Learning Android: Develop Mobile Apps Using Java and Eclipse(第二版)

    Interfaces and Inheritance Collections Generics Threads Summary Chapter 3 The Stack Stack Overview Linux Native Layer Dalvik Application Framework Applications Summary Chapter 4 Installing and ...

    Digital Video and HDTV Algorithms and Interfaces

    ### 数字视频与高清电视算法及接口 #### 标题解析 《数字视频与高清电视算法及接口》这本书由Charles Poynton编写,并由Morgan Kaufmann出版社出版。该书聚焦于数字视频技术和高清晰度电视(HDTV)的相关算法和技术...

    Java 11 Cookbook Second Edition

    Programming (OOP) principles and design solutions, including inner classes,inheritance, composition, interfaces, enumerations, and the Java 9 changes to Javadocs. Chapter 3 Modular Programming, ...

    Learn JavaFX 8 - Building User Experience and Interfaces with Java 8

    javafx 比较好的学习资料 Learn JavaFX 8 - Building User Experience and Interfaces with Java 8 - 1st Edition (2015)

    Professional Java Native Interfaces with SWTJFace

    《Professional Java Native Interfaces with SWTJFace》这本书主要探讨了如何在Java中利用SWT(Standard Widget Toolkit)和JFace库来构建本地接口。SWT是Eclipse项目的一部分,它为Java开发者提供了一种与操作系统...

    Brownian Dynamics at Boundaries and Interfaces

    The renewed interest in Brownian dynamics is due primarily to their key role in molec- ular and cellular biophysics: diffusion of ions and molecules is the driver of all life. Brownian dynamics ...

    Java 11 Cookbook, Second Edition

    Implement object-oriented designs using classes and interfaces Manage operating system processes Create a modular application with clear dependencies Build graphical user interfaces using JavaFX ...

    JAVA核心技术卷一卷二(中文)之part2分卷

    Chapter 3 Fundamental Programming Structures in Java(新增批注共44条) Chapter 4 Objects and Classes(新增批注共55条) Chapter 5 Inheritance(新增批注共42条) Chapter 6 Interfaces and Inner Classes...

Global site tag (gtag.js) - Google Analytics