OODB

1,808 views

Published on

A proposal to my students motivating them to extend their horizon by using object oriented databases.

Published in: Education, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

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

No notes for slide
  • OODB

    1. 1. OODB Object-Oriented Databases
    2. 2. First Things First
    3. 3. First Things First Free your Mind!
    4. 4. First Things First Free your Mind!
    5. 5. What is a Database System?
    6. 6. What is a Database System? Efficient Data Storage
    7. 7. What is a Database System? Efficient Data Storage One or more files
    8. 8. What is a Database System? Efficient Data Storage One or more files Ruleset / Structure
    9. 9. What is a Database System? Efficient Data Storage One or more files DBMS DBS Ruleset / Structure Database
    10. 10. What is a Database System? Application Efficient Data Storage One or more files DBMS DBS Ruleset / Structure Database
    11. 11. Basic Types of Databases
    12. 12. Basic Types of Databases Relational Hierarchical Network Object-Oriented
    13. 13. Basic Types of Databases Relational Object-Oriented
    14. 14. What is a Relational DB?
    15. 15. What is a Relational DB? De-facto Standard
    16. 16. What is a Relational DB? De-facto Standard Table-based
    17. 17. What is a Relational DB? De-facto Standard Table-based Relation between Tables
    18. 18. What is a Relational DB? De-facto Standard Table-based Relation between Tables Stores primitive Types
    19. 19. What is a Relational DB? De-facto Standard Table-based Relation between Tables Stores primitive Types Access through SQL (Structured Query Language)
    20. 20. An RDB Example
    21. 21. An RDB Example ISBN BOOK 1 Kamasutra 2 The Bible 3 Hamlet
    22. 22. An RDB Example ISBN BOOK ISBN AUTHOR 1 Kamasutra 1 R. F. Burton 2 The Bible 2 God 3 Hamlet 3 Shakespeare
    23. 23. An RDB Example ISBN BOOK ISBN AUTHOR 1 Kamasutra 1 R. F. Burton 2 The Bible 2 God 3 Hamlet 3 Shakespeare ISBN BOOK AUTHOR 1 Kamasutra R. F. Burton 2 The Bible God 3 Hamlet Shakespeare
    24. 24. What is an Object-Oriented DB?
    25. 25. What is an Object-Oriented DB?
    26. 26. What is an Object-Oriented DB? Object-based
    27. 27. What is an Object-Oriented DB? Object-based Relations through Objects
    28. 28. What is an Object-Oriented DB? Object-based Relations through Objects Database stores complex Objects
    29. 29. What is an Object-Oriented DB? Object-based Relations through Objects Database stores complex Objects Access through high-level Language
    30. 30. An OODB Example
    31. 31. An OODB Example ra Kamasut The Bible o n R. F. Burt 1 God 2 Hamlet re Shakespea 3
    32. 32. From DB to the App RDB OODB
    33. 33. From DB to the App RDB OODB SELECT * FROM table Primitive Types Object
    34. 34. From DB to the App RDB OODB SELECT * FROM table Primitive Types Object Object
    35. 35. OODB Sourcecode ObjectContainer oodb = Db4o.openFile("test.oodb"); User chris = new User("Chris"); oodb.store(chris); oodb.store(new User("Christian")); List<User> users = oodb.query(User.class); for (User u : users) { System.out.println(u); } System.out.println(users.get(0).equals(chris)); users = oodb.query(new Predicate<User>() { public boolean match(User user) { return user.getName().contains("Christi"); } }); for (User u : users) { System.out.println(u); } oodb.close();
    36. 36. RDB Sourcecode Class.forName("org.gjt.mm.mysql.Driver").newInstance(); Connection con = DriverManager.getConnection("jdbc:mysql://192.168.1.135:3306/foo", "root", "user"); User chris = new User("Chris") con.createStatement().executeQuery("INSERT INTO Users VALUES ("", " + chris.getName() + "); con.createStatement().executeQuery("INSERT INTO Users VALUES ("", " + new User("Chris").getName() + "); ResultSet users = con.createStatement().executeQuery("SELECT * FROM User"); while (users.next()) { User user = new User(users.getInt("id"), user.getString("name")); if (user.getName().equals(chris.getName()) { System.out.println(user.equals(chris)); // false } } con.close();
    37. 37. What Do You Think?

    ×