-
Notifications
You must be signed in to change notification settings - Fork 20
/
README
95 lines (80 loc) · 4.59 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
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
(see doc/XmlFormat.en.html).
* Use the code generation tool provided to produce C++ domain classes for
your tables (see doc/Tutorial1.en.html).
* 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 doc/Tutorial3.en.html);
+ modify existing objects by just assignment to objects' fields;
+ link and unlink objects to/from each other using relations
(see doc/Tutorial2.en.html);
+ 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 (http://www.hibernate.org/)
for Java, and especially by the design of SQLAlchemy
(http://www.sqlalchemy.org/) for Python.
Some details of how it works are here: doc/Internals.en.html.
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 (doc/Build.en.html).
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
(http://soci.sourceforge.net/)
* 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 (doc/SqlDriver.en.html).
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: doc/ToDo.en.html).
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 (http://code.google.com/p/tiodbc/), 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!
--
Viacheslav Naydenov
18 june 2013