DelphiMVCFramework is now Open Source!

Yes, just after 1 year of development, and a couple of big projects developed with it, the DelphiMVCFramework has been published as OpenSource. The project is on google code svn¬†https://code.google.com/p/delphimvcframework/ I’ll talk about it at ITDevCon2013 (http://www.itdevcon.it) In the trunk there are many samples and I’m planning to put many others. Main DMVCFramework features RESTful (RMM Level 3) compliant Server side generated pages using eLua (Embedded Lua) Messaging extension using STOMP (tested with Apache Apollo and Apache ActiveMQ) Can be used in load balanced environment using memcached (memcached.org) Fancy URL with parameter mappings Integrated RESTClient Works with XE4 and XE5…
Continua a leggere →

Delphi MVC Web Framework – “Hello World”

This is the first “Hello World” for my Delphi MVC Web Framework. program DelphiMVCWebFramework; {$APPTYPE CONSOLE} uses System.SysUtils, MVCEngine in 'MVCEngine.pas', BaseController in 'BaseController.pas'; var mvc: TWebMVCEngine; begin mvc := TWebMVCEngine.Create; mvc.AddRoute('/', procedure(Context: TWebContext) begin Context.Write('Hello World'); end).Start(8080); ReadLn; mvc.Free; end. Features list (some of them are in the internal roadmap) Completely MVC Addressable with servername/controllername/actionname?par1&par2 Addressable with servername/controllername/actionname/par1/par2 Can also use anonymous methods as actions for very simple app (in the sample) Really RESTful (Level 3 of the Richardson Maturity Model) Fully integrable into WebBroker and DataSnap Supports multiple resource rapresentations Completely customizable routing using internal formatting or regex…
Continua a leggere →

A Simple start with MVP in Delphi for Win32, Part 2

Some month ago I wrote a simple article about an MVP variant called PassiveView. That example was very simple. Now I’ll present a more “advanced” version of that example. The main problem with first example was the following method: procedure TfrmCalculatorView.FormCreate(Sender: TObject); begin //Link controls with related interface IFirstOperand := TGUIEdit.Create(EditFirstOp); ISecondOperand := TGUIEdit.Create(EditSecondOp); ICalcResult := TGUIEdit.Create(EditResult); IOperators := TGUISelectableList.Create(ComboOperators); IError := TGUIEdit.Create(EditError); //link view and presenter FPresenter := TCalculatorPresenter.Create(Self); //<<– THIS IS THE BAD LINE end; The “BAD” line links the View with the Presenter but it’s in the view code, so this is meaning that View KNOWS the…
Continua a leggere →

A Simple start with MVP in Delphi for Win32, Part 1

As GUI framework such as VCL become more and more powerful, it’s common practice to let the UI layer do more than it should. Without a clear separation of responsibilities, the UI layer can often become an integral part of application and businness logic, but… this kind of responsabilities belongs to other layers of the application. A design pattern (and his numberless variants), is especially well suited to solving this problem. In this article I want to build a simple application using MVP pattern. Actually, pattern used is not “clear” MVP but his variation called Passive View. Using Fowler words:…
Continua a leggere →