Sneak peek to simple integration between DMVCFramework and DORM

This is a really simple (not optimized and dirty) integration between the upcoming DMVCFramework (WebBroker based MVC framework) and DORM, “the Delphi ORM”. This is the DMVCFramework controller with the relative mapping and methods. In the method “GetUsers” dorm is used to execute a select to the database using the sanitized parameter passed on the url. unit UsersControllerU; interface uses MVCFramework, dorm; type [MVCPath('/users')] TUsersController = class(TMVCController) strict private dormSession: TSession; strict protected procedure MVCControllerAfterCreate; override; procedure MVCControllerBeforeDestroy; override; public [MVCPath('/($id)')] [MVCHTTPMethod([httpGET])] procedure GetUsers(CTX: TWebContext); end; implementation uses dorm.loggers, dorm.adapters, dorm.Commons, UsersBO; { TUsersController } procedure TUsersController.GetUsers(CTX: TWebContext); var User:…
Continua a leggere →

Tomorrow the webinar: “Developing Application Services using PHP Servers and Android Clients”

In this webinar I’ll show how to develop Android application talking with REST PHP WEB Services. After introducing the basic concepts, attendees of this session will be taken through how to REST-enable the server application, before building the client application targeting an Android phone. Topics covered in this webinar include: Introduction to REST and JSON support in PHP Introduction to Android client development Creating a REST web service with RadPHP Connecting from an Android application to the REST web service Companion White Paper, Videos and Source Code Visit the RAD Studio in Action – PHP and Android Resource Center for…
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 →

.NET databinding in Delphi for Win32

Databinding is defined as: “General technique that binds two data/information sources together and maintains them in sync. This is usually done with two data/information sources with different types as in XML data binding. However in UI data binding, we bind data and information objects of the same type together (e.g. Java objects to Java UI elements).” Databinding is common technique in VCL. Since Delphi 1 we have TDataset class for bind data and UI controls (DB Aware) in a GUI application. In .NET world, instead, databinding is very different. So, I’m starting to write (actually for fun) a DataBinder component…
Continua a leggere →

Value Object vs Data Transfer Object

One of the main goals of design patterns is to have a names dictionary shared among professionals. This dictionary, sometimes, has some trouble. It’s the case of two well known design patterns: Value Object and Data Transfer Object. Value Object, according to Martin Fowler, is defined as: “A small simple object, like money or a date range, whose equality isn’t based on identity.” But Value Object, according to SUN, was for some time defined as follows: “An object that carries data between processes in order to reduce the number of method calls.” In the words of Fowler: “Many people in…
Continua a leggere →