Upgrade to Pro — share decks privately, control downloads, hide ads and more …

mongo.pdf

mongodb
June 22, 2012
4.6k

 mongo.pdf

mongodb

June 22, 2012
Tweet

Transcript

  1. One reason that MongoDB is great is that our data

    store uses objects – as well as our OO programming language uses objects JSON in Mongo Shell: C# in Visual Studio:
  2. MongoDB Solves The Object-Relational Impedence Mismatch • Data Mapping •

    Normalization • Object Identity • Serialization Storing Objects as Objects Utilizing Object Hierarkies With ObjectId() As BSON
  3. EXPECTATIONS • Data Mapping • Normalization • Object Identity •

    Serialization REALITY • C#/Java objects still needs some mapping to become Mongo Objects • C#/Java objects still needs some normalization • We have not solved the identity problem • Serialization still is not easy
  4. Main Procedure • Create object instance • Store object •

    Load object SalesEmployee + Id : ObjectId + Name : String + Value : Int32 Mongo DB
  5. Main Procedure • Create object instance • Store object •

    Load object SalesEmployee + Id : ObjectId + Name : String + Value : Int32 + Save() + Load() Mongo DB Active Record I
  6. Main Procedure • Create object instance • Store object •

    Load object PersistentObject<T> + ObjectId + void Save(T obj) + T Load(ObjectId id) SalesEmployee + Name : String + Value : Int32 Mongo DB DataAccess Domain Active Record II
  7. Main Procedure • Create object instance • Store object •

    Load object Employee + Name : String + Value : Int32 Repository<T> + void Save(T obj) + T Load(ObjectId id) IRepository<T> + Load() + Save() Sales Employee Developer Mongo DB DataAccess Domain Repository Pattern PersistentObject<T> + ObjectId
  8. Main Procedure • Map Data • Create object instance •

    Store object • Load object Employee + Id : String + Name : String + Value : Int32 Repository<T> + void Save(T obj) + T Load(String id) IRepository<T> + Load() + Save() Sales Employee Developer Mongo DB DataAccess Domain Settings + SetupDatabase() DataMapping DataMapper
  9. Main Procedure • Create object instance • Store object •

    Load object Employee + Id : String + Name : String + Value : Int32 Repository<T> + void Save(T obj) + T Load(String id) Employee Repository IRepository<T> + Load() + Save() Sales Employee Developer +BestFriend : Developer Developer Repository Developer Repository Mongo DB DataAccess Domain DataMapper Pattern