DelphiMVCFramework 3.1.1-beryllium-RC5 - HATEOAS, Delphi, Improved, sample, Added, const, Links, support, AddRefLink, people, using, _TYPE,

DelphiMVCFramework 3.1.1-beryllium-RC5

DelphiMVCFramework 3.1.1-beryllium-RC5


New! Added SQLGenerator and RQL compiler for PostgreSQL and MSSQLServer (in addition to MySQL, MariaDB, Firebird and Interbase)
Improved! Greatly improved support for HATEOAS in renders. Check TRenderSampleController.GetPeople_AsObjectList_HATEOS and all the others actions end with HATEOS in renders.dproj sample)

DelphiMVCFramework Main Features
Simple to use, check the "Getting Started: 5 minutes guide" and you will be up and running in 5 minutes or less!
Project Roadmap is always public
More than 40 samples to learn all the features and be proficient and productive
RESTful (RMM Level 3) compliant
JSON-RPC 2.0 Support with automatic objects remotization
Stable and solid, used by small/mid/big projects since 2010
Very fast! (3.x is 60% faster than the 2.x)
Support group at https://www.facebook.com/groups/delphimvcframework with more than 2100 active members
Can be used in load balanced environment
Wizard for the Delphi IDE. It makes DelphiMVCFramework even more simple to use!
Optional session support
JSON Web Token Support (JWT)
Extendable using middlewares (simple hooks to handle request/response)
Flexible yet simple to use, authorization/authentication framework based on industry standards.
HTTP Basic Authentication
JWT Authentication
Custom Authentication
CORS support
Controllers inheritance! You can define your own base controller and inherith from it.
Fancy URL with parameter mappings
Specialied renders to generate text, HTML, JSON.
Powerful and customizable mapper to serialize/deserialize data.
Can be packaged as stand alone server, apache module (XE6 or better) and ISAPI dll
Integrated RESTClient
Works with XE7, XE8, Delphi 10 Seattle, Delphi 10.1 Berlin, Delphi 10.2 Tokyo, Delphi 10.3 Rio
Works on Linux (Delphi 10.2 Tokyo or better)
Completely unit tested
There is a sample for each functionality
There is a complete set of trainings about it, but the samples are included in the project
Server side generated pages using Mustache (https://mustache.github.io/) for Delphi (https://github.com/synopse/dmustache)
Specific trainings are available (email to professionals@bittime.it for a date and a place)
Messaging extension using ServerSentEvents
Automatic documentation through /system/describeserver.info
Driven by its huge community (Facebook group https://www.facebook.com/groups/delphimvcframework)
Semantic Versioning
Simple and documented
Continuosly tested for Delphi versions incompatibilities by the proud compatibility mantainers

//Now is really easy to add "_links" property automatically for each collection element while rendering
Render<TPerson>(People, True,
    procedure(const APerson: TPerson; const Links: IMVCLinks)
    begin
      Links.AddRefLink
        .Add(HATEOAS.HREF, '/people/' + APerson.ID.ToString)
        .Add(HATEOAS.REL, 'self')
        .Add(HATEOAS._TYPE, 'application/json')
        .Add('title', 'Details for ' + APerson.FullName);
      Links.AddRefLink
        .Add(HATEOAS.HREF, '/people')
        .Add(HATEOAS.REL, 'people')
        .Add(HATEOAS._TYPE, 'application/json');
    end);


//Datasets have a similar anon method to do the same thing
Render(lDM.qryCustomers, False,
  procedure(const DS: TDataset; const Links: IMVCLinks)
  begin
	Links.AddRefLink
	  .Add(HATEOAS.HREF, '/customers/' + DS.FieldByName('cust_no').AsString)
	  .Add(HATEOAS.REL, 'self')
	  .Add(HATEOAS._TYPE, 'application/json');
	Links.AddRefLink
	  .Add(HATEOAS.HREF, '/customers/' + DS.FieldByName('cust_no').AsString + '/orders')
	  .Add(HATEOAS.REL, 'orders')
	  .Add(HATEOAS._TYPE, 'application/json');
  end);

//Single object rendering allows HATEOAS too!
Render(lPerson, False,
  procedure(const AObject: TObject; const Links: IMVCLinks)
  begin
	Links.AddRefLink
	  .Add(HATEOAS.HREF, '/people/' + TPerson(AObject).ID.ToString)
	  .Add(HATEOAS.REL, 'self')
	  .Add(HATEOAS._TYPE, TMVCMediaType.APPLICATION_JSON);
	Links.AddRefLink
	  .Add(HATEOAS.HREF, '/people')
	  .Add(HATEOAS.REL, 'people')
	  .Add(HATEOAS._TYPE, TMVCMediaType.APPLICATION_JSON);
  end);


Better packages organization (check packages folder)
New! TMVCActiveRecord.Count method (e.g. TMVCActiveRecord.Count(TCustomer) returns the number of records for the entity mapped by the class TCustomer)
Change! TMVCACtiveRecord.GetByPK raises an exception if the record is not found
New! contains clause has been added in the RQL compiler for Firebird and Interbase
New! TMVCAnalyticsMiddleware to do automatic analytics on the API (generates a CSV file). Based on an idea by Nirav Kaku (https://www.facebook.com/nirav.kaku). Check the sample in \samples\middleware_analytics\
New! TMVCActiveRecord.DeleteAll deletes all the records from a table
New! TMVCActiveRecord.DeleteRQL deletes records using an RQL expression as where clause.
New! Microsoft SQLServer Support in ActiveRecord and RQL (thanks to one of the biggest Delphi based company in Italy which heavily uses DMVCFramework)
Improved! ActiveRecordShowCase sample is much better now.
Improved! In case of unhandled exception TMVCEngine is compliant with the default response content-type (usually it did would reply using text/plain).
Fix! issue184.
Breaking Change! In MVCActiveRecord attribute MVCPrimaryKey has been removed and merged with MVCTableField, so now TMVCActiveRecordFieldOption is a set of foPrimaryKey, foAutoGenerated, foTransient (check activerecord_showcase.dproj sample).
Added! New overloads for all the Log* calls. Now it is possibile to call LogD(lMyObject) to get logged lMyObject as JSON (custom type serializers not supported in log).
Fixed! issue164
Fixed! issue182
New! StrDict(array of string, array of string) function allows to render a dictionary of strings in a really simple way. See the following action sample.

procedure TMy.GetPeople(const Value: Integer);
begin
  if Value mod 2 <> 0 then
  begin
    raise EMVCException.Create(HTTP_STATUS.NotAcceptable, 'We don''t like odd numbers');
  end;
  Render(
    StrDict(
      ['id', 'message'],
      ['123', 'We like even numbers, thank you for your ' + Value.ToString]
    ));
end;


New! Custom Exception Handling (Based on work of David Moorhouse). Sample "custom_exception_handling" show how to use it.
Improved! Exceptions rendering while using MIME types different to application/json.
Improved! JSONRPC Automatic Object Publishing can not invoke inherited methods if not explicitely defined with MVCInheritable attribute.
Improved! Datasets serialization speed improvement. In some case the performace improves of 2 order of magnitude. (Thanks to https://github.com/pedrooliveira01)
New! Added in operator in RQL parser (Thank you to João Antônio Duarte for his initial work on this)
New! Added TMVCActiveRecord.Count(RQL) to count record based on RQL criteria
New! Calling /describe returns the methods list available for that endpoint.
New! Experimental (alpha stage) support for Android servers!
New! Added support for X-HTTP-Method-Override to work behind corporate firewalls.
New Sample! Server in DLL
Improved! Now Firebird RQL' SQLGenerator can include primary key in "createinsert" if not autogenerated.
New! Added support for TArray and TArray in default json serializer (Thank you Pedro Oliveira)
Improved! DMVCFramework now has 130+ unit tests that checks its funtionalities at every build!
New Installation procedure! Just open the project group, build all and install the design-time package (which is dmvcframeworkDT)

Delphi Version Project Group
Delphi 10.3 Rio packages\d103\dmvcframework_group.groupproj
Delphi 10.2 Tokyo packages\d102\dmvcframework_group.groupproj
Delphi 10.1 Berlin packages\d101\dmvcframework_group.groupproj
Delphi 10.0 Seattle packages\d100\dmvcframework_group.groupproj
Delphi XE8 packages\dxe8\dmvcframework_group.groupproj
Delphi XE7 packages\dxe7\dmvcframework_group.groupproj

Only for V.I.P
Warning! You are not allowed to view this text.