Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Java3.0 intro

564 views

Published on

  • Be the first to comment

Java3.0 intro

  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

×