@trisha_geeThe New Java DriverTrisha GeeJava Developer @ 10gen
Introduction
DISCLAIMER
What’s the point then?
Design Goals
Design Goals•   Cleaner design•   Intuitive API•   Consistency•   Sane Exception handling•   Test friendly•   Backwards co...
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 firstpoint?
Intuitive API - Findcollection.find(query).skip(1000).limit(100);collection.filter(query).skip(1000).limit(100).all();
Intuitive API - Removecollection.remove(query);collection.filter(query).remove();
Intuitive API - Find and Modifycollection.findAndModify(query, update);collection.findAndModify(query,               updat...
Intuitive APIpublic interface MongoCollection<T>
Consistency• Aided by the clean design• Aids the intuitive API• Enforced by coding standards
Consistencycollection.filter(query).limit(10).all();collection.filter(query).limit(10).remove();collection.filter(query).s...
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 comp...
Questions?             @trisha_gee
Upcoming SlideShare
Loading in …5
×

The New Java Driver

0 views
119 views

Published on

Trisha Gee gives a rough guide to the new java driver for MongoDB

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
0
On SlideShare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

The New Java Driver

  1. 1. @trisha_geeThe New Java DriverTrisha GeeJava Developer @ 10gen
  2. 2. Introduction
  3. 3. DISCLAIMER
  4. 4. What’s the point then?
  5. 5. Design Goals
  6. 6. Design Goals• Cleaner design• Intuitive API• Consistency• Sane Exception handling• Test friendly• Backwards compatible
  7. 7. And async?
  8. 8. Tell me about it...
  9. 9. Cleaner Design
  10. 10. Cleaner Design
  11. 11. Cleaner Design
  12. 12. Cleaner Design
  13. 13. Cleaner Design
  14. 14. Cleaner Design
  15. 15. Cleaner Design
  16. 16. Cleaner Design
  17. 17. Cleaner Design
  18. 18. Cleaner Design
  19. 19. Cleaner Design
  20. 20. So What?
  21. 21. Legacy Applications
  22. 22. Your Java Application
  23. 23. Morphia & ODMs
  24. 24. Other drivers
  25. 25. Wasn’t that just the firstpoint?
  26. 26. Intuitive API - Findcollection.find(query).skip(1000).limit(100);collection.filter(query).skip(1000).limit(100).all();
  27. 27. Intuitive API - Removecollection.remove(query);collection.filter(query).remove();
  28. 28. Intuitive API - Find and Modifycollection.findAndModify(query, update);collection.findAndModify(query, update, sort, false, update, true, false);collection.filter(query) .sort(sort) .modifyAndGet(update, Get.AfterChangeApplied);
  29. 29. Intuitive APIpublic interface MongoCollection<T>
  30. 30. Consistency• Aided by the clean design• Aids the intuitive API• Enforced by coding standards
  31. 31. Consistencycollection.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);
  32. 32. Sane Exception Handling• Client Exceptions• Server Exceptions• No more parsing error Strings
  33. 33. Test Friendly• Interfaces!• Acceptance, functional and unit tests
  34. 34. Backwards compatible• Very important!
  35. 35. And...• Documentation •Self documenting code •Unit and Acceptance Tests •JavaDoc •Tutorials •Blogs
  36. 36. In Summary
  37. 37. In Summary• Cleaner design• Intuitive API• Consistency• Sane Exception handling• Test friendly• Backwards compatible
  38. 38. Questions? @trisha_gee

×