SlideShare uma empresa Scribd logo
1 de 38
Baixar para ler offline
@trisha_gee




The New Java Driver
Trisha Gee
Java Developer @ 10gen
Introduction
DISCLAIMER
What’s the point then?
Design Goals
Design Goals
•   Cleaner design
•   Intuitive API
•   Consistency
•   Sane Exception handling
•   Test friendly
•   Backwards compatible
And async?
Tell me about it...
Cleaner Design
Cleaner Design
Cleaner Design
Cleaner Design
Cleaner Design
Cleaner Design
Cleaner Design
Cleaner Design
Cleaner Design
Cleaner Design
Cleaner Design
So What?
Legacy Applications
Your Java Application
Morphia & ODMs
Other drivers
Wasn’t that just the first
point?
Intuitive API - Find
collection.find(query).skip(1000).limit(100);



collection.filter(query).skip(1000).limit(100).all();
Intuitive API - Remove
collection.remove(query);



collection.filter(query).remove();
Intuitive API - Find and Modify
collection.findAndModify(query, update);



collection.findAndModify(query,
               update,
               sort,
               false,
               update,
               true,
               false);



collection.filter(query)
      .sort(sort)
      .modifyAndGet(update, Get.AfterChangeApplied);
Intuitive API
public interface MongoCollection<T>
Consistency
• Aided by the clean design
• Aids the intuitive API
• Enforced by coding standards
Consistency
collection.filter(query).limit(10).all();
collection.filter(query).limit(10).remove();


collection.filter(query).sort(sortCriteria).one();
collection.filter(query).sort(sortCriteria).remove();
collection.filter(query).sort(sortCriteria).count();


Document result1 = collection.filter(query)
                .sort(sortCriteria)
                .removeAndGet();
Document result2 = collection.filter(query)
                .sort(sortCriteria)
                .modifyAndGet(update,AfterChangeApplied);
Sane Exception Handling
• Client Exceptions
• Server Exceptions
• No more parsing error Strings
Test Friendly
• Interfaces!
• Acceptance, functional and unit tests
Backwards compatible
• Very important!
And...
• Documentation
  •Self documenting code
  •Unit and Acceptance Tests
  •JavaDoc
  •Tutorials
  •Blogs
In Summary
In Summary
•   Cleaner design
•   Intuitive API
•   Consistency
•   Sane Exception handling
•   Test friendly
•   Backwards compatible
Questions?




             @trisha_gee

Mais conteúdo relacionado

Destaque

hvfd training
hvfd traininghvfd training
hvfd trainingDanmiotke
 
hvfd training
hvfd traininghvfd training
hvfd trainingDanmiotke
 
Theodor heuss gymnasiumpres2
Theodor heuss gymnasiumpres2Theodor heuss gymnasiumpres2
Theodor heuss gymnasiumpres2ramon_llull
 
Don't Write Them Off, Cast Iron Boilers Still Have a Future
Don't Write Them Off, Cast Iron Boilers Still Have a FutureDon't Write Them Off, Cast Iron Boilers Still Have a Future
Don't Write Them Off, Cast Iron Boilers Still Have a FutureBuildingMech
 
Hotel segments (Search vs Booking)
Hotel segments (Search vs Booking)Hotel segments (Search vs Booking)
Hotel segments (Search vs Booking)Turistenístico
 
Types of Expansion Tanks
Types of Expansion TanksTypes of Expansion Tanks
Types of Expansion TanksBuildingMech
 
The ella awards presentation linked in
The ella awards presentation linked inThe ella awards presentation linked in
The ella awards presentation linked inThe ELLA Awards
 
Indirect Water Heater Sizing
Indirect Water Heater SizingIndirect Water Heater Sizing
Indirect Water Heater SizingBuildingMech
 
LinkedIn edita una guía para convertir candidatos en empleados comprometidos"
LinkedIn edita una guía para convertir candidatos en empleados comprometidos"LinkedIn edita una guía para convertir candidatos en empleados comprometidos"
LinkedIn edita una guía para convertir candidatos en empleados comprometidos"Turistenístico
 
SSPMA Sump & Sewage Pump Sizing
SSPMA Sump & Sewage Pump SizingSSPMA Sump & Sewage Pump Sizing
SSPMA Sump & Sewage Pump SizingBuildingMech
 

Destaque (13)

hvfd training
hvfd traininghvfd training
hvfd training
 
Alegria
AlegriaAlegria
Alegria
 
hvfd training
hvfd traininghvfd training
hvfd training
 
Cells
CellsCells
Cells
 
The ELLA Awards
The ELLA AwardsThe ELLA Awards
The ELLA Awards
 
Theodor heuss gymnasiumpres2
Theodor heuss gymnasiumpres2Theodor heuss gymnasiumpres2
Theodor heuss gymnasiumpres2
 
Don't Write Them Off, Cast Iron Boilers Still Have a Future
Don't Write Them Off, Cast Iron Boilers Still Have a FutureDon't Write Them Off, Cast Iron Boilers Still Have a Future
Don't Write Them Off, Cast Iron Boilers Still Have a Future
 
Hotel segments (Search vs Booking)
Hotel segments (Search vs Booking)Hotel segments (Search vs Booking)
Hotel segments (Search vs Booking)
 
Types of Expansion Tanks
Types of Expansion TanksTypes of Expansion Tanks
Types of Expansion Tanks
 
The ella awards presentation linked in
The ella awards presentation linked inThe ella awards presentation linked in
The ella awards presentation linked in
 
Indirect Water Heater Sizing
Indirect Water Heater SizingIndirect Water Heater Sizing
Indirect Water Heater Sizing
 
LinkedIn edita una guía para convertir candidatos en empleados comprometidos"
LinkedIn edita una guía para convertir candidatos en empleados comprometidos"LinkedIn edita una guía para convertir candidatos en empleados comprometidos"
LinkedIn edita una guía para convertir candidatos en empleados comprometidos"
 
SSPMA Sump & Sewage Pump Sizing
SSPMA Sump & Sewage Pump SizingSSPMA Sump & Sewage Pump Sizing
SSPMA Sump & Sewage Pump Sizing
 

Semelhante a The New Java Driver

Improving the Quality of Existing Software
Improving the Quality of Existing SoftwareImproving the Quality of Existing Software
Improving the Quality of Existing SoftwareSteven Smith
 
Improving the Quality of Existing Software - DevIntersection April 2016
Improving the Quality of Existing Software - DevIntersection April 2016Improving the Quality of Existing Software - DevIntersection April 2016
Improving the Quality of Existing Software - DevIntersection April 2016Steven Smith
 
Improving the Quality of Existing Software
Improving the Quality of Existing SoftwareImproving the Quality of Existing Software
Improving the Quality of Existing SoftwareSteven Smith
 
@avanttic_meetup Oracle Technology MAD_BCN: Oracle Cloud API Platform evoluc...
@avanttic_meetup Oracle Technology MAD_BCN:  Oracle Cloud API Platform evoluc...@avanttic_meetup Oracle Technology MAD_BCN:  Oracle Cloud API Platform evoluc...
@avanttic_meetup Oracle Technology MAD_BCN: Oracle Cloud API Platform evoluc...avanttic Consultoría Tecnológica
 
Battle for Code Quality - A Story of One Java Project
Battle for Code Quality - A Story of One Java ProjectBattle for Code Quality - A Story of One Java Project
Battle for Code Quality - A Story of One Java ProjectGlobalLogic Ukraine
 
"Experiences Of Test Automation At Spotify" with Kristian Karl
"Experiences Of Test Automation At Spotify" with Kristian Karl"Experiences Of Test Automation At Spotify" with Kristian Karl
"Experiences Of Test Automation At Spotify" with Kristian KarlTEST Huddle
 
C# 8 in Libraries and Applications - BASTA! Frankfurt 2020
C# 8 in Libraries and Applications - BASTA! Frankfurt 2020C# 8 in Libraries and Applications - BASTA! Frankfurt 2020
C# 8 in Libraries and Applications - BASTA! Frankfurt 2020Christian Nagel
 
Hitchhiker's guide to Functional Testing
Hitchhiker's guide to Functional TestingHitchhiker's guide to Functional Testing
Hitchhiker's guide to Functional TestingWiebe Elsinga
 
C# 8 in Libraries and Applications
C# 8 in Libraries and ApplicationsC# 8 in Libraries and Applications
C# 8 in Libraries and ApplicationsChristian Nagel
 
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...GlobalLogic Ukraine
 
Software Uni Conf October 2014
Software Uni Conf October 2014Software Uni Conf October 2014
Software Uni Conf October 2014Nayden Gochev
 
Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spri...
Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spri...Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spri...
Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spri...Voxxed Days Thessaloniki
 
Continuous Delivery - Voxxed Days Bucharest 2017
Continuous Delivery - Voxxed Days Bucharest 2017Continuous Delivery - Voxxed Days Bucharest 2017
Continuous Delivery - Voxxed Days Bucharest 2017Rafał Leszko
 
Practices and Tools for Building Better APIs
Practices and Tools for Building Better APIsPractices and Tools for Building Better APIs
Practices and Tools for Building Better APIsPeter Hendriks
 
Functional Java 8 - Introduction
Functional Java 8 - IntroductionFunctional Java 8 - Introduction
Functional Java 8 - IntroductionŁukasz Biały
 
Automated acceptance test
Automated acceptance testAutomated acceptance test
Automated acceptance testBryan Liu
 
Introduction to Testing GraphQL Presentation
Introduction to Testing GraphQL PresentationIntroduction to Testing GraphQL Presentation
Introduction to Testing GraphQL PresentationKnoldus Inc.
 
Testing Graph QL Presentation (Test Automation)
Testing Graph QL Presentation (Test Automation)Testing Graph QL Presentation (Test Automation)
Testing Graph QL Presentation (Test Automation)Knoldus Inc.
 
Kristian Karl - Experiences of Test Automation at Spotify - EuroSTAR 2013
Kristian Karl - Experiences of Test Automation at Spotify - EuroSTAR 2013Kristian Karl - Experiences of Test Automation at Spotify - EuroSTAR 2013
Kristian Karl - Experiences of Test Automation at Spotify - EuroSTAR 2013TEST Huddle
 

Semelhante a The New Java Driver (20)

Improving the Quality of Existing Software
Improving the Quality of Existing SoftwareImproving the Quality of Existing Software
Improving the Quality of Existing Software
 
Improving the Quality of Existing Software - DevIntersection April 2016
Improving the Quality of Existing Software - DevIntersection April 2016Improving the Quality of Existing Software - DevIntersection April 2016
Improving the Quality of Existing Software - DevIntersection April 2016
 
Improving the Quality of Existing Software
Improving the Quality of Existing SoftwareImproving the Quality of Existing Software
Improving the Quality of Existing Software
 
@avanttic_meetup Oracle Technology MAD_BCN: Oracle Cloud API Platform evoluc...
@avanttic_meetup Oracle Technology MAD_BCN:  Oracle Cloud API Platform evoluc...@avanttic_meetup Oracle Technology MAD_BCN:  Oracle Cloud API Platform evoluc...
@avanttic_meetup Oracle Technology MAD_BCN: Oracle Cloud API Platform evoluc...
 
Battle for Code Quality - A Story of One Java Project
Battle for Code Quality - A Story of One Java ProjectBattle for Code Quality - A Story of One Java Project
Battle for Code Quality - A Story of One Java Project
 
"Experiences Of Test Automation At Spotify" with Kristian Karl
"Experiences Of Test Automation At Spotify" with Kristian Karl"Experiences Of Test Automation At Spotify" with Kristian Karl
"Experiences Of Test Automation At Spotify" with Kristian Karl
 
C# 8 in Libraries and Applications - BASTA! Frankfurt 2020
C# 8 in Libraries and Applications - BASTA! Frankfurt 2020C# 8 in Libraries and Applications - BASTA! Frankfurt 2020
C# 8 in Libraries and Applications - BASTA! Frankfurt 2020
 
Hitchhiker's guide to Functional Testing
Hitchhiker's guide to Functional TestingHitchhiker's guide to Functional Testing
Hitchhiker's guide to Functional Testing
 
C# 8 in Libraries and Applications
C# 8 in Libraries and ApplicationsC# 8 in Libraries and Applications
C# 8 in Libraries and Applications
 
Selenium Frameworks
Selenium FrameworksSelenium Frameworks
Selenium Frameworks
 
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...
 
Software Uni Conf October 2014
Software Uni Conf October 2014Software Uni Conf October 2014
Software Uni Conf October 2014
 
Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spri...
Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spri...Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spri...
Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spri...
 
Continuous Delivery - Voxxed Days Bucharest 2017
Continuous Delivery - Voxxed Days Bucharest 2017Continuous Delivery - Voxxed Days Bucharest 2017
Continuous Delivery - Voxxed Days Bucharest 2017
 
Practices and Tools for Building Better APIs
Practices and Tools for Building Better APIsPractices and Tools for Building Better APIs
Practices and Tools for Building Better APIs
 
Functional Java 8 - Introduction
Functional Java 8 - IntroductionFunctional Java 8 - Introduction
Functional Java 8 - Introduction
 
Automated acceptance test
Automated acceptance testAutomated acceptance test
Automated acceptance test
 
Introduction to Testing GraphQL Presentation
Introduction to Testing GraphQL PresentationIntroduction to Testing GraphQL Presentation
Introduction to Testing GraphQL Presentation
 
Testing Graph QL Presentation (Test Automation)
Testing Graph QL Presentation (Test Automation)Testing Graph QL Presentation (Test Automation)
Testing Graph QL Presentation (Test Automation)
 
Kristian Karl - Experiences of Test Automation at Spotify - EuroSTAR 2013
Kristian Karl - Experiences of Test Automation at Spotify - EuroSTAR 2013Kristian Karl - Experiences of Test Automation at Spotify - EuroSTAR 2013
Kristian Karl - Experiences of Test Automation at Spotify - EuroSTAR 2013
 

The New Java Driver