FunctionalJ是一个在java语言中提供Functional Programming功能的library,最早发布版本为0.7,这次的0.8版本较之于0.7版本有很大的差别,API重构程度很大,几乎可以用“面目全非”来形容,不过,较之于前版本,这次发布的一个亮点是文档很全面,而且改进后的API也不能说比原来的差,不过,一个类库的发布应该考虑接口的兼容性问题,而这一点上FunctionJ做得不是太好。
以下是FunctionJ0.8发布的信息:
以下是FunctionJ0.8发布的信息:
FunctionalJ provides the following features:
- Easily represent functions as objects
- Code using functional programming concepts such as mapping, filtering,
and folding - Use parameter binding, also known as partial application
- Write methods that accept functions as parameters and/or return
functions as a result (higher-order functions) - Replace procedural code with functional code for simpler, less
error-prone computations - Define functions by implementing an interface, subclassing a base class,
or with a reflection mechanism, according to your preference - Use a reflection mechanism to easily create functions that refer to
existing constructors, instance methods, or static methods - No need to deal with exceptions if you don’t want to.
Summary of what is new in version 0.8:
- Major refactoring from version 0.7 to improve the API and provide
stronger typing - Now available in two versions, JDK 1.4 version and new JDK 1.5 version
that uses generic types and other 1.5 features - Pluggable reflection mechanisms
- Two reflection mechanism implementations: one that uses the standard JDK
and one that uses cglib - Improved documentation.