Giter VIP home page Giter VIP logo

yb-orm's Introduction

Coverity Scan Build Status

ABOUT

YB.ORM tool is developed to simplify for C++ developers creation of applications that work with relational databases. An Object-Relational Mapper (ORM) works by mapping database tables to classes and table records to objects in some programming language. This approach may be not optimal for each and every database application, but it proved to be reasonable in applications that require complex logic and transaction handling. The goals of YB.ORM project are: provide a convenient API for C++ developers, retain high performance of C++, keep the source code easily portable across different platforms, support most major relational DataBase Management Systems (DBMS).

Typical usage scenario is the following:

  • Describe your database schema i.e. tables with their columns and relationships between tables in simple XML-based format.
  • Use the code generation tool provided to produce C++ domain classes for your tables (see Tutorial1).
  • Add your application-specific logic to the classes.
  • Should you make changes to the database schema, you then use the code generation tool to synchronize previously generated C++ classes with the schema.
  • Optionally, use the code generation tool to issue SQL statements to populate your empty database schema with tables.
  • Now you can use the domain classes in cooperation with Session object to automate the following tasks:
    • create new objects or delete existing objects;
    • query objects from database, using object-based queries (see Tutorial3);
    • modify existing objects by just assignment to objects' fields;
    • link and unlink objects to/from each other using relations (see Tutorial2);
    • serialize your objects into XML and JSON.

This tool employs many ideas explained in the book "Patterns of Enterprise Application Architecture" by Martin Fowler. Such patterns as "Lazy Load", "Identity Map", "Unit of Work", etc. Also, the project development was inspired by the power of Hibernate framework for Java, and especially by the design of SQLAlchemy for Python. Some details of how it works are here: Internals.

STATUS

At the moment, YB.ORM tool works in Linux, Mac OS X and Windows. It can be built using the following compilers: GCC, CLang, MinGW, MSVC 2008/2010, also Borland C++ Builder, see Building Instructions.

You can build YB.ORM library against your toolkit of choice: Boost, Qt, or wxWidgets; their native data types will be used for strings, date and time, threads, XML parsing, etc.

The tool was tested to work with the following SQL databases: MySQL, Oracle, SQLite, Firebird, Postgres. To connect to a database you have these options:

  • ODBC drivers
  • popular database connectivity C++ library SOCI
  • database drivers for Qt library: QtSql
  • there is native driver for SQLite. Optionally, use connection pooling the library provides. Look here for details: Connecting to database.

The basic functionality of YB.ORM was tested on several little projects, and proved to be usable. Keep in mind, that the tool is under development and its API may change between releases. Some interesting features are still to be implemented (see ToDo list).

AUTHORS

Project has started in late 2006 as a part of billing system for on-line ads at Yandex company (http://www.yandex.com/) by Viacheslav Naydenov (me) and Sergey Chmelev. "YB" used to stand for Yandex.Balance, the name for the billing system. Today YB.ORM project is not affiliated with Yandex company. The source code was released in early 2011 under open source license, since then the code has been mostly rewritten. Thanks to the author of tiny odbc wrapper, whose code is used as a base for the first usable SQL driver (OdbcDriver class). Also, I would like to mention the feedback and contribution from several students of Moscow State Open University (MSOU), where I was using this piece of software as a case study. The list of contributors:

  • Viacheslav Naydenov, vaclav at yandex dot ru - main developer
  • Sergey Chmelev, halty at yandex dash team dot ru - early contributor
  • SqUe, squarious at gmail dot com - tiodbc code
  • Nikita Buyvich, buyvich at gmail dot com - MSOU
  • Viacheslav Fedorov, funny dash story at yandex dot ru - MSOU
  • Andrey Skobenkov, andrey dot skobenkov at gmail dot com - MSOU

Any feedback, patches or comments are welcome!

yb-orm's People

Contributors

askobenkov avatar hlyustov-pm avatar ivaneko avatar ivanekom avatar kibeththewalker avatar lamsam avatar lobachevvaleriy avatar oganova avatar rwiths avatar sleepplease avatar teotwaki avatar vnaydionov avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.