ANN: DelphiMVCFramework 3.0 beta

In the last months some of the great 9 DelphiMVCFramework contributors from all over the world, have worked hard to release the version 3.0. Now it is ready to be tested!

dmvcframework

DelphiMVCFramework is one of the most popular RESTful framework for Delphi, so any change has been accurately considered and also its impact on the current 2.x projects has been take in consideration. There are a lot of new core features that will make even more easy to work on (and with) your beloved RESTful framework. Also, all these changes will make the framework even more flexible regarding the serializators even for custom types (yes, now you can register your custom serializer for your data types). Also, JSON is no more the only “built-in” supported format. Well, now JSON is the only format, but now is really easy to add to the serializers registry a brand new serializer which serialize in XML, YAML, BSON, CSV etc. The serializers are recicled between requests to get the maximum performances.

Considering that some often-used methods have been removed or refactored, we tracked all the breacking changes in a document, so that you can evaluate the impact that the new version may have on your projects.

Here the content of the document as it is today (the latest version is available here).

DelphiMVCFramework 3.0.0 breaking changes

  • RenderListAsProperty has been removed from TMVCController. You can set such kind of specialized serializations in your custom base controller.
  • RenderJSONArrayAsProperty has been removed from TMVCController. You can set such kind of specialized serializations in your custom base controller.
  • Render has been removed from TMVCController (was deprecated).
  • Render(TJSONValue) has been removed from TMVCController (use Render(TObject)).
  • Trying to deserialize a TJSONNull the target instance will not be freed anymore (consistency with serialize).
  • Context.Request.BodyAsJSONObject dosen’t exist any more. Use BodyAs or the following pattern to migrate.
JSON := TJSONObject.ParseJSONValue(Context.Request.Body) as TJSONObject;
try
  if not Assigned(JSON) then
    raise EMVCException.Create('Invalid JSON');
  // do something here
finally
  JSON.Free;
end;
  • TMVCConfigKey moved to unit MVCFramework.Commons.
  • TMVCMimeType was renamed to TMVCMediaType.
  • TMVCController.Render (no parameter method) do not exist anymore. If the return is a ResponseStream, use the RenderResponseStream.
  • TMVCController.PushJSONToView was renamed to PushToView and Removed SystemJSON dependency, use the ToJSON method if necessary.

As you can see, the breaking changes are very few and there are very low probabilities that will require you more than 10 minutes to fix them even in a big DelphiMVCFramework 2.x project. I did it for our biggest projects, and 10 minutes are largely over-estimated.

Beta Tests

For the next weeks/months the 3.0 beta version will be available for testing. If no major bugs will be found, the 3.0 will be merged in the main branch.

To test the 3.0 beta version you have to checkout the “pluggable_mapper” branch (clone the repo if you didn’t already, and then checkout the “pluggable_mapper” branch).

You can go back to the 2.1.6 (carbon) when you finished the test. There is no reason to be afraid about the changes. They are really in the deep layers and should not affect the “normal” services.

Happy testing!

Community

Considering all the help requests coming from the users (and the fact that facebook is not permitted in some companies) we at bit Time Professionals (the company which lead the development of DelphiMVCFramework and other open source Delphi projects) decided to create a specific community and leave the facebook group only for announces and polls.

Some of bit Time Professionals Open Source Projects
Some of bit Time Professionals Open Source Projects

So, if you need help about DelphiMVCFramework, LoggerPro, Delphi Redis Client, columbusegg4delphi, Delphi Event Bus, Delphi STOMP client, you can go to the bit Time Professionals Community and ask there. If you want to support the projects or you need fast responses, you can also subscribe to the “professional support” group (with a very low fee) and your requests will get priority upon the other by our engineers (which likely wrote 80% of the framework code). When possibile, the support team will send you a specific sample written specifically to show you how to solve your problem. The “professional” groups will be available soon. If you are interested about prices or other things related to the professional support, ask to professionals(at)bittime(dot)it.

Currently is just started, go to subscribe now!

 

DT

Delphi 10.2 Tokyo: REDIS Client is ready for Linux (VIDEO)

Now that Delphi can compile for Linux, I’d like to show how to use Delphi REDIS client on Linux.
Redis is a very powerful key-value store server used by the biggest companies in the world. While it is very popular in web applications with thousands of concurrent users, also traditional desktop applications can benefits by REDIS.
If you need to speedup you application or if you want to optimize your data access layer, I suggest you to partecipate to one of our Delphi and REDIS training.
In this video I’ll use a sample project included with the Delphi REDIS client project to show how is possibile to use REDIS to integrate Delphi Windows application and Delphi Linux servers.

The Linux compatible version of Delphi REDIS Client will be available through GetIt ASAP.

Enjoy.

Delphi REDIS Client

https://github.com/danieleteti/delphiredisclient

Delphi Redis Client available through GetIt Package Manager

Delphi Redis Client
Delphi Redis Client Logo

Since some days ago, Delphi Redis Client, the official redis client for Delphi, is available through GetIt.

You can get the library with just a click, now there aren’t reasons to be afraid by Redis utilization 🙂

More info and the (very simple) installation instruction at the dedicated page.

The official repository if on github https://github.com/danieleteti/delphiredisclient

ITDevCon Community Workshops: DelphiMVCFramework & Multithreading

As you probably know, monday and tuesday we held 2 ITDevCon Community Workshop.

On monday we had “Tutto su DelphiMVCFramework” (All about DelphiMVCFramework) a very intensive workshop which introduce al the major features about DelphiMVCFraemework:

  • DelphiMVCFramework architecture
  • Understanting Routing
  • Controllers
  • Routes and parameters
  • Renders
  • Action filters
  • Accessing data
  • Be amazed by the Mapper’s features
  • Sessions
  • JSON Web Token support (JWT)
  • Middleware
  • The built-in Authentication & Authorization framework
  • Serving static files
  • Server Side Views (a.k.a. SSV)
  • Using Push Notifications with DMVCFramework and RabbitMQ
  • The built in RESTClient
  • The amazing RESTAdapter (by Daniele Spinetti)

After a basic introduction about controllers, routing and renders, we give a look on all the advanced features. The people have been amazed by the framework flexibility and simplicity.

Here’s some photos.

img_20161128_095551

About to start…

start-dmcvframework

 

The class during the morning session

img_20161128_102706

 

Lunch time!

img_20161128_131933

 

And the end of the monday session, my friend Maurizio Del Magno brings a lot of piadinas (https://en.wikipedia.org/wiki/Piadina) and offered to cook them. So, we bring some Porchetta di Ariccia  (https://en.wikipedia.org/wiki/Porchetta) and organized the first ITDevCon Community Dinner 🙂

 

Here’s Maurizio while is cooking the piadinas.

img_20161128_181600

 

And this is the porchetta!img_20161128_181640

 

This is the link for the complete photo album

 

The day after, we had the workshop: “Tecniche per il multhreading” (multithreading tecniques). Have been introduced and explained all the major problems related to multithreading programming and then we show the fundamental tecniques to cope with them, including Parallel Programming Library. There were the topics.

 

  • What’s a thread?
  • TThread Basics
  • Synchronize background threads with the main thread: the easy way
    • Synchronize
    • TThread.Synchronize
    • Thread.Queue
  • How to correctly destroy a thread
  • When a piece of code is thread safe?
  • Fundamental synchronization tools
    • Critical section – TCriticalSection
    • Interlocked function – TInterlocked
    • Monitor – TMonitor
    • Mutex – TMutex
    • Events – TEvent
  • The producer-consumer pattern
  • Beware to the deadlock!
  • The RTL thread safe classes
    • TThreadedQueue<T>
    • TThreadList<T>
  • Practical applications of multithreading in database programming
    • Background queries
    • Parallels queries
  • Background HTTP requests
  • The parallel programming library: TTask, TFuture and TParallel.&For

Here’s some photos of the second day of workhop

img_0209

img_20161129_115604

The “multithreading” class

img_20161129_100147

This is the link for the multithreading workshop album.

 

These 2 days have been very intensive, however have been a really success: lot of people, lot of good-old Delphi programmers but also a good number of younger (50%/50% more or less).
I’m planning to organize other ITDevCon Community WorkShop in the beginning of 2017.

See you soon guys, and keep in touch!

 

 

Delphi 10.1 Berlin Update 2 – startup problems and fixes

Just a quick note to leave documentation for other Delphi and C++Builder developers around here.

After installing the RAD Studio 10.1 Berlin Update 2 my RAD Studio installation was broken.

The installation reach the end but when I start RAD Studio I get a lot of messages of “Package raise exception XXX do you want to load the next time?”. All the dbx related packages raises that exception. Disabling all the dbx packages I get my RAD Studio running but it is half-working… here and there there are AV, and if I try to reinstall the dbx related packages I get the following error.

pasted-image-at-2016_11_17-17_33

Moreover, I cannot use any of the deploy facilities built into the product. The PAClient executable return always “Error 217” even if launched from the command line.

After some struggling with this problem, my friend Stefan Glienke point me to the right direction with the following message: “I think I had some issue with the DBX package in a previous reinstall and IIRC it was because of a misconfigured/corrupt dbx settings file somewhere.”.

That point me to the right direction. I renamed the dbxconnections.ini and the dbxdrivers.ini so that the bpl cannot find them. Restarting RAD Studio I can reenable the dbx related package and the PAClient start to works as well.

So, I closed RAD Studio and opened the inifiles to check where could be the problems. Seems that in some installation/reinstallation/update some keys and section of the ini have been duplicated. So I just fixed the ini removing the duplicated sections and keys, renamed the files with the correct names and restarted RAD Studio.

Now it works.

ITDevCon 2016 – Call4Paper

ITDevCon2016 logo
UPDATE:

ITDevCon2016 will be held next Oct 6th, 7th in Rome (Italy).

The post has been updated as well.

Dear potential ITDevCon speaker,

As every year (but 2015), I’m building the agenda for next ITDevCon that will be held next October 6th, 7th in Rome (Italy), in a new location, the bit Time group headquarter!

This will be the 7th conference edition and will be organized by bit Time Professionals, part of the bit Time Group.

The call for papers are officially open right now, so if you want to propose some speeches, I’ll be glad to see them.

Send your Call4Paper to d.teti@bittime.it.

As usual, for the Call4Paper I need:

  • Title (for every talk)
  • Abstract (for every talk)
  • Difficulty level (for every talk. Difficulty level is a scale from 1 to 3 with the following mean: introduction, intermediate, advanced)
  • Speaker’s photo
  • Speaker’s profile

I’m looking forward to your proposal. The call4papers ends at Jul 31st, 2016 but if you have *VERY* interesting topic to propose, propose it… I’ll try to arrange the schedule and fit it in the agenda.

Proposals will be evaluated and the speakers will be contacted ASAP.

This year topics will be the following:

TOPICS

  • What’s new in the latest Delphi versions
  • IoT (Internet of Things) solutions
  • FireMonkey platform
  • MacOSX development
  • Android development
  • iOS development
  • Windows development
  • Mobile development (Android and/or iOS)
  • Develop UIs for different devices (smartphones, tablets, TV, watch etc)
  • LiveBindings ®
  • Delphi best practices
  • Design Patterns
  • Open Source Delphi Frameworks (Spring4d, DelphiMVCFramework etc)
  • Arduino, Raspberry Pi or others similar system
  • Web Application with Delphi
  • Integration with external systems
  • TDD and Unit Tests
  • Agile methodologies
  • ORM and other data access patterns
  • Using NoSQL databases (even to speed up your VCL software)
  • FireDAC
  • UI, UX, optimization for mobile and desktop
  • OOD/OOP
  • Real use cases for extended RTTI, Generics and Anonymous Methods
  • RESTful interfaces design and development
  • Architectures
  • Cool (dev) things that you are doing or that you did in the recent past

Target audience

  • Software architects
  • Software developers
  • Project managers
  • IT managers
  • Trainers

The conference web site is http://www.itdevcon.it

Up to May 31st you can get the ticket at the discounted early bird or 249.00 Euro. After that day the normal ticket price will be 349.00 Euro. Get it!

The ticket includes:

  • 2 conference days
  • Lunches
  • Coffee Breaks
  • Gadgets

Do you want to see a particular topic or have a suggestion for ITDevCon2016? Let me know

As usual one of the most important part of ITDevCon will be the networking between attendees. I know about great collaboration born during ITDevCon. Be there and don’t miss this social opportunity!

Thank you and…  see you at ITDevCon 2016.

Great success for RAD Studio in one of the most important italian government palaces

This week, in one of the most important government palaces in Italy (I cannot say which one), I did a consultancy about mobile development. The internal dev team is currently using Xamarin and they have a blocking problem with it. In the team there is a friend of mine which called me some days ago to know if I know how to solve their problem using Delphi. I told him that the “blocking” problem could be solved with Delphi. The resultant 2 days of consultancy were been quite hard, but the result has been really rewarding. A long standing problem has been elegantely solved using Delphi in a couple of hours.

The problem was about using HTTP client certificates with iOS in a Microsoft architecture, where each user had its own certificate.

I dont know Xamarine so deeply to say if the problem could be elegantly resolved with it as well, but the team is quite smart and skilled, so I think that they have been tried all the documented solutions to face the problem, but without success.

I want to thank the always helpful Jim McKeeth and the great Diego Navarro from Embarcadero, to have help me about this issue. Thank you guys.

 

DataSnap Filters Compendium Updated to Delphi 10 Seattle

Very quick info.

Not tremendous useful today as when developed (Delphi 2010 time frame) but, if someone is still using my DataSnap Filters Compendium (and I know some users heavily use it), now can find the Delphi 10 Seattle version on github. Currently works all the speed test and the server/client test. Consider this as a very stable beta.

Here’s the project repository

https://github.com/danieleteti/dsfc

Echoes From The Past: Message Master For Delphi a.k.a. MM4D

Some years ago, at the Delphi 6/7 timeframe I was working on a client/server program with c.a. 400 forms and 200 units. At that time I needed a simple way to localize in Italian (in primis) and in other languages, all the  standard dialogs (ShowMessage, InputBox, InputQuery etc.). Moreover, I would have liked to give a unique style to them. In addition, I needed to localize that dialogs. Moreover I needed a simple way to show a program of a background operation using a not modal dialog with a simple pattern like the following:

  ...
  ShowStatusPos(STATUS_CAPTION, Point(50, 50), True);
  try
    for i := 1 to 100 do
    begin
      SetupQuery(LMyDataset, i);
      LMyDataset.Open;
      while not LMyDataset.Eof do
      begin
        //do something
        UpdateStatus(i, Format(STATUS_CAPTION + ' %2d%%', [i]));
        LMyDataset.Next;
      end;
      LMyDataset.Close;
    end;
  finally
    CloseStatus;
  end;
  ...

So, after some tests I wrote Message Master for Delphi. MM4D is a smal library which supports all of these features, or at least these features were supported at that time. Indeed, since then I saw many (really many) 3rd-party Delphi/C++Builder written programs which actually use MM4D. However, since then I didn’t supported that library anymore. Now, more or less, 15 years after, a user wrote to my about MM4D support in Delphi 10 Seattle. So, I decided to update the code to let it compile on Delphi 10 Seattle. So, now it is currently supported (even if I dont plan to improve it in any way in the short term). However if someone use it or want to use it and update/upgrade/improve, here’s the github reporitories. I hope I have done something good for all the old time users.

Message Master For Delphi
https://github.com/danieleteti/mm4delphi

In the repositories there is a demo to show all the features of MM4D and there is also a small tool called UnitsAdded.exe which can be used to add the MM4D features to a project automatically (search for Dialogs.pas and, if exists, add MessDlgs after it).
MM4Delphi uses the good XiControls (included). So, still thank you to Eugene Genev for his XiControls.

Migration to github for all my open source projects… done!

Since when Google announced that Google Code will be closed I did start to plan the migration of all my open source projects. Now, the migration is terminated.

In the next days, I’ll add all the contributors too, so that the development can go forward as usual.

These are the projects

  • DelphiMVCFramework
    • if you are reading my Delphi Cookbook, please use this new repository instead of the old SVN one, reported in the book.
  • DORM, the Delphi ORM
  • DelphiRedisClient
  • DelphiDIContainer
  • DelphiSTOMPClient

All the repositories are available on my personal github page https://github.com/danieleteti and, as usual all contributions are welcome.

Enjoy.