Functional Design
摘要
Object-oriented design offers valuable principles and techniques for structuring data and computation. However, alternative ways to structure software can also be leveraged when designing applications. This chapter provides an introduction to a style of design that uses the function as its primary building block. With functional-style design, structuring the code is achieved through the use of higher-order functions, that is, functions that take other functions as argument. To use higher-order functions requires the programming language to provide support for functions as a first-class program entity. This chapter provides an overview of the Java mechanisms that support functional-style programming and how to use them to integrate elements of functional style into the design of an overall application.