In the last months DMVCFramework has been used in many projects. Some fixes and some new features has been added.
Tomorrow will start the 4th training from the Jan 1st 2014 on DMVCFramework… WOW!
The best selling training is “Developing Web Client applications using AngularJS and DelphiMVCFramework” (a slightly modified version of this classic training http://www.bittime.it/sviluppare_applicazioni_web_usando_angularjs_con_delphi_back_end).
Tomorrow the training will be in italian, however is very popular also the english version.
However, back to the project, there is a first attempt to add some documentations on the project.
So far there are a lot of samples and all the unit tests, however there was a lack on the “classic” documentations. So, I’m happy to say that in the SVN trunk you can find my presentation held at the last ITDevCon2013 in Verona, IT.
If you are using DMVC framework I’ll be glad to have 2 lines of description about your project (numbers not functionalities insights) to put a success case page on the project website.
LuaBinding (integrate Lua script into Delphi native code)
LuaTextFilter (convert eLua into plain Lua executable script just like JSP)
Currently DMVCFramework use Embarcadero WebBroker framework, but is not tied to it. I’m working on a version that use IOCP (that is 10 times faster than plain WebBroker) and other web libraries for Delphi.
Code is enough stable and is already used in big production system.
There are a couple of bugs that affect WebBroker and so, DMVCFramework.
In our system, I’ve applied some patches to solve these problems. If you need those patches, ask me (I cannot publish the full code because it is Embarcadero licensed code).
In 2009 I was looking for a fast, very fast, messaging system for a complex project and I meet ZeroMQ. At that time there was the 1.x version and I wrote a Delphi wrapper for the C dll that some days later has been included in the official ZeroMQ distribution.
Yes, this book is really a crash course in ZeroMQ. In about 100 pages, this “small but full of interesting things” book, explains all the most useful message patterns implemented in ZeroMQ. Congrats to Faruk Akgul (the author).
Traditional message queuing systems use a broker. However, ZeroMQ is brokerless. In a brokerless design, applications can directly communicate with each other without any broker in the middle. All the complexity is hidden, and handled, by ZeroMQ. In this situation there isn’t the “single point of failure”. In some cases this architecture cannot be used, but when it can be, you can gain a lot of flexibility, speed with no added complexity.
Let’s give a more deeper overview for each chapter.
Chapter 1: Getting Started
In this chapter there are some informations about the messaging architectures in general (good for newcomers to the topic) and about ZeroMQ messaging (in particular). Some concepts introduced in this chapter are reused a lot in the rest of the book.
In chapter 1 is introduced the first and the simpler ZeroMQ pattern, the request-replay.
Chapter 2: Introduction to Socket
This chapter starts with a nice introduction to the publish-subscribe pattern and the related filtering (ZeroMQ can filter messages with a very simple “match” pattern). Then, the chapter talks about one of the most interesting patterns when speed is important: the pipeline pattern. While is talking about the pipeline, it explain the ZMQ_PULL and the ZMQ_PUSH socket types. At the end of the chapter, there is an introduction to the Valgrind’s tools suite to detect memory leaks in C/C++ programs. In Delphi can be used FastMM or other similar tools for the same thing.
Chapter 3: Using Socket Topology
In this chapter there is a small introduction to the types of Internet Sockets and TCP. There there is a nice comparison between the “plain” sockets and the ZeroMQ sockets.
At the end, there is an introduction to the CZMQ, a small helper library which lets
C developers to code their ZeroMQ applications easier and shorter. For a Delphi programmer there are a number of ZeroMQ wrapper that makes its use really a snap.
Chapter 4: Advanced Patterns
In this last chapter, are introduced some advanced variation of the previously introduced patterns. Then, there is a nice explanation of some critical situations that could happened in a messaging system. To help the programmer to handle this cases there a number of examples of the ZeroMQ “High Watermark” setting. As very last topic, there is a well known problem, the infamous “slow subscribers in a publish-subscribe pattern”.
As in every single thing, there are good aspects and bad aspects.
This book is good for an introduction but is not so good for advanced users. There are some other ZeroMQ patterns and features that are not explained at all. However, these patterns are not the most used, or are advanced stuff, so this could not be a big issue.
Considering, the price, the contents and the informative density, is a definitely a good book that can be read, and studied, in few hours and could change your way to do things in everyday programming (messaging are very often not used, or used in a bad way, simply because usually is complex to write and maintain a good messaging system).
One of the more nice features about ZeroMQ is that it can use different transportation protocols. The same library and the same code can be used to do messaging between machines, between processes or between threads in the same process (ipc). As last note, ZeroMQ can handle, without much effort, millions of messages per seconds. If you need speed… consider this.
P.S. I’ll translate and publish on this blog, some of the C examples contained in the book, in Delphi. Stay tuned.