DMVCFramework Full Source XE3-XE7 » Developer.Team - Developers Paradise!

DMVCFramework Full Source XE3-XE7

DMVCFramework Full Source XE3-XE7
DMVCFramework Full Source XE3-XE7 | Free for All


RESTful (RMM Level 3) compliant
Can be used in load balanced environment using Redis (http://Redis.io) dev
Fancy URL with parameter mappings
Specialied renders to generate text, html, JSON
Powerful mapper to map json to objects and datasets to objects
Can be packaged as stand alone server, apache module (XE6, XE7) and ISAPI dll
Integrated RESTClient
Works with XE3, XE4, XE5, XE6 and XE7
For each functionalities there is at least a test case
There is a sample for each functionlities
There is a complete set of trainings about it, but the samples are included in the project
Experimental support for IOCP dev
Server side generated pages using eLua (Embedded Lua)
Specific trainings are available (ask me for a date and a place)
Messaging extension using STOMP (beta)
Community driven (Facebook group https://www.facebook.com/groups/delphimvcframework)
Simple and documented (right click "Save as...")
Completely unit tested

Below a basic sample of a DMVCFramework controller with 2 action

unit UsersControllerU;
 
interface
 
uses 
  MVCFramework;
 
type 
  [MVCPath('/users')]
  TUsersController = class(TMVCController)
  public
    
    //The following action will be with a GET request like the following
    //http://myserver.com/users/3
    [MVCPath('/($id)')]
    [MVCProduce('application/json')]
    [MVCHTTPMethod([httpGET])]
    procedure GetUsers(CTX: TWebContext);

    //The following action will be with a POST or PUT request like the following
    //http://myserver.com/users/3
    //and in the request body there should be a serialized TUser
    [MVCPath('/($id)')]
    [MVCProduce('application/json')]
    [MVCHTTPMethod([httPOST, httpPUT])]
    procedure UpdateOrCreateUser(CTX: TWebContext);

  end;
 
implementation

uses
  MyTransactionScript; //contains actual data access code
  
{ TUsersController }
 
procedure TUsersController.GetUsers(CTX: TWebContext);
var
  User: TUser;
begin
  User := GetUserById(CTX.Request.Parameters['id'].ToInteger);
  Render(User);
end;

procedure TUsersController.UpdateOrCreateUser(CTX: TWebContext);
var
  User: TUser;
begin
  User := CTX.Request.BodyAs<TUser>;
  SaveUser(User);
  Render(User);
end;

  
end.


Home:
https://code.google.com/p/delphimvcframework/