SlideShare ist ein Scribd-Unternehmen logo
1 von 24
Guava
Google’s Core Libraries for java



                작성일       2011-09-25
                작성자    커뮤니티개발1팀 정희경
Contents

   Guava Overview
   Guava vs Apache Commons
   Guava Library & Examples
   Guava Pros & Cons
Guava Overview
 Google’s core Java libraries for Java 5+
 The Apache Software License, Version 2.0
 Similar to Apache Commons
 Extension of the Java Collections Framework
 Google Collection
Guava vs Apache Commons
 Generics
   Guava targets Java 5 - Greatly benefits from the
   Java 5 features: generics, enums, autoboxing ..
Guava vs Apache Commons
 Consistency with Collections framework
 Correctness – don’t need to test
 Guava has only one code dependency -
 javax.annotation
Guava Library & Examples
 The Guava Packages
Guava Library & Examples
 com.google.common.base
  common code used by other package
Guava Library & Examples
 com.google.common.base.Preconditions
  Validation checks before execution
Guava Library & Examples
 com.google.common.base.Preconditions
   Validation checks before execution
     Additional exception types




   Better handling of message arguments
     In Apache Commons

     In Guava



   Easy assignment after not null check
     In Apache Commons



     In Guava
Guava Library & Examples
 com.google.common.base.Joiner
Guava Library & Examples
 com.google.common.base.Splitter
Guava Library & Examples
 com.google.common.base.Objects
  Makes it easy to implement hashcode/ equals
Guava Library & Examples
 com.google.common.io.Files
  for working with Java I/O Collection.

                                 java.io.File




                      org.apache.commons.io.FileUtils
Guava Library & Examples
 com.google.common.io.Files
  for working with Java I/O Collection.



                        com.google.common.io.Files




                                            Result
Guava Library & Examples
 com.google.common.io.Files
Guava Library & Examples
 com.google.common.collect
  Contains generic collection interfaces and impleme
   ntations, other utilities for working with collections
  Collection Types
    BiMap
    Multiset
    Mutimap
    ListMultimap
    SetMultimap
    SortedSetMultimap
    Table
    ClassToInstanceMap
Guava Library & Examples
 com.google.common.collect
Guava Library & Examples
 com.google.common.collect.Multimaps
  allow multiple values to be stored for every key
Guava Library & Examples
 com.google.common.collect.BiMap
  one-to-one bidirectional relationship between key
   and value of the Map
Guava Library & Examples
 com.google.common.collect.Constraints
   Similar to preconditions in a way that they can restri
   ct what values are added to a collection
Guava Pros & Cons
 Guava targets Java 5 - Greatly benefits from the
  Java 5 features: generics
 Guava is very well designed / documented
   The code is useful patterns to make the API more
   readable, secure, thread-safe..
 Functional programming support
Guava Pros & Cons
 It's not a sufficient replacement for Apache
 Commons, in particular commons-codec

 If you're in an environment requiring Java 1.3 or
 1.4, you're out of luck.
Q&A
감사합니다 

Weitere ähnliche Inhalte

Ähnlich wie Google's Java Core Libraries Guide

Preview of Groovy 3
Preview of Groovy 3Preview of Groovy 3
Preview of Groovy 3Vijay Shukla
 
Graph ql subscriptions through the looking glass
Graph ql subscriptions through the looking glassGraph ql subscriptions through the looking glass
Graph ql subscriptions through the looking glassGerard Klijs
 
Top 10 Libraries of Java.pptx
Top 10 Libraries of Java.pptxTop 10 Libraries of Java.pptx
Top 10 Libraries of Java.pptxSudhanshiBakre1
 
How we took our server side application to the cloud and liked what we got
How we took our server side application to the cloud and liked what we gotHow we took our server side application to the cloud and liked what we got
How we took our server side application to the cloud and liked what we gotBaruch Sadogursky
 
An Introduction to Maven
An Introduction to MavenAn Introduction to Maven
An Introduction to MavenVadym Lotar
 
Graph ql subscriptions on the jvm
Graph ql subscriptions on the jvmGraph ql subscriptions on the jvm
Graph ql subscriptions on the jvmGerard Klijs
 
On HBase Integration Testing
On HBase Integration TestingOn HBase Integration Testing
On HBase Integration TestingAndrewPurtell
 
Testing Java Web Apps With Selenium
Testing Java Web Apps With SeleniumTesting Java Web Apps With Selenium
Testing Java Web Apps With SeleniumMarakana Inc.
 
Apache maven and its impact on java 9 (Java One 2017)
Apache maven and its impact on java 9 (Java One 2017)Apache maven and its impact on java 9 (Java One 2017)
Apache maven and its impact on java 9 (Java One 2017)Robert Scholte
 
Follow these reasons to know java’s importance
Follow these reasons to know java’s importanceFollow these reasons to know java’s importance
Follow these reasons to know java’s importancenishajj
 
Essential Java Libraries Every Developer Should Know About
Essential Java Libraries Every Developer Should Know AboutEssential Java Libraries Every Developer Should Know About
Essential Java Libraries Every Developer Should Know AboutInexture Solutions
 
Selenium-Browser-Based-Automated-Testing-for-Grails-Apps
Selenium-Browser-Based-Automated-Testing-for-Grails-AppsSelenium-Browser-Based-Automated-Testing-for-Grails-Apps
Selenium-Browser-Based-Automated-Testing-for-Grails-Appschrisb206 chrisb206
 
Introduction of Java 8 with emphasis on Lambda Expressions and Streams
Introduction of Java 8 with emphasis on Lambda Expressions and StreamsIntroduction of Java 8 with emphasis on Lambda Expressions and Streams
Introduction of Java 8 with emphasis on Lambda Expressions and StreamsEmiel Paasschens
 
Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...
Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...
Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...Vadym Kazulkin
 
C++ vs Java: Which one is the best?
C++ vs Java: Which one is the best?C++ vs Java: Which one is the best?
C++ vs Java: Which one is the best?calltutors
 

Ähnlich wie Google's Java Core Libraries Guide (20)

Preview of Groovy 3
Preview of Groovy 3Preview of Groovy 3
Preview of Groovy 3
 
Graph ql subscriptions through the looking glass
Graph ql subscriptions through the looking glassGraph ql subscriptions through the looking glass
Graph ql subscriptions through the looking glass
 
Java 8 Overview
Java 8 OverviewJava 8 Overview
Java 8 Overview
 
Top 10 Libraries of Java.pptx
Top 10 Libraries of Java.pptxTop 10 Libraries of Java.pptx
Top 10 Libraries of Java.pptx
 
How we took our server side application to the cloud and liked what we got
How we took our server side application to the cloud and liked what we gotHow we took our server side application to the cloud and liked what we got
How we took our server side application to the cloud and liked what we got
 
An Introduction to Maven
An Introduction to MavenAn Introduction to Maven
An Introduction to Maven
 
Graph ql subscriptions on the jvm
Graph ql subscriptions on the jvmGraph ql subscriptions on the jvm
Graph ql subscriptions on the jvm
 
On HBase Integration Testing
On HBase Integration TestingOn HBase Integration Testing
On HBase Integration Testing
 
Testing Java Web Apps With Selenium
Testing Java Web Apps With SeleniumTesting Java Web Apps With Selenium
Testing Java Web Apps With Selenium
 
perl-java
perl-javaperl-java
perl-java
 
perl-java
perl-javaperl-java
perl-java
 
Maven Introduction
Maven IntroductionMaven Introduction
Maven Introduction
 
Apache maven and its impact on java 9 (Java One 2017)
Apache maven and its impact on java 9 (Java One 2017)Apache maven and its impact on java 9 (Java One 2017)
Apache maven and its impact on java 9 (Java One 2017)
 
Follow these reasons to know java’s importance
Follow these reasons to know java’s importanceFollow these reasons to know java’s importance
Follow these reasons to know java’s importance
 
Essential Java Libraries Every Developer Should Know About
Essential Java Libraries Every Developer Should Know AboutEssential Java Libraries Every Developer Should Know About
Essential Java Libraries Every Developer Should Know About
 
Selenium-Browser-Based-Automated-Testing-for-Grails-Apps
Selenium-Browser-Based-Automated-Testing-for-Grails-AppsSelenium-Browser-Based-Automated-Testing-for-Grails-Apps
Selenium-Browser-Based-Automated-Testing-for-Grails-Apps
 
Empire: JPA for RDF & SPARQL
Empire: JPA for RDF & SPARQLEmpire: JPA for RDF & SPARQL
Empire: JPA for RDF & SPARQL
 
Introduction of Java 8 with emphasis on Lambda Expressions and Streams
Introduction of Java 8 with emphasis on Lambda Expressions and StreamsIntroduction of Java 8 with emphasis on Lambda Expressions and Streams
Introduction of Java 8 with emphasis on Lambda Expressions and Streams
 
Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...
Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...
Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...
 
C++ vs Java: Which one is the best?
C++ vs Java: Which one is the best?C++ vs Java: Which one is the best?
C++ vs Java: Which one is the best?
 

Kürzlich hochgeladen

Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 

Kürzlich hochgeladen (20)

Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 

Google's Java Core Libraries Guide

  • 1. Guava Google’s Core Libraries for java 작성일 2011-09-25 작성자 커뮤니티개발1팀 정희경
  • 2. Contents  Guava Overview  Guava vs Apache Commons  Guava Library & Examples  Guava Pros & Cons
  • 3. Guava Overview  Google’s core Java libraries for Java 5+  The Apache Software License, Version 2.0  Similar to Apache Commons  Extension of the Java Collections Framework  Google Collection
  • 4. Guava vs Apache Commons  Generics  Guava targets Java 5 - Greatly benefits from the Java 5 features: generics, enums, autoboxing ..
  • 5. Guava vs Apache Commons  Consistency with Collections framework  Correctness – don’t need to test  Guava has only one code dependency - javax.annotation
  • 6. Guava Library & Examples  The Guava Packages
  • 7. Guava Library & Examples  com.google.common.base  common code used by other package
  • 8. Guava Library & Examples  com.google.common.base.Preconditions  Validation checks before execution
  • 9. Guava Library & Examples  com.google.common.base.Preconditions  Validation checks before execution  Additional exception types  Better handling of message arguments  In Apache Commons  In Guava  Easy assignment after not null check  In Apache Commons  In Guava
  • 10. Guava Library & Examples  com.google.common.base.Joiner
  • 11. Guava Library & Examples  com.google.common.base.Splitter
  • 12. Guava Library & Examples  com.google.common.base.Objects  Makes it easy to implement hashcode/ equals
  • 13. Guava Library & Examples  com.google.common.io.Files  for working with Java I/O Collection. java.io.File org.apache.commons.io.FileUtils
  • 14. Guava Library & Examples  com.google.common.io.Files  for working with Java I/O Collection. com.google.common.io.Files Result
  • 15. Guava Library & Examples  com.google.common.io.Files
  • 16. Guava Library & Examples  com.google.common.collect  Contains generic collection interfaces and impleme ntations, other utilities for working with collections  Collection Types  BiMap  Multiset  Mutimap  ListMultimap  SetMultimap  SortedSetMultimap  Table  ClassToInstanceMap
  • 17. Guava Library & Examples  com.google.common.collect
  • 18. Guava Library & Examples  com.google.common.collect.Multimaps  allow multiple values to be stored for every key
  • 19. Guava Library & Examples  com.google.common.collect.BiMap  one-to-one bidirectional relationship between key and value of the Map
  • 20. Guava Library & Examples  com.google.common.collect.Constraints  Similar to preconditions in a way that they can restri ct what values are added to a collection
  • 21. Guava Pros & Cons  Guava targets Java 5 - Greatly benefits from the Java 5 features: generics  Guava is very well designed / documented  The code is useful patterns to make the API more readable, secure, thread-safe..  Functional programming support
  • 22. Guava Pros & Cons  It's not a sufficient replacement for Apache Commons, in particular commons-codec  If you're in an environment requiring Java 1.3 or 1.4, you're out of luck.
  • 23. Q&A