My opinion about Delphi web frameworks

Andrei Aleksandrov
Aug 27, 2017 · 4 min read

In my short life I have tried some Delphi frameworks for several projects. I haven’t measured performance, RPS or something else (because in my small projects it wasn’t needed) but I can say my opinion about frameworks based on comfort of development and learning speed.

Ideal framework

The best framework that I have ever seen is Flask from Python ecosystem. It’s very simple, very comfortable framework that is also often used for small and medium size projects. I love it because of the simplicity. The best idea of Flask is that you can define paths in decorators. It’s incredible, look:

There is also a great extension for REST API called flask-restful. To use it you should create classes and override get, post and delete (an example from my old project):

And this is very simple and works without any big problems. Isn’t that cool?

Back to reality

Python is a cool language, but I want to have something like this in Delphi. We have many frameworks and I haven’t used them all, but I can give my point of view about some of them.

daraja-framework

I have used this framework to build my old webpage with a blog. This is the worst framework that I have ever used. It is just an add-on for Indy and very bad add-on. I looked for a simple framework that I can use with Free Pascal and at the beginning this framework has attracted me, but it has very shitty routing system, can’t serve files from the filesystem, can’t be deployed as ISAPI module or something similar, has bad and unclear documentation, works only on Windows and costs 25 dollar.

The good thing is that daraja-framework is FPC-compatible and is free for open source projects (what is not equal to not commercial). It is a very young framework and I think that it has a future, but now it’s bad.

WebBroker

This framework is distributed with Delphi Professional or higher. It is a good, stable framework. You can visualize the paths of the website, use some visual features and have routing features (not the best, but not very bad), ISAPI and Apache module deployment (but in this case you need to have multiple projects which is not very comfortable), and you can do anything you want with that. It also doesn’t serve files from the filesystem “out of the box”, but it is a stable and flexible framework.

DataSnap

You can say that it is the same as WebBroker, but no, it’s not :) It’s an “SDK” that is distributed in Delphi Enterprise and higher. The main idea of this framework is a creation of web services the same way that we create forms: with components and “WebModule” designers with components full of features: HTML templates, authentication, HTTPS support, proxy generation, routing and many other features.

Big count of features and distribution with Delphi makes this framework very attractive. But the problem is that DataSnap is very hard to learn. And when you want to do something that you can’t achieve visually (or you haven’t found it in internet), you will have problems. The framework isn’t very flexible. Also, proxy generation is also not the best thing about this framework. DataSnap has also some problems with Unicode (it doesn’t add header “Content-Encoding” automatically).

I will use it only for simple things, because creation of services is incredibly fast with DataSnap, actually when it’s CRUD service. And with combination of DataModules you can create web services rapidly!

Currently, I use it on my work and it holds 10 concurrent users :))))))

DMVC (delphimvcframework)

I haven’t used this framework so much, but I think that it’s the best Delphi framework. The first thing that I like is a routing capability. Routing is based on attributes what I find very cool and comfortable.

The second thing that I like in this framework is feature count: all what you need for modern web development is “out of the box”. The framework is very stable and it doesn’t look so that this project will be abandoned. It has great support.

I think this is great. It is one of the coolest open source Delphi projects.

It is a great choice for your REST-API!

mORMot

I haven’t used this framework, but it looks also good. What makes it attractive that it works not only with Delphi and also with FPC. I want to learn it in the future.

That’s all for today :)

UPDATE:

I was wrong about DMVC and Starter edition: you can’t use DMVC with Starter. You can compile the server but application will raise an exception that will tell you that your Delphi is not licensed for such type of operation.

)

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade