H
H
HudiDudi2015-09-22 14:17:20
ORM
HudiDudi, 2015-09-22 14:17:20

What should be the ORM?

Good day to all.
I wanted to write a small project in Rust. To get acquainted with the language. Naturally, at first I decided to see what there is from ready-made libraries. I was greatly saddened by the lack of any high-level ORM. I certainly understand that the language is very young. But the five existing solutions I found were more like query builders.
In my main work, I use php and mostly work with the database through ActiveRecord. I also had a little experience with DataMaper in the form of Doctrine 2. And these ORMs allow you to work with the database without bothering at all about how the connection to the database takes place. And I was somewhat surprised by the lack of any developments in this area in Rust (at least the initial versions).
And I have a natural question. Or maybe the widespread use of ORM is only the lot of the web? Maybe it's enough to create a repository class, where to make sql queries manually and map them to the necessary structures?
Tell me, how high-level should the ORM be? Is it using pure queryBuilder without any addons? Is there anywhere to read about it? Due to the narrowness of my horizons, I cannot draw a reasonable conclusion.
The question concerns not only Rust, but also other languages.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stanislav Makarov, 2015-09-22
@HudiDudi

> And I was somewhat surprised by the lack of any developments in this area in Rust (at least the initial versions).
1) the language is in release for several months, what do you want;
2) ORM does not look natural in all languages. In C ++, there is still no normal ORM, there are some libraries based on Qt, but there is no de facto standard simply because the metadata level is not strong enough in the language. But this is not a problem, simply because applications are rarely written on the pluses where such a level is needed;
3) Or maybe the widespread use of ORM is only the lot of the web?
I would say that ORM is the lot of business applications and high-level languages ​​(Java/.NET/Ruby). Another thing is that web applications in 99% of cases are written in all sorts of asp.net and Ruby, and not in pluses, which is why there is such a correlation. There are still enough intracorporate desktop applications, and ORM is also loved there.
> Tell me, how high-level should the ORM be?
It's up to you to decide, ORMs are different, someone somewhere uses a thicker one, someone uses a thinner one. Personally, I don’t see much point in thin ones for most tasks, so for my taste the ORM must have the following things:
1) martinfowler.com/eaaCatalog/identityMap.html
2) martinfowler.com/eaaCatalog/unitOfWork.html
3) martinfowler. com/eaaCatalog/inheritanceMappers.html
In general, take a look at all the Object-Relational patterns first: martinfowler.com/eaaCatalog , otherwise you will probably write a bike park.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question