ORM for DELPHI win32 - delphi

Does anyone know about an ORM or something similar for Delphi Win32.

Marco Cantu is a big believer in InstantObjects:
http://www.instantobjects.org/
Others include DObject:
http://www.macrobject.com/en/dobject/
and tiOPF
http://tiopf.sourceforge.net/Doc/overview/index.shtml
You also might be interested in the G Framework:
http://code.google.com/p/g-framework/

Another Open Source ORM for Delphi 6-XE2, which is JSON based and Client/Server.
Can use its own in memory database layer or embedded SQLite3 database engine:
http://blog.synopse.info/category/Open-Source-Projects/SQLite3-Framework
Edit: A lot of improvements to this active framework, since this question was answered. It is able now to connect to any third-party database, and is changing its name: it is now called the mORMot framework.

There are a few, some of the more tried and tested are...
Bold
TiOPF
And RemObjects also has a schema Mapping technology that is worth investigating

TMS Software is working on an ORM framework for Delphi: TMS Aurelius should be soon released :
TMS Aurelius
EDIT:
It's been already released, official site is http://www.tmssoftware.com/site/aurelius.asp

Another ORM for Delphi, which seems to be in active development, is hcOPF
The project is open source licensed under LGPL/MPL and hosted on SourceForge at http://sourceforge.net/projects/larryhengensopf/.
dorm, “The Delphi ORM” by Daniele Teti, was officially published at ITDevCon, there is an introduction here. It works with PODOs which have no knowledge of the ORM.

New in 2011: DORM - http://code.google.com/p/delphi-orm/. Some documentation can be found on author's blog.

Visit http://code.google.com/p/persiphi/ if your are addicted to Delphi 2010 or upper.
Edit:
Dead link as the owner likely has renounced to opensource it. Nevertheless, his master thesis work in portugese (pt-br) is still available here. A good source of inspiration for those in search of sample using latest bleeding edge features of Delphi (Annotation, Rtti...) in the realm of object persistence.
UPDATE 1:
DevArt has released EntityDAC - An ORM for Delphi with LINQ support!
It works even with D11 (Delphi 2007).
UPDATE 2:
Marshmallow ORM framework by Linas Naginionis.
It has joined join the outstanding Spring4D project as a feature branch as announced here.
To keep abreast of the latest news head to the Marshmallow Google+ thriving Community page.
Dubbed MM ORM Framework by its author, it's a promising one.

Jazz SDK, ORM is a part of the OPF part
http://jazz-sdk.googlecode.com

Here you have one: http://code.google.com/p/delphiorm/

I tried Remobject Data Abstract for 1-2 year in some real world projects.
Some features are good (a very good binary comunication protocol), some other are simply pitfalls (it adds a something of chaotic code and you have to pass dialog by dialog every change you made on the schema).
It's good you define a schema of the model, it's bad you miss much of the power of SQL (es grouping by, a easy to use join, ecc).
I think that it's hard to fit a good ORM on top of the old VCL and TDataSet.
DatAbstact was a try but at the end I rewrited my application in another language because a good ORM and a good framework is a must have for a good application.
VCL is simply too old to fit well with modern concepts of application development.
Anyway i tried InstantObject and Bold, are two good ORM frameworks but not more supported.

Related

Great Delphi source code to read and learn from

This question relates to
https://stackoverflow.com/questions/9603/what-is-some-great-source-code-to-read
which compiles a list of great (in the sense of readable, elegant, ...) source code.
Part of the learning experience when reading source code is certainly independent of the language but every language has its own ways to do certain things. So in this question, I'm looking for great Delphi code.
What is some great Delphi source code to read and learn from? Any suggestions?
The VCL/RTL itself is a very good example of great delphi code. It is available at your delphi installation folder ($delphi)\source, except for the new Starter edition, which I heard does not include the source code.
My suggestions
All the Jedi projects are very well written JCL (Jedi code library), JVCL, JEDI Windows API Library (Great to learn abot windows api and header conversions).
VCL and RTL Source code.
Virtual Tree View
Well for once, if you ask me, the VCL is fairly well written, and you can learn quite a bit about the Windows API from it.
Then there is the much hyped Delphi Web Script, which sounds rather interesting.
I would also recommend DEHL, which is quite a nice library, and the VirtualStringGrid, as a hugely popular and quite well written, though complex, component.
Then there is the JCL and JVCL, that I would also recommend.
The GExperts sourcecode on sourceforge.
Obvious answer: My sources
http://svn.berlios.de/viewvc/dzchart/utilities/Delphi7Help4Bds/trunk/
http://svn.berlios.de/viewvc/dzchart/utilities/dzAutoSave/trunk/
http://svn.berlios.de/viewvc/dzchart/utilities/dzCmdLineParser/trunk/
http://svn.berlios.de/viewvc/dzchart/utilities/dzLib/trunk/
http://svn.berlios.de/viewvc/dzchart/utilities/dzPrepBuild/trunk/
You saw that coming, didn't you?
Bold for Delphi - Framework, a masterpiece, huge and immaculately designed
StarUML - An UML Editor, wonderful clean design and code
Clever Internet Suite - Communication component set - clean architecture and code, commercial
"Good code" is a rather subjective topic ... everyone has an opinion on what can be considered good/bad code. Readable code might not necessarily be considered effective code, and vice-versa.
If your interest is learning how to create well-written code, you should instead study any code and find out how to improve or fix it. When I was in the Air Force, part of the training I would give my new troops would include them visiting sites like Koders or Sourceforge, where they would download source and analyze for functionality, effective results, coding standards, proper software engineering principles, etc. They would look at the code and answer "how would I do this differently?" This exercise gave them a much better understanding of what well-written code should look like.
My point is, you can't learn how to write "good code" if you don't know what "bad code" looks like.

Raudus vs ExtPascal: Delphi web developement alternatives that use ExtJS [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Delphi developers has several tools (several alternatives to ASP.NET) for building web applications.
While No.1 framework is Intraweb, there is a lot of interest around ExtJS, that has 2 incarnations:
1) the opensource ExtPascal
2) the closedsource Raudus
Now the products are different, Raudus never supports the latest ExtJS version (while ExtPascal does because as far as I read it "almost automatically updates itself to the latest ExJS version"), Raudus "seems" much RAD (much similar to Intraweb from the RAD point of view).
Anyway why chose one or the other?
Why Raudus (since it is free) cannot become Open Source? Or does Raudus use ExtPascal behind the scenes?
Comment: uniGUI seems at first sight to combine the good part of Raudus (the RAD part) and ExtPascal (being based on extPascal).
Talking about Raudus, I'd be careful! You can download it for free, indeed. I was about to start using it when I realized there's no single word on its usage license. There's no license in fact, or I was unable to find it under "standard" locations (website? no. installer? no. README / LICENSE file? no.)
Thus I'd be careful with using library which doesn't specify it's license. Especially if you're about to start some project which will use it intensely - just imagine what happens when it comes out that you need to pay big amount of money for using it ...
Why use any of them? RAD in the form of Intraweb and tools like it, is not appropriate for web programing. It doens't separate the GUI from bussines logic well. In other words there is no true MVC approach there. Maybe ExtPascal is different here, but the point is elsewhere.
ExtJS is a very well written RAI JS library. It feels almost like putting blocks of code together in a very object oriented way. You can easily build whole GUI with ExtJS without any backend support. This way your whole GUI is in javascript files and no backend is needed. Backend only processes the ajax call and provides data / processes data. This way you have a clear separation of concerns.
This can be easily done without any frameworks. Yes framework would come in handy but it would have to be done in a ASP.NET MVC or Ruby on Rails way. No RAD and no visual designers. New web developers often make those mistakes. But if you program for the web long enough you come to appreciate the separation of GUI and logic and the simplicity of HTML. Web programming is different from desktop programming at least to a degree.
To answer your question. From what I have seen, I like ExtPascal better. It seems a purer web development tool than Raudus. But I admit I have only seen both from the surface and from demo videos, so I cannot judge, only speculate :)
The Raudus developer put up a new blog post in late October and claims, well I'll let you read the snippet for yourself:
"Raudus license is freeware as written in license.txt. You CAN use Raudus in commercial projects. Raudus sources are not available yet."
Edit: There is a license statement at the bottom of the http://www.raudus.com/ page.
"License
Raudus is freeware. You can freely use Raudus for commercial purposes."
As to contacting the author, try this from the same page: E-mail: igor#klopov.com
After using Raudus for a few months I decided to post my own answer.
The framework is improving, Sencha touch support now it is not complete but sufficient to create usable web applications optimized for mobile devices.
RFE, a new front end, not based on Sencha Touch is under developement and in next Raudus release (that should be out soon) there will be a usable preview of the new controls set.
So while ExtPascal seems frozen, Raudus is in progress and promising.
Update: I stopped using Raudus, it dropped ExtJs support and now it ships with own controls, that will never match the beauty and richness of extjs components. I am now going for IW + cgdevtools components that are Jquery UI for IW.
user193655 --> Depending on what you do be carefull with both approaches. I am really a big fan on Delphi or Freepascal/Lazarus - I am not very certain if the approach of bringing 3GL bindings to the Javascript stuff is wise.
MVC - depending on what you do - in PHP you have the Yii Framwork or Prado. Maybe the second has some ideas from .net built in which are very easy to understand by Delphi developers. PRADO is an event driven approach while YII Framework is absolutely cool and unix like.
After using Raudus it seems that it is not practical for large scale of applications.
According to their documentation and I have also sampled, it serializes all client request into single main thread. However it process client request and response generation part in multi-threaded enviornment.
But main thread issue is quite important as it directly impact the response time if one action is taking more time in the main thread, others will keep waiting.
Any suggestions to resolve this issue?
Raudus:
Relies upon Delphi, in which:
Is verbose;
Relies upon Microsoft Windows;
High-cost to adapt to or to maintain;
Quote from raudus.com: "Raudus is freeware. You can freely use Raudus for commercial purposes. Raudus sources are not available yet." — This, to me, will be never a license. On the homepage, simply there is no documentation about Terms of Service or something like that. Hence I won't deal with their services.

ASP.NET MVC with Postgres; ORM recommendations?

I'm project managing an intranet application being developed at work. We're in the early planning stages. I've previously done all my development in Python using Django, but as we're a windows shop we're probably going to go with ASP.NET MVC.
We won't really be able to afford a SQLServer license though, so we were perhaps looking into using Postgresql. However I can't seem to find many examples or guides for people who want to utilise a third party ORM - or at least, an ORM with similar usage as Django - that works with Postgresql.
Ultimately we'd like to handle authentication via Active Directory [including groups], but store actual content within the db.
There have been previous questions of a similar nature, but most of them are over a year old when MVC was stil in Beta.
Any ideas?
NHibernate by a country mile.
It also supports MySql and should you want to change it has the main commmercial ones too. Haven't switched between db vendors but if you don't do much bespoke t-sql and say use fluent nhibernate you could almost plug and play between database platforms.
The support and community behind NHibernate when it comes to Mvc is second to none. It is categorically the ORM of choice.
You can try DataObjects.Net - open source ORM with GPLv3 or commercial licenses. It also supports Postrges.
NHibernate supports PostgreSQL. See http://vampirebasic.blogspot.com/2009/02/nhibernate-with-postgresql.html for some advice on how to integrate the two.
Also worth mentioning is that NHibernate now supports LINQ syntax. See http://ayende.com/Blog/archive/2009/07/26/nhibernate-linq-1.0-released.aspx for more details.
I'd recommend Mindscape LightSpeed. It supports PostgreSQL and has a visual designer baked into Visual Studio with full database round tripping to PostgreSQL.
When there was no add-in for Visual Studio to support PostgreSQL from the Server Explorer the guys wrote a free visual studio add-in for supporting it.
Solid O/R Mapper with LINQ mixed with first class visual model development against PostgreSQL. It is a commercial product however there is a free edition for small databases.
Mindscape LightSpeed O/R Mapper
Try Devart LinqConnect - http://www.devart.com/linqconnect/. This Framework supports PostgreSQL, Oracle, MySQL, SQLIte.
Unfortunately, most answers you get on a question like this are going to be based on the responder's opinion and experience and not based on yours.
Most of the suggestions here are good... however... if you are looking for a lightweight/fast ORM that is similar to Django, JackD has the right solution (LinqConnect)...
I've used most of the solutions listed including Django, and find that I usually pick LinqConnect if I'm looking for fast, lightweight and easy. For heavier (read larger) projects I would use something more robust like NHibernate.
But to answer your question correctly... the closest match and least learning curve for someone using Django would definitely be LinqConnect.

Metamodelling tools

What tools are available for metamodelling?
Especially for developing diagram editors, at the moment trying out Eclipse GMF
Wondering what other options are out there?
Any comparison available?
Your question is simply too broad for a single answer - due to many aspects.
First, meta-modelling is not a set term, but rather a very fuzzy thing, including modelling models of models and reaching out to terms like MDA.
Second, there are numerous options to developing diagram editors - going the Eclipse way is surely a nice option.
To get you at least started in the Eclipse department:
have a look at MOF, that is architecture for "meta-modelling" from the OMG (the guys, that maintain UML)
from there approach EMOF, a sub set which is supported by the Eclipse Modelling Framework in the incarnation of Ecore.
building something on top of GMF might be indeed a good idea, because that's the way existing diagram editors for the Eclipse platform take (e.g. Omondo's EclipseUML)
there are a lot of tools existing in the Eclipse environment, that can utilize Ecore - I simply hope, that GMF builts on top of Ecore itself.
Dia has an API for this - I was able to fairly trivially frig their UML editor into a basic ER modelling tool by changing the arrow styles. With a DB reversengineering tool I found in sourceforge (took the schema and spat out dia files) you could use this to document databases. While what I did was fairly trivial, the API was quite straightforward and it didn't take me that long to work out how to make the change.
If you're of a mind to try out Smalltalk There used to be a Smalltalk meta-case framework called DOME which does this sort of thing. If you download VisualWorks, DOME is one of the contributed packages.
GMF is a nice example. At the core of this sits EMF/Ecore, like computerkram sais. Ecore is also used for the base of Eclipse's UML2 . The prestige use case and proof of concept for GMF is certainly UML2 Tools.
Although generally a UML tool, I would look at StarUML. It supports additional modules beyond what are already built in. If it doesn't have what you need built in or as a module, I supposed you could make your own, but I don't know how difficult that is.
Meta-modeling is mostly done in Smalltalk.
You might want to take a look at MOOSE (http://moose.unibe.ch). There are a lot of tools being developed for program understanding. Most are Smalltalk based. There is also some java and c++ work.
Two of the most impressive tools are CodeCity and Mondrian. CodeCity can visualize code development over time, Mondrian provides scriptable visualization technology.
And of course there is the classic HotDraw, which is also available in java.
For web development there is also Magritte, providing meta-descriptions for Seaside.
I would strongly recommend you look into DSM (Domain Specific Modeling) as a general topic, meta-modeling is directly related. There are eclipse based tools like GMF that currently require java coding, but integrate nicely with other eclipse tools and UML. However there are two other classes out there.
MetaCase which I will call a pure DSM tool as it focuses on allowing a developer/modeler with out nearly as much coding create a usable graphical model. Additionally it can be easily deployed for others to use. GMF and Microsoft's Beta software factory/DSM tool fall into this category.
Pure Meta-modeling tools which are not intended for DSM tooling, code generation, and the like. I do not follow these tools as closely as I am interested in applications that generate tooling for SMEs, Domain Experts, and others to use and contribute value to an active project not modeling for models sake, or just documentation and theory.
If you want to learn more about number 1, the tooling applications for DSMs/Meta-modeling, then check out my post "DSMForum.org great resources, worth a look." or just navigate directly to the DSMForum.org
In case you are interested in something that is related to modelling and not generation of code, have a look at adoxx.org. As a metamodelling platform it does provide functionalities and mechanisms to quickly develop your own DSL and allows you to focus on the models needs (business requirements, conceptual level design/specification). There is an active community from academia and practice involved developing prototypical as well as commercial application based on the platform. Could be interesting ...

Delphi resources for existing .NET developer

Can anyone recommend some decent resources for a .NET developer who wishes to get a high level overview of the Delphi language?
We are about acquire a small business whose main product is developed in Delphi and I am wanting to build up enough knowledge to be able to talk the talk with them.
Books, websites etc all appreciated.
Thanks.
DelphiBasics gives a good overview of basic syntax, library functions etc.
Essential Delphi is a free e-book by Marco Cantu that should give a good overview, also of the VCL
Feel free to ask around here as well, or in the Delphi newsgroups, if you encounter specific issues :)
[edit] #Martin:
There's a free "Turbo" edition available at the Codegear/Embarcadero website. I guess it has some limitations, so you could also try downloading the trial version.
There's also a Delphi wiki
This even has a "Beginning Delphi" page with lots of external links on it. (some of them already mentioned)
http://www.delphifeeds.com/ is a good place to start, it has most news about what is going on in the delphi community.
There are a number of videos by Alister Christie at codegearguru - check them out :)
edit... #Martin, check out the Turbo products at CodeGear
#Martin there is a free version.
Turbo Delphi
If you are comfortable with c# you will see many similarities with Delphi.
I also found the community surrounding the newsgroups to be active and helpful. They have a smilar concept to MVPs they were called Team B (but as Borland doesn't own them the name may have changed now).

Resources