SlideShare uma empresa Scribd logo
1 de 28
Baixar para ler offline
Java SE 7,
そして Java SE 8
           Java in the Box
                 櫻庭 祐一
Agenda      History
          Java SE 7
          Java SE 8
         Conclusion
History
04                         05              06                               07                        08                       09                  10
                                                                                                  OpenJDK                           SE6u10   Sun 買収                            Plan A
                       6と7は    J2SE5.0                                       Java SE6
General                                                                                                                             リリース                                       Plan B
                       一緒に計画   リリース                                          リリース
                                                                                                        JavaFX 発表
             G.Hamiltion                                                                 M.Reinhold                                                                   M.Reinhold

                                         friend         JSR294Superpackage                                                                   Jigsaw
Modularity
             JAR の拡張                     NewPackaging   JSR277JAM                                                     JSR277Module
                                         Closure                              BGGA                    Closure            Closure                        Lambda
Parallel
                                                                              N.Gafter                                                       JSR166y
                                         NIO2                                            NIO2                       NIO2                     NIO2
                                                        JSR296SAF                        JSR296SAF                         SmallChanges      Coin
EoD                                                     JSR295BeansBinding               JSR295BeansBinding
                                                                                         JSR303BeanValidation
                                                                                         JSR308Annotation                                    JSR308Annotation
Misc         JSR121                      NewBytecode    JSR292                           JSR292                     JSR292                   JSR292
             Isolation                   XML リテラル                                        JSR310DateTime                                      JSR310DateTime
                                         BeanShell                                       BeanShell                  JMX2.0
7
                      Project Coin

            plan A    NIO.2
                      InvokeDynamic
                      Fork/Join Framework
                      Project Lambda
Mid 2012
                      Project Jigsaw




 7
           Project Coin
           NIO.2

            plan B
                                   8
           InvokeDynamic
           Fork/Join Framework
Mid 2011
                Project Lambda
                 Project Jigsaw
                                  Late 2012
7
                      Project Coin

            plan A    NIO.2
                      InvokeDynamic
                      Fork/Join Framework
                      Project Lambda
Mid 2012
                      Project Jigsaw




 7
           Project Coin
           NIO.2

            plan B
                                  8
           InvokeDynamic
           Fork/Join Framework
Mid 2011
                Project Lambda
                 Project Jigsaw
                              Late 2012
                            Mid 2013
Project Coin
         switch 文で文字列
         2 進数と区切り文字
         例外の multi catch
                  と safe rethrow
         ジェネリクスの省略記法
         try-with-resources
         簡潔な可変長引数メソッド
Project Coin                            従来の記述
InputStream in = null; OutputStream out = null;
try {
    in = new FileInputStream(src);
    out = new FileOutputStream(src);
    byte[] buf = new byte[1024]; int n;
    while((n = in.read(buf)) >= 0) out.write(buf, 0, n);
} catch (IOException ex) {
} finally {
    try {
        if (in != null) in.close();
        if (out != null) out.close();
    } catch (IOException ex) {}
}
Project Coin                   try-with-resources
try (InputStream in = new FileInputStream(src);
       OutputStream out = new FileOutputStream(src)) {
     byte[] buf = new byte[1024];
     int n;
     while((n = in.read(buf)) >= 0) {
         out.write(buf, 0, n);
     }
 } catch (IOException ex) {
     System.err.println(ex.getMessage());
 }
NIO.2
          New Filesystem API
                   非同期 I/O
SocketChannel のマルチキャスト
FileSystem fileSystem.getDefault();
Path src = fileSystem.getPath(”foo.txt”);
Path dest = fileSystem.getPath(”bar.txt”);

// ファイル操作
Files.copy(src, dest);
Files.move(src, dest);

// シンボリックリンクの生成
Path target = fileSystem.getPath(...);
Path link = fileSystem.getPath(...);
Files.createSymbolicLink(link, target);
Path startDir = fileSystem.getPath(".");
final String regex = "Test.java";

// ディレクトリツリーの探索
Files.walkFileTree(startDir,
                   new SimpleFileVisitor<Path>() {
    public FileVisitResult visitFile(Path path,
                           BasicFileAttributes attrs) {
          if (Pattern.matches(regex,
                       path.getFileName().toString()))   {
              System.out.println("File: " + path);
          }
          return FileVisitResult.CONTINUE;
      }
});
InvokeDynamic
      新しいバイトコード
       invokedynamic

  動的型付け言語のメソッドコール
bootstrap, MethodHandle, CallSite
Fork/Join Framework
  more cores, more tasks
 分割統治法 + Work Stealing
class FibonacciTask extends RecursiveTask<Integer> {
    private final Integer n;
    FibonacciTask(Integer n) { this.n = n; }

    protected Integer compute() {
        if (n <= 1) return n;
        // n-1 に対してフィボナッチ数を求める
        FibonacciTask f1 = new FibonacciTask(n - 1);
        f1.fork();
        // n-2 に対してフィボナッチ数を求める
        FibonacciTask f2 = new FibonacciTask(n - 2);
        // 処理結果を足し合せて、n のフィボナッチ数とする
        return f2.compute() + f1.join();
    }
}
7
           Project Coin
           NIO.2
           InvokeDynamic
Mid 2011   Fork/Join Framework



               Project Lambda
                Project Jigsaw    8
                                 Mid 2013
簡単にマルチタスク
     もちろん細粒度


 Internal Iteration
         +
Lambda Expression
List<Student> students = ...

double highestScore = 0.0;
for (Student s: students) {
    if (s.getGradYear() == 2011) {
        if (s.getScore() > highestScore) {
            highestScore = s.getScore();
        }
    }
}
List<Student> students = ...

double highestScore =
   students.filter(new Predicate<Student>() {
       public boolean op(Student s) {
           return s.getGradYear() == 2011;
       }
   }).map(new Mapper<Student、Double>() {
       public Double extract(Student s) {
           return s.getScore();
       }
   }).max();
List<Student> students = ...

double highestScore =
   students.filter(new Predicate<Student>() {
       public boolean op(Student s) {
           return s.getGradYear() == 2011;
       }
   }).map(new Mapper<Student、Double>() {
       public Double extract(Student s) {
           return s.getScore();
       }
                               青字の部分が冗長
   }).max();
List<Student> students = ...

double highestScore =
   students.filter(Student s -> s.getGradYear()
                                         == 2011)
           .map(Student s -> s.getScore())
           .max();
                          赤字の部分がラムダ式
List<Student> students = ...

double highestScore =
   students.filter(s -> s.getGradYear() == 2011)
           .map(s -> s.getScore())
           .max();
                               引数の型を省略可
List<Student> students = ...

double highestScore =
                          パラレルに処理
   students.parallel()
           .filter(s -> s.getGradYear() == 2011)
           .map(s -> s.getScore())
           .max();
Project Jigsaw
 Modularity = Grouping
              + Dependence
              + Versioning
              + Encapsulation
              + Optional modules
              + Module aliases
 Packaging = Module files
              + Libraries
              + Repositories
              + Native packages
ほかにも ...
 JavaFX 3.0
   Nashorn
     HotRockit
     Device Suport
     Annotation Type
     Coin 2
Beyond Java SE 8
 Iteroperability
 Cloud
 Ease of Use
 Advanced Optimization
 Works Everywhere
     & with Everything
Conclusion
いますぐ使える Java SE 7
 NIO.2, G1GC
 Java SE 7u4 java.com で配布

あと 1 年で Java SE 8
 Lambda, Jigsaw
 JavaFX, Nashorn
Java SE 7,
 そして Java SE 8


      Java in the Box
      櫻庭 祐一

Mais conteúdo relacionado

Semelhante a Java SE 7、そしてJava SE 8

JavaOne報告会 Java SE/JavaFX 編 - JJUG CCC 2010 Fall
JavaOne報告会 Java SE/JavaFX 編 - JJUG CCC 2010 FallJavaOne報告会 Java SE/JavaFX 編 - JJUG CCC 2010 Fall
JavaOne報告会 Java SE/JavaFX 編 - JJUG CCC 2010 FallYuichi Sakuraba
 
What is new and cool j2se & java
What is new and cool j2se & javaWhat is new and cool j2se & java
What is new and cool j2se & javaEugene Bogaart
 
Gf Overview For Spanish Speakers 16 October2008
Gf Overview For Spanish Speakers 16 October2008Gf Overview For Spanish Speakers 16 October2008
Gf Overview For Spanish Speakers 16 October2008Eduardo Pelegri-Llopart
 
Terence Barr - jdk7+8 - 24mai2011
Terence Barr - jdk7+8 - 24mai2011Terence Barr - jdk7+8 - 24mai2011
Terence Barr - jdk7+8 - 24mai2011Agora Group
 
BedCon 2013 - Java Persistenz-Frameworks für MongoDB
BedCon 2013 - Java Persistenz-Frameworks für MongoDBBedCon 2013 - Java Persistenz-Frameworks für MongoDB
BedCon 2013 - Java Persistenz-Frameworks für MongoDBTobias Trelle
 
Java Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBJava Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBMongoDB
 
Pure Java RAD and Scaffolding Tools Race
Pure Java RAD and Scaffolding Tools RacePure Java RAD and Scaffolding Tools Race
Pure Java RAD and Scaffolding Tools RaceBaruch Sadogursky
 
How is Java / JVM built ? Adopt OpenJDK is your answer !
How is Java / JVM built ? Adopt OpenJDK is your answer !How is Java / JVM built ? Adopt OpenJDK is your answer !
How is Java / JVM built ? Adopt OpenJDK is your answer !Mani Sarkar
 
MongoDB for Java Developers with Spring Data
MongoDB for Java Developers with Spring DataMongoDB for Java Developers with Spring Data
MongoDB for Java Developers with Spring DataChris Richardson
 
Java 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from OredevJava 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from OredevMattias Karlsson
 
Java, Up to Date
Java, Up to DateJava, Up to Date
Java, Up to Date輝 子安
 
Florian adler minute project
Florian adler   minute projectFlorian adler   minute project
Florian adler minute projectDmitry Buzdin
 
NIG系統報表開發指南
NIG系統報表開發指南NIG系統報表開發指南
NIG系統報表開發指南Guo Albert
 
What's Expected in Java 7
What's Expected in Java 7What's Expected in Java 7
What's Expected in Java 7Gal Marder
 
Java and OpenJDK: disecting the ecosystem
Java and OpenJDK: disecting the ecosystemJava and OpenJDK: disecting the ecosystem
Java and OpenJDK: disecting the ecosystemRafael Winterhalter
 
NoSQL and JavaScript: a love story
NoSQL and JavaScript: a love storyNoSQL and JavaScript: a love story
NoSQL and JavaScript: a love storyAlexandre Morgaut
 

Semelhante a Java SE 7、そしてJava SE 8 (20)

JavaOne報告会 Java SE/JavaFX 編 - JJUG CCC 2010 Fall
JavaOne報告会 Java SE/JavaFX 編 - JJUG CCC 2010 FallJavaOne報告会 Java SE/JavaFX 編 - JJUG CCC 2010 Fall
JavaOne報告会 Java SE/JavaFX 編 - JJUG CCC 2010 Fall
 
What is new and cool j2se & java
What is new and cool j2se & javaWhat is new and cool j2se & java
What is new and cool j2se & java
 
Java 8 Lambda
Java 8 LambdaJava 8 Lambda
Java 8 Lambda
 
Gf Overview For Spanish Speakers 16 October2008
Gf Overview For Spanish Speakers 16 October2008Gf Overview For Spanish Speakers 16 October2008
Gf Overview For Spanish Speakers 16 October2008
 
Terence Barr - jdk7+8 - 24mai2011
Terence Barr - jdk7+8 - 24mai2011Terence Barr - jdk7+8 - 24mai2011
Terence Barr - jdk7+8 - 24mai2011
 
BedCon 2013 - Java Persistenz-Frameworks für MongoDB
BedCon 2013 - Java Persistenz-Frameworks für MongoDBBedCon 2013 - Java Persistenz-Frameworks für MongoDB
BedCon 2013 - Java Persistenz-Frameworks für MongoDB
 
Java Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBJava Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDB
 
Pure Java RAD and Scaffolding Tools Race
Pure Java RAD and Scaffolding Tools RacePure Java RAD and Scaffolding Tools Race
Pure Java RAD and Scaffolding Tools Race
 
How is Java / JVM built ? Adopt OpenJDK is your answer !
How is Java / JVM built ? Adopt OpenJDK is your answer !How is Java / JVM built ? Adopt OpenJDK is your answer !
How is Java / JVM built ? Adopt OpenJDK is your answer !
 
MongoDB for Java Developers with Spring Data
MongoDB for Java Developers with Spring DataMongoDB for Java Developers with Spring Data
MongoDB for Java Developers with Spring Data
 
Java 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from OredevJava 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from Oredev
 
Java, Up to Date
Java, Up to DateJava, Up to Date
Java, Up to Date
 
Florian adler minute project
Florian adler   minute projectFlorian adler   minute project
Florian adler minute project
 
NIG系統報表開發指南
NIG系統報表開發指南NIG系統報表開發指南
NIG系統報表開發指南
 
Clojure And Swing
Clojure And SwingClojure And Swing
Clojure And Swing
 
What's Expected in Java 7
What's Expected in Java 7What's Expected in Java 7
What's Expected in Java 7
 
Java and OpenJDK: disecting the ecosystem
Java and OpenJDK: disecting the ecosystemJava and OpenJDK: disecting the ecosystem
Java and OpenJDK: disecting the ecosystem
 
NoSQL and JavaScript: a love story
NoSQL and JavaScript: a love storyNoSQL and JavaScript: a love story
NoSQL and JavaScript: a love story
 
Java 7: Quo vadis?
Java 7: Quo vadis?Java 7: Quo vadis?
Java 7: Quo vadis?
 
JSX Optimizer
JSX OptimizerJSX Optimizer
JSX Optimizer
 

Mais de Yuichi Sakuraba

Vector API - Javaによるベクターコンピューティング
Vector API - JavaによるベクターコンピューティングVector API - Javaによるベクターコンピューティング
Vector API - JavaによるベクターコンピューティングYuichi Sakuraba
 
Oracle Code One - Java KeynoteとJava SE
Oracle Code One - Java KeynoteとJava SEOracle Code One - Java KeynoteとJava SE
Oracle Code One - Java KeynoteとJava SEYuichi Sakuraba
 
Project Loom + Project Panama
Project Loom + Project PanamaProject Loom + Project Panama
Project Loom + Project PanamaYuichi Sakuraba
 
Project Loom - 限定継続と軽量スレッド -
Project Loom - 限定継続と軽量スレッド - Project Loom - 限定継続と軽量スレッド -
Project Loom - 限定継続と軽量スレッド - Yuichi Sakuraba
 
Oracle Code One 報告会 Java SE Update
Oracle Code One 報告会 Java SE UpdateOracle Code One 報告会 Java SE Update
Oracle Code One 報告会 Java SE UpdateYuichi Sakuraba
 
今こそStream API入門
今こそStream API入門今こそStream API入門
今こそStream API入門Yuichi Sakuraba
 
Oracle Code One 報告会 Java SE Update
Oracle Code One 報告会 Java SE UpdateOracle Code One 報告会 Java SE Update
Oracle Code One 報告会 Java SE UpdateYuichi Sakuraba
 
Learn Language 2018 Java Language Update
Learn Language 2018 Java Language Update Learn Language 2018 Java Language Update
Learn Language 2018 Java Language Update Yuichi Sakuraba
 
Dockerに向けて、Javaもダイエット
Dockerに向けて、JavaもダイエットDockerに向けて、Javaもダイエット
Dockerに向けて、JavaもダイエットYuichi Sakuraba
 
Migration Guide to Java SE 10, and also Java SE 11
Migration Guide to Java SE 10, and also Java SE 11Migration Guide to Java SE 10, and also Java SE 11
Migration Guide to Java SE 10, and also Java SE 11Yuichi Sakuraba
 
琥珀色のJava - Project Amber -
琥珀色のJava - Project Amber -琥珀色のJava - Project Amber -
琥珀色のJava - Project Amber -Yuichi Sakuraba
 
Moving to Module: Issues & Solutions
Moving to Module: Issues & SolutionsMoving to Module: Issues & Solutions
Moving to Module: Issues & SolutionsYuichi Sakuraba
 
モジュール移行の課題と対策
モジュール移行の課題と対策モジュール移行の課題と対策
モジュール移行の課題と対策Yuichi Sakuraba
 
Project Jigsawと、ちょっとだけVector API
Project Jigsawと、ちょっとだけVector APIProject Jigsawと、ちょっとだけVector API
Project Jigsawと、ちょっとだけVector APIYuichi Sakuraba
 
Java SEの現在、過去 そして未来
Java SEの現在、過去 そして未来Java SEの現在、過去 そして未来
Java SEの現在、過去 そして未来Yuichi Sakuraba
 
Introduction of Project Jigsaw
Introduction of Project JigsawIntroduction of Project Jigsaw
Introduction of Project JigsawYuichi Sakuraba
 
Encouragement of Java SE 9
Encouragement of Java SE 9Encouragement of Java SE 9
Encouragement of Java SE 9Yuichi Sakuraba
 

Mais de Yuichi Sakuraba (20)

Vector API - Javaによるベクターコンピューティング
Vector API - JavaによるベクターコンピューティングVector API - Javaによるベクターコンピューティング
Vector API - Javaによるベクターコンピューティング
 
Oracle Code One - Java KeynoteとJava SE
Oracle Code One - Java KeynoteとJava SEOracle Code One - Java KeynoteとJava SE
Oracle Code One - Java KeynoteとJava SE
 
Project Loom + Project Panama
Project Loom + Project PanamaProject Loom + Project Panama
Project Loom + Project Panama
 
Project Loom - 限定継続と軽量スレッド -
Project Loom - 限定継続と軽量スレッド - Project Loom - 限定継続と軽量スレッド -
Project Loom - 限定継続と軽量スレッド -
 
Oracle Code One 報告会 Java SE Update
Oracle Code One 報告会 Java SE UpdateOracle Code One 報告会 Java SE Update
Oracle Code One 報告会 Java SE Update
 
今こそStream API入門
今こそStream API入門今こそStream API入門
今こそStream API入門
 
Oracle Code One 報告会 Java SE Update
Oracle Code One 報告会 Java SE UpdateOracle Code One 報告会 Java SE Update
Oracle Code One 報告会 Java SE Update
 
Learn Language 2018 Java Language Update
Learn Language 2018 Java Language Update Learn Language 2018 Java Language Update
Learn Language 2018 Java Language Update
 
Dockerに向けて、Javaもダイエット
Dockerに向けて、JavaもダイエットDockerに向けて、Javaもダイエット
Dockerに向けて、Javaもダイエット
 
What's New in Java
What's New in JavaWhat's New in Java
What's New in Java
 
Migration Guide to Java SE 10, and also Java SE 11
Migration Guide to Java SE 10, and also Java SE 11Migration Guide to Java SE 10, and also Java SE 11
Migration Guide to Java SE 10, and also Java SE 11
 
琥珀色のJava - Project Amber -
琥珀色のJava - Project Amber -琥珀色のJava - Project Amber -
琥珀色のJava - Project Amber -
 
Moving to Module: Issues & Solutions
Moving to Module: Issues & SolutionsMoving to Module: Issues & Solutions
Moving to Module: Issues & Solutions
 
モジュール移行の課題と対策
モジュール移行の課題と対策モジュール移行の課題と対策
モジュール移行の課題と対策
 
Project Jigsawと、ちょっとだけVector API
Project Jigsawと、ちょっとだけVector APIProject Jigsawと、ちょっとだけVector API
Project Jigsawと、ちょっとだけVector API
 
Java SE 9の全貌
Java SE 9の全貌Java SE 9の全貌
Java SE 9の全貌
 
Java SEの現在、過去 そして未来
Java SEの現在、過去 そして未来Java SEの現在、過去 そして未来
Java SEの現在、過去 そして未来
 
Java SE 9 のススメ
Java SE 9 のススメJava SE 9 のススメ
Java SE 9 のススメ
 
Introduction of Project Jigsaw
Introduction of Project JigsawIntroduction of Project Jigsaw
Introduction of Project Jigsaw
 
Encouragement of Java SE 9
Encouragement of Java SE 9Encouragement of Java SE 9
Encouragement of Java SE 9
 

Último

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 

Último (20)

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 

Java SE 7、そしてJava SE 8

  • 1. Java SE 7, そして Java SE 8 Java in the Box 櫻庭 祐一
  • 2. Agenda History Java SE 7 Java SE 8 Conclusion
  • 4. 04 05 06 07 08 09 10 OpenJDK SE6u10 Sun 買収 Plan A 6と7は J2SE5.0 Java SE6 General リリース Plan B 一緒に計画 リリース リリース JavaFX 発表 G.Hamiltion M.Reinhold M.Reinhold friend JSR294Superpackage Jigsaw Modularity JAR の拡張 NewPackaging JSR277JAM JSR277Module Closure BGGA Closure Closure Lambda Parallel N.Gafter JSR166y NIO2 NIO2 NIO2 NIO2 JSR296SAF JSR296SAF SmallChanges Coin EoD JSR295BeansBinding JSR295BeansBinding JSR303BeanValidation JSR308Annotation JSR308Annotation Misc JSR121 NewBytecode JSR292 JSR292 JSR292 JSR292 Isolation XML リテラル JSR310DateTime JSR310DateTime BeanShell BeanShell JMX2.0
  • 5. 7 Project Coin plan A NIO.2 InvokeDynamic Fork/Join Framework Project Lambda Mid 2012 Project Jigsaw 7 Project Coin NIO.2 plan B 8 InvokeDynamic Fork/Join Framework Mid 2011 Project Lambda Project Jigsaw Late 2012
  • 6. 7 Project Coin plan A NIO.2 InvokeDynamic Fork/Join Framework Project Lambda Mid 2012 Project Jigsaw 7 Project Coin NIO.2 plan B 8 InvokeDynamic Fork/Join Framework Mid 2011 Project Lambda Project Jigsaw Late 2012 Mid 2013
  • 7. Project Coin switch 文で文字列 2 進数と区切り文字 例外の multi catch と safe rethrow ジェネリクスの省略記法 try-with-resources 簡潔な可変長引数メソッド
  • 8. Project Coin 従来の記述 InputStream in = null; OutputStream out = null; try { in = new FileInputStream(src); out = new FileOutputStream(src); byte[] buf = new byte[1024]; int n; while((n = in.read(buf)) >= 0) out.write(buf, 0, n); } catch (IOException ex) { } finally { try { if (in != null) in.close(); if (out != null) out.close(); } catch (IOException ex) {} }
  • 9. Project Coin try-with-resources try (InputStream in = new FileInputStream(src); OutputStream out = new FileOutputStream(src)) { byte[] buf = new byte[1024]; int n; while((n = in.read(buf)) >= 0) { out.write(buf, 0, n); } } catch (IOException ex) { System.err.println(ex.getMessage()); }
  • 10. NIO.2 New Filesystem API 非同期 I/O SocketChannel のマルチキャスト
  • 11. FileSystem fileSystem.getDefault(); Path src = fileSystem.getPath(”foo.txt”); Path dest = fileSystem.getPath(”bar.txt”); // ファイル操作 Files.copy(src, dest); Files.move(src, dest); // シンボリックリンクの生成 Path target = fileSystem.getPath(...); Path link = fileSystem.getPath(...); Files.createSymbolicLink(link, target);
  • 12. Path startDir = fileSystem.getPath("."); final String regex = "Test.java"; // ディレクトリツリーの探索 Files.walkFileTree(startDir, new SimpleFileVisitor<Path>() { public FileVisitResult visitFile(Path path, BasicFileAttributes attrs) { if (Pattern.matches(regex, path.getFileName().toString())) { System.out.println("File: " + path); } return FileVisitResult.CONTINUE; } });
  • 13. InvokeDynamic 新しいバイトコード invokedynamic 動的型付け言語のメソッドコール bootstrap, MethodHandle, CallSite
  • 14. Fork/Join Framework more cores, more tasks 分割統治法 + Work Stealing
  • 15. class FibonacciTask extends RecursiveTask<Integer> { private final Integer n; FibonacciTask(Integer n) { this.n = n; } protected Integer compute() { if (n <= 1) return n; // n-1 に対してフィボナッチ数を求める FibonacciTask f1 = new FibonacciTask(n - 1); f1.fork(); // n-2 に対してフィボナッチ数を求める FibonacciTask f2 = new FibonacciTask(n - 2); // 処理結果を足し合せて、n のフィボナッチ数とする return f2.compute() + f1.join(); } }
  • 16. 7 Project Coin NIO.2 InvokeDynamic Mid 2011 Fork/Join Framework Project Lambda Project Jigsaw 8 Mid 2013
  • 17. 簡単にマルチタスク もちろん細粒度 Internal Iteration + Lambda Expression
  • 18. List<Student> students = ... double highestScore = 0.0; for (Student s: students) { if (s.getGradYear() == 2011) { if (s.getScore() > highestScore) { highestScore = s.getScore(); } } }
  • 19. List<Student> students = ... double highestScore = students.filter(new Predicate<Student>() { public boolean op(Student s) { return s.getGradYear() == 2011; } }).map(new Mapper<Student、Double>() { public Double extract(Student s) { return s.getScore(); } }).max();
  • 20. List<Student> students = ... double highestScore = students.filter(new Predicate<Student>() { public boolean op(Student s) { return s.getGradYear() == 2011; } }).map(new Mapper<Student、Double>() { public Double extract(Student s) { return s.getScore(); } 青字の部分が冗長 }).max();
  • 21. List<Student> students = ... double highestScore = students.filter(Student s -> s.getGradYear() == 2011) .map(Student s -> s.getScore()) .max(); 赤字の部分がラムダ式
  • 22. List<Student> students = ... double highestScore = students.filter(s -> s.getGradYear() == 2011) .map(s -> s.getScore()) .max(); 引数の型を省略可
  • 23. List<Student> students = ... double highestScore = パラレルに処理 students.parallel() .filter(s -> s.getGradYear() == 2011) .map(s -> s.getScore()) .max();
  • 24. Project Jigsaw Modularity = Grouping + Dependence + Versioning + Encapsulation + Optional modules + Module aliases Packaging = Module files + Libraries + Repositories + Native packages
  • 25. ほかにも ... JavaFX 3.0 Nashorn HotRockit Device Suport Annotation Type Coin 2
  • 26. Beyond Java SE 8 Iteroperability Cloud Ease of Use Advanced Optimization Works Everywhere & with Everything
  • 27. Conclusion いますぐ使える Java SE 7 NIO.2, G1GC Java SE 7u4 java.com で配布 あと 1 年で Java SE 8 Lambda, Jigsaw JavaFX, Nashorn
  • 28. Java SE 7, そして Java SE 8 Java in the Box 櫻庭 祐一