I'd like your opinion about Object Persistence Frameworks :

I'd like your opinion about Object Persistence Frameworks :

given that 

- I already have an application written with mixed direct access and datasnap  access to a database
- My company uses an "exotic " database (Advantage Database Server) which is not supported in any OPF except hcOPF
- my goal is to begin to write (and rewrite) mockable components in my application

should I use hcOPF , or write myself a quick and less-dirty-as-possible OPF ?

Comments

  1. Writing a PersistenceAdapter for DORM is a matter of hours. Then you can support whatever database you need.

    https://code.google.com/p/delphi-orm/

    ReplyDelete
  2. Well, I wish I could recommend Bold for this task but the situations is a bit complicated.

    Most important is that Bold is not free. You may get it if you buy a used copy of Delphi 7. You can then use Bold for D2006 with D2007 as they are binary compatible.
    I hope that we got a solution for this so the source for Bold will be available in some way. Then people can write their own database adapter. I am discussing this with Embarcadero but unfortunately it takes time. So if you must have a solution now I recommend that you choose hcOPF.

    ReplyDelete
  3. More details and thoughts : I'm actually using XE2 (maybe XE3 soon) . I just had a look to hcOPF, and I find it quite hard to install (didn't achieve to get the demo to work ....)
    . So Daniele Teti option seems interesting in a first approach.   Bas Schouten :   Regarding mORMot, should I use it through ODBC ?

    ReplyDelete
  4. Writing an OPF/ORM is not a trivial undertaking. If hcOPF doesn't fit your needs you can try writing a driver for one of the other frameworks or you can stick with datasets and db aware controls for data synchronization and push business logic out to simple domain objects.

    ReplyDelete
  5. Oliver, i would recommend contacting the main developer of mormot Arnoud Bouchez through the forum of mormot. He's very responsive and always looking for ways to improve or expand mORMot

    ReplyDelete
  6. I would recommend writing your own ORM framework only if you're uncomfortable with existing ones and they lack some of the required features. I've written my own ORM framework and I can say that it's not an easy task to write it and it can take a huge amount of time if you would decide to implement some advanced features. If you are interested in my ORM framework (it is almost ready to be released), take a look here: https://bitbucket.org/soundvibe/orm/wiki/Home.

    ReplyDelete
  7. Linas Naginionis I subscribe to beta, your project looks interesting...

    ReplyDelete
  8. Daniele Teti Where's the best place for support on Dorm ?

    ReplyDelete
  9. Olivier SCHWAB the related google group (check the project page con google code).

    ReplyDelete
  10. When I was talking about doing myself an OPF, I had in mind something with really basic functionnalities of loading / saving objects, without managing transactions, etc .... just a simple alternative to loading a dataset in an object and affecting manually each dataset field to an object  property  ... I realize now that my sentence could be interpreted as a little bit ...  braggy .

    ReplyDelete
  11. BTW for the moment now , my tests are really discouraging :

    - hcOPF : can't even launch demo (components missing, tricky install (add hcopf path to browsing path , ..) : no result after more than an hour spent on it

    - DORM : unable to compile, requires RTL recompilation, that I can not perform because of missing zlib obj in XE2 installation 

    next step  : tiOPF and mORMot .... hoping more luck with these 2 ...

    ReplyDelete
  12. Graeme Geldenhuys Totally agree with you :) You just want to buy and USB adapter at the store, and you go back home with a complete PC with LED keyboard ;)

    ReplyDelete
  13. I wrote what started out as a simple ORM once. I used Martin Fowler's PoEAA book and projects like hibernate for guidance. Things got very complicated when I tried to introduce support for inheritance mapping. And generating proper SQL queries from criteria objects is freakin' hard. I've also wrapped TDataset to create a simple ActiveRecord implementation. If you do this, resist the urge to add domain logic directly to the ActiveRecord objects. In the long run I found it was easier to use them as a middleman between the database and domain objects.

    ReplyDelete

Post a Comment