Skip to Content
Javaによる関数型プログラミング ―Java 8ラムダ式とStream
book

Javaによる関数型プログラミング ―Java 8ラムダ式とStream

by Venkat Subramaniam, 株式会社プログラミングシステム社
October 2014
Intermediate to advanced
236 pages
2h 34m
Japanese
O'Reilly Japan, Inc.
Content preview from Javaによる関数型プログラミング ―Java 8ラムダ式とStream

9章すべてをまとめて

知的な馬鹿は誰でも、物事をより大きく複雑で極端なものにできる。その逆の方向に進めるにはほんの少しの才能(と大きな努力)が必要である。

――Albert Einstein

本書を通してJava 8のラムダ式を紹介しました。コレクションのイテレーションを行い、軽量でよりよい設計を実現し、コードを簡単に合成、そして並列化しました。この最終章ではまとめとして、関数型スタイルのプログラミングを使って最大の効果を上げるために磨いておくべきことを復習します。そして関数型スタイルのパフォーマンス上のインパクトについて説明し、関数型スタイルを採用して成功するための推奨事項を最後に取り上げます。

9.1 関数型スタイルで成功するために実践すべきこと

Java 8の新たな機能は、単に構文が変わるだけではありません。新機能のメリットを十分に生かし、簡潔で軽量なアプリケーションを生成するためには、設計、コーディング、そして考え方までを変えなければいけません。これまでのJavaで使ってきた命令型やオブジェクト指向のパラダイムとは違うものなのです。ここでは、根本的に変えるべきアプリケーション開発手法や、その変更によって得られる利点について説明します。

9.1.1 宣言的により近く、命令型からより遠く

抽象化のレベルを引き上げなければなりません。行うべき各ステップの命令に集中するのではなく、より大きな、達成すべきゴールを宣言的に考えて表現しなければならないのです。例えば、コンピュータにコレクションの各要素を処理するように命令する代わりに、必要な要素のみ抽出し、マップ処理を行い、それを他のコレクションに変換するように伝えるのです。こうすることで「伝えろ。聞くな。†1」という設計原則を徹底し、コードをより簡潔にし、表現力を高められます。 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

リーダーの作法 ―ささいなことをていねいに

リーダーの作法 ―ささいなことをていねいに

Michael Lopp, 和智 右桂
コンピュータビジョンのための実践機械学習 ―モデルアーキテクチャからMLOpsまで

コンピュータビジョンのための実践機械学習 ―モデルアーキテクチャからMLOpsまで

Valliappa Lakshmanan, Martin Görner, Ryan Gillard, 大山 匠, 松田 晃一

Publisher Resources

ISBN: 9784873117041Other