#1 2017-04-02 14:05:54

mohsenti
Member
Registered: 2015-04-11
Posts: 72

Understanding mORMot

Hi, It is my thought in last days working with mORMot and wanted to share with you hope to get your opinion about it.

Dear ab I know you dont like to give the last answer to lazy people but Maybe it is clear for you (ab as the maker or anyone experience with the huge doc) but it is not easy to mess around with a huge doc that in the explanation will link to many places and expect you to know most of the previous doc to understand what is going on.

And the samples seem not for a newbie, they seem they added while you develop mORMot and wanted to show how it is powerful not for a new learner to learn basic unless he read the whole doc because it will link to many places like a story (and many key parts are like blog posts so it like you need to know previous back story) , you cant read a session for learning just that.

I tried to learn JSON serialization and made it work somehow with you helps but that was it can work without the other mORMot tools.

I hope you dont look at this comment as a rude one, but I read many of your posts in more than 5 years in this forum that they are explaining a task that can be very clear if there was a simple sample for it.

As an example I was trying to make a demo for JSON serialization when I learned it completely but I couldnt end it and lost in the code and couldn't get more help from you or another person.

Hope it was clear.

Last edited by mohsenti (2017-04-02 14:18:00)

Offline

#2 2017-04-02 22:37:39

warleyalex
Member
From: Sete Lagoas-MG, Brasil
Registered: 2013-01-20
Posts: 250

Re: Understanding mORMot

Let's suppose you have an iPod, it's so beautiful and easy to play with it, but it is a tight coupling player, once the battery dies you might as well buy a new iPod because the battery is soldered fixed and won't come loose, thus making replacing very expensive. A loosely coupled player would allow effortlessly changing the battery.

Would you rather spend less money just for a battery and have a working iPod again or you would prefer to spend a lot of money for a whole iPod?

It's a trade-off when you try to pick between an tight coupled framework and a loosely coupled player set of tools that work together. The latter gives you more freedom but requires you to make more architectural decisions, it also means the learning curve is high an flexibility suffers. This loosely coupled framework was designed to be highly
optimized to speed. It uses a lot of established conventions/patterns and once you are familiar enough with them, it can make you very productive.

Offline

#3 2017-04-04 13:22:29

mohsenti
Member
Registered: 2015-04-11
Posts: 72

Re: Understanding mORMot

Thank you warleyalex.

Offline

#4 2017-04-05 09:55:52

edwinsn
Member
Registered: 2010-07-02
Posts: 1,218

Re: Understanding mORMot

Trust me, you should start with:

- The samples: https://github.com/synopse/mORMot/tree/ … e3/Samples
- and this blog: https://tamingthemormot.wordpress.com


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#5 2017-04-06 10:01:48

turrican
Member
From: Barcelona
Registered: 2015-06-05
Posts: 94
Website

Re: Understanding mORMot

Hi mohsenti,

For me mORMot is a lot of fresh air for Delphi and FreePascal. mORMot is one of best projects/frameworks I seen. POO, SOA... better than Embarcadero$$$IDERA will.  A lot of Examples and well defined. Good forum community and a awesome but busy project lead (even he has time to respond posts smile)

I haven't no complaints with this framework... the source code is well commented and has a extensive documentation... You will reach everything you want with mORMot and you can extend it if you need.

Don't give up... continue learning, try again my friend.

Offline

#6 2017-04-06 17:02:09

mohsenti
Member
Registered: 2015-04-11
Posts: 72

Re: Understanding mORMot

Thanks edwinsn and turrican. Yes I know @ab made a very well framework that can do very simple to very complicated stuff easily and I aperciate it and love to have it in the Pascal world, but the problem is, it is not welcome for new comers, yes if you spend a lot of time in the doc and source you will eventually find your way and yes a complicated framework has a learning curve but for mORMot is like you are in the middle of the jungle.

Samples folder is very good but as I said it is like a showing off mORMot abilities not a path for learning it (it needs showing off, it is FAST, BIG and GOOD).

Take OmniThreadLibrary as an example, it is complicated, not as mORMot but complicated enough in a sensitive filed, threading. but did you saw the samples? if you are very new still you can find out how it works and how it can used in your projects.
I think the reason for not having such a good way for learning it is, author dont need sample and didn't made them and everyone like you @edwinsn spent a lot of time to learn it and then again dont fell the need of making learning samples either. Also another reason is when you make a sample for such big library, you need to know it well, and maybe there is not enough people know it like that much to teach it to new comers.

Even take me as an example, I worked with multiple stuff of mORMot and the best I done until know was using it's JSON serialiser and even after days I dont know much of it so I still cant make a sample for others.

Although, One can say if you want it, work for it and yes many ones do; my point is, such a brilliant tool dont need to be like a jungle of great code and doc and samples without a map.
For someone new mORMot's documentation is like a atlas not a learning book.

Offline

#7 2017-04-07 07:52:43

turrican
Member
From: Barcelona
Registered: 2015-06-05
Posts: 94
Website

Re: Understanding mORMot

No problem mohsenti wink

What is your mORMot goal? What do you need to achieve? mORMot's JSON Serializer is very easy to understand (i think) what is your problem with serializer? I can help you if you want.

Offline

#8 2017-04-07 13:40:01

mohsenti
Member
Registered: 2015-04-11
Posts: 72

Re: Understanding mORMot

Thanks turrican, you are very kind.
I got many multiple question in last few days and here are their links, if you git time to help:
In JSON Serializer:
https://synopse.info/forum/viewtopic.ph … 757#p23757
https://synopse.info/forum/viewtopic.ph … 821#p23821

And this is more for ab but he didint respond unfortunately:
https://synopse.info/forum/viewtopic.php?id=3893

And about making a client working offline:
https://synopse.info/forum/viewtopic.php?id=3910

I appreciate if you can help in any one.

Offline

#9 2017-04-09 20:47:11

George
Member
Registered: 2016-04-05
Posts: 142

Re: Understanding mORMot

Hello!
Check out this thread.
There is simple test project available, it include: ObjectToJSON, ObjectLoadJSON, JSONToObject, RegisterCustomSerializer and TObjectList / TObjectList<T> serialization / deserialization.
I'm not sure that i've done everything "by design", but almost all works (there is memory leak when json is incorrect, and field mapping not work yet for some reason).

mORMot is powerful and well optimized framework, with a lot of documentation and samples.
But samples not cover everything and may look hard to understand.
Sometimes you may think that code hard to understand, but this is cost of optimizations and FPC support.
Learning path is not easy and sometimes i can't find answers, but i prefer better performance when possible..
As alternative, you can use internal Delphi serialization.

Last edited by George (2017-04-09 21:35:05)

Offline

#10 2017-04-10 20:28:02

mohsenti
Member
Registered: 2015-04-11
Posts: 72

Re: Understanding mORMot

Thank you very much George.
It helped me.
About mORMot it is great but it lacks simple samples or doc for learning for newbies. This is no one responsibility but that makes hard for new comers adn I think one of the reasons of why mORMot users seems less that it's many abilities and much power.

Offline

Board footer

Powered by FluxBB