Skip to content

Commit

Permalink
dmvcframework-3.2.3-radium
Browse files Browse the repository at this point in the history
  • Loading branch information
danieleteti committed Feb 2, 2023
1 parent 0023ebe commit 3a43849
Show file tree
Hide file tree
Showing 85 changed files with 36,884 additions and 7,522 deletions.
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,15 @@ samples/serversideviews_lua/lua4delphi/unittests/Win32/
/unittests/general/Several/bin/EchoSingleComplexRecord_RESPONSE.json
/unittests/general/Several/bin/TestRequest_Echo_ComplexRecords_RESPONSE.json
unittests/general/Several/pgsql/testdatadir/
unittests/general/Several/bin32/EchoSingleComplexRecord_RESPONSE.json
TestRequest_Echo_ComplexRecords_RESPONSE.json
EchoSingleComplexRecord_RESPONSE.json
samples/middleware_analytics/bin/analytics/middleware_analytics.00.csv
unittests/general/Several/bin64/dunitx-results.xml
unittests/general/Several/bin64/sqlitetest.db
unittests/general/Several/bin64/firebirdtest2.fdb
unittests/general/Several/bin64/firebirdtest.fdb
unittests/general/Several/bin32/sqlitetest.db
unittests/general/Several/bin32/firebirdtest2.fdb
unittests/general/Several/bin32/firebirdtest.fdb
samples/WineCellarSample/winecellarclient_mobile/Android64/
10 changes: 10 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@
"generate-nullables"
],
"console": "integratedTerminal"
},
{
"name": "Python TASK build-samples",
"type": "python",
"request": "launch",
"module": "invoke",
"args": [
"build-samples"
],
"console": "integratedTerminal"
}
]
}
213 changes: 110 additions & 103 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# DelphiMVCFramework ![Mentioned in Awesome Go](https://awesome.re/mentioned-badge.svg) ![GitHub All Releases](https://img.shields.io/github/downloads/danieleteti/delphimvcframework/total?label=Downloads)

![](https://img.shields.io/badge/Current%20Version-dmvcframework--3.2.2--nitrogen-blue)
![](https://img.shields.io/badge/Beta%20Version-dmvcframework--3.2.3--radium--beta-red)
![](https://img.shields.io/badge/Current%20Version-dmvcframework--3.2.3--radium-blue)
![](https://img.shields.io/badge/Beta%20Version-dmvcframework--3.3.0--fluorine--beta-red)

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
Expand Down Expand Up @@ -131,7 +131,7 @@ Are you using DMVCFramework? Do you want to say "Thanks"? <a href="https://www.p

> If you are not involved in development or testing, do not clone the repo! Use the Github release!
The last stable version is **dmvcframework-3.2.2-nitrogen** available [here 📥](https://github.com/danieleteti/delphimvcframework/releases/latest). Just download latest release as a zip file and you are ok. The samples are availables as separate zip file downloadable from the same page where you download the release.
The last stable version is **dmvcframework-3.2.3-radium** available [here 📥](https://github.com/danieleteti/delphimvcframework/releases/latest). Just download latest release as a zip file and you are ok. The samples are availables as separate zip file downloadable from the same page where you download the release.

## Book: "DelphiMVCFramework - the official guide"

Expand Down Expand Up @@ -211,6 +211,109 @@ Congratulations to Daniele Teti and all the staff for the excellent work!" -- Ma
> "Our wishes are coming true" -- one Delphi programmer after a small dmvcframework demo for an IT department of a very important national research institute

## What's New in 3.2.3-radium

- ⚡ Default error responses contains the official "reason string" associated to the HTTP status code (this can be a breaking change for some generic client which doesn't correctly interpret the http status code)

- ⚡ Added static method `HTTP_STATUS.ReasonStringFor(HTTPStatusCode)` wich returns the standard `ReasonString` for a given HTTP status code.

- ⚡ Improved handling of `TMVCErrorResponse` information

- ⚡ mid-air-collision handling now uses SHA1 instead of MD5

- ⚡ Added `MVCFramework.Commons.MVC_HTTP_STATUS_CODES` const array containing all the HTTP status codes with its `ReasonString`.

- ⚡ Support for `TObject` descendants in JSONRPC APIs (not only for JSONObject and JSONArray).

- ⚡ New global configuration variable `MVCSerializeNulls`.

- When MVCSerializeNulls = True (default) empty nullables and nil are serialized as json null.
- When MVCSerializeNulls = False empty nullables and nil are not serialized at all.

- ⚡ Nullable types now have `Equal` method support, the new method `TryHasValue(out Value)` works like `HasValue` but returns the contained value if present. Also there is a better "equality check" strategy.

- ⚡ Unit tests now are always executed for Win32 and Win64 bit (both client and server).

- ⚡ Added `TMVCActiveRecord.Refresh` method

- ⚡ Unit test suites generates one NUnit XML output file for each platform

- ⚡ New built-in profiler (usable with Delphi 10.4+) - to profile a block of code, write the following

```delphi
procedure TMyController.ProfilerSample1;
begin
NotProfiled(); //this line is not profiled
//the following begin..end block will be profiled
//timing will be saved in a "profiler" log
begin var lProf := Profiler.Start(Context.ActionQualifiedName);
DoSomething();
DoSomethingElse();
Render('Just executed ' + Context.ActionQualifiedName);
end; // profiler writes automatically to the log
NotProfiled(); //this line is not profiled
end;
procedure TMyController.DoSomething;
begin
begin var lProf := Profiler.Start('DoSomething');
Sleep(100);
end;
end;
procedure TMyController.DoSomethingElse;
begin
begin var lProf := Profiler.Start('DoSomethingElse');
Sleep(100);
DoSomething();
end;
end;
procedure TMyController.NotProfiled;
begin
Sleep(100);
end;
```

The log contains the following lines - check the caller/called relationship shown using `>>` and `<<` and the deep level

```
[>>][ 1][MainControllerU.TMyController.ProfilerSample1] [profiler]
[ >>][ 2][DoSomething] [profiler]
[ <<][ 2][DoSomething][ELAPSED: 00:00:00.1088214] [profiler]
[ >>][ 2][DoSomethingElse] [profiler]
[ >>][ 3][DoSomething] [profiler]
[ <<][ 3][DoSomething][ELAPSED: 00:00:00.1096617] [profiler]
[ <<][ 2][DoSomethingElse][ELAPSED: 00:00:00.2188468] [profiler]
[<<][ 1][MainControllerU.TMyController.ProfilerSample1][ELAPSED: 00:00:00.3277806] [profiler]
```

To get more info check the "profiling" example.

All profiler logs are generated with a log level `info`. If measured time is greater than `WarningThreshold` the log level is `warning`.

`WarningThreshold` is expressed in milliseconds and by default is equals to 1000.

- ⚡ New `Context` property named `ActionQualifiedName` which contains the currently executed action in the form `UnitName.ClassName.ActionName`. It is available where the `Context` property is available. Obviously is not available in the `OnBeforeRouting` middleware events.
- ⚡ Added ObjectPool and IntfObjectPool (and related unit tests). Thanks to our sponsor [Vivaticket S.p.A.](https://corporate.vivaticket.com)
- ⚡ Method `procedure Render(const AErrorCode: Integer; const AErrorMessage: string = '' ... ` has been renamed to `RenderStatusMessage` with a better parameter names.
-`IMVCJSONRPCExecutor` supports async call. Thanks to our sponsor [Orion Law](https://orionlaw.com/). Check the new Async sample in `samples\jsonrpc_with_published_objects\`.
- ⚡ Removed `foTransient` if `TMVCActiveRecord` `FieldOptions`. It became obsolete after introduction of `foReadOnly` and `foWriteOnly`.
- ⚡ Improved `TMVCActiveRecordMiddleware`. Now it can handle multiple connections for the same request. Also, you can completely omit the 'default' connection and just specify wich connection you want to use before starting to create your `TMVCActiveRecord` inherited entities.

### Bug Fix in 3.2.3-radium
- Fixed a rendering problem in swagger interface format in case of specific JSON structure
- Fix [issue 594](https://github.com/danieleteti/delphimvcframework/issues/594) (Thanks to [biware-repo](https://github.com/biware-repo))
- Fix [issue 595](https://github.com/danieleteti/delphimvcframework/issues/595)
- Fix [issue 590](https://github.com/danieleteti/delphimvcframework/issues/590)
- Fix [issue 490](https://github.com/danieleteti/delphimvcframework/issues/490)
- Fix [Issue 583](https://github.com/danieleteti/delphimvcframework/issues/583) (Thanks to [Marcelo Jaloto](https://github.com/marcelojaloto))
- Fix [Issue 585](https://github.com/danieleteti/delphimvcframework/issues/585)

More details about dmvcframework-3.2.3-radium fixes [here](https://github.com/danieleteti/delphimvcframework/milestone/8?closed=1)


## What's new in DelphiMVCFramework-3.2.2-nitrogen

- ⚡New! Support for Delphi 11.x Alexandria
Expand Down Expand Up @@ -1408,109 +1511,13 @@ end;

DelphiMVCFramework roadmap is always updated as-soon-as the features planned are implemented. Check the roadmap [here](roadmap.md).

## Next Release: 3.2.3-radium-beta ("repo" version)

The current beta release is named 3.2.3-radium-beta. If you want to stay on the-edge or just help the testers, clone the repo and start using it. Be warned: it may contains unstable code.


### What's New in 3.2.3-radium-beta

- Default error responses contains the official "reason string" associated to the HTTP status code (this can be a breaking change for some generic client which doesn't correctly interpret the http status code)

- Added static method `HTTP_STATUS.ReasonStringFor(HTTPStatusCode)` wich returns the standard `ReasonString` for a given HTTP status code.

- Improved handling of `TMVCErrorResponse` information

- mid-air-collision handling now uses SHA1 instead of MD5

- Added `MVCFramework.Commons.MVC_HTTP_STATUS_CODES` const array containing all the HTTP status codes with its `ReasonString`.

- Support for `TObject` descendants in JSONRPC APIs (not only for JSONObject and JSONArray).

- New global configuration variable `MVCSerializeNulls`.
When MVCSerializeNulls = True (default) empty nullables and nil are serialized as json null.
When MVCSerializeNulls = False empty nullables and nil are not serialized at all.

- Nullable types now have `Equal` method support, the new method `TryHasValue(out Value)` works like `HasValue` but returns the contained value if present. Also there is a better "equality check" strategy.

- Unit tests now are always executed for Win32 and Win64 bit (both client and server).

- Added `TMVCActiveRecord.Refresh` method

- Unit test suites generates one NUnit XML output file for each platform

- New built-in profiler (usable with Delphi 10.4+) - to profile a block of code, write the following

```delphi
procedure TMyController.ProfilerSample1;
begin
NotProfiled(); //this line is not profiled
//the following begin..end block will be profiled
//timing will be saved in a "profiler" log
begin var lProf := Profiler.Start(Context.ActionQualifiedName);
DoSomething();
DoSomethingElse();
Render('Just executed ' + Context.ActionQualifiedName);
end; // profiler writes automatically to the log
NotProfiled(); //this line is not profiled
end;
procedure TMyController.DoSomething;
begin
begin var lProf := Profiler.Start('DoSomething');
Sleep(100);
end;
end;
procedure TMyController.DoSomethingElse;
begin
begin var lProf := Profiler.Start('DoSomethingElse');
Sleep(100);
DoSomething();
end;
end;
procedure TMyController.NotProfiled;
begin
Sleep(100);
end;
```

The log contains the following lines - check the caller/called relationship shown using `>>` and `<<` and the deep level

```
[>>][ 1][MainControllerU.TMyController.ProfilerSample1] [profiler]
[ >>][ 2][DoSomething] [profiler]
[ <<][ 2][DoSomething][ELAPSED: 00:00:00.1088214] [profiler]
[ >>][ 2][DoSomethingElse] [profiler]
[ >>][ 3][DoSomething] [profiler]
[ <<][ 3][DoSomething][ELAPSED: 00:00:00.1096617] [profiler]
[ <<][ 2][DoSomethingElse][ELAPSED: 00:00:00.2188468] [profiler]
[<<][ 1][MainControllerU.TMyController.ProfilerSample1][ELAPSED: 00:00:00.3277806] [profiler]
```

To get more info check the "profiling" example.

All profiler logs are generated with a log level `info`. If measured time is greater than `WarningThreshold` the log level is `warning`.

`WarningThreshold` is expressed in milliseconds and by default is equals to 1000.
## Next Release: 3.3.0-fluorine-beta ("repo" version)

- New `Context` property named `ActionQualifiedName` which contains the currently executed action in the form `UnitName.ClassName.ActionName`. It is available where the `Context` property is available. Obviously is not available in the `OnBeforeRouting` middleware events.
- Added ObjectPool and IntfObjectPool (and related unit tests). Thanks to our sponsor [Vivaticket S.p.A.](https://corporate.vivaticket.com)
- [Issue 583](https://github.com/danieleteti/delphimvcframework/issues/583) (Thanks to [Marcelo Jaloto](https://github.com/marcelojaloto))
- [Issue 585](https://github.com/danieleteti/delphimvcframework/issues/585)
- Method `procedure Render(const AErrorCode: Integer; const AErrorMessage: string = '' ... ` has been renamed to `RenderStatusMessage` with a better parameter names.
- `IMVCJSONRPCExecutor` supports async call. Thanks to our sponsor [Orion Law](https://orionlaw.com/). Check the new Async sample in `samples\jsonrpc_with_published_objects\`.
- Removed `foTransient` if TMVCActiveRecord FieldOptions. It became obsolete after introduction of `foReadOnly` and `foWriteOnly`.
- Improved `TMVCActiveRecordMiddleware`. Now it can handle multiple connections for the same request. Also, you can completely omit the 'default' connection and just specify wich connection you want to use before starting to create your `TMVCActiveRecord` inherited entities.
The current beta release is named 3.3.0-fluorine-beta. If you want to stay on the-edge or just help the testers, clone the repo and start using it. Be warned: it may contains unstable code.

#### Bug Fix in 3.2.3-radium-beta
- Fixed a rendering problem in swagger interface format in case of specific JSON structure
- Fix [issue 594](https://github.com/danieleteti/delphimvcframework/issues/594) (Thanks to [biware-repo](https://github.com/biware-repo))
- Fix [issue 595](https://github.com/danieleteti/delphimvcframework/issues/595)
- Fix [issue 590](https://github.com/danieleteti/delphimvcframework/issues/590)
- Fix [issue 490](https://github.com/danieleteti/delphimvcframework/issues/490)
## What's new in: 3.3.0-fluorine-beta ("repo" version)

Nothing, so far

## Trainings, consultancy or custom development service
As you know, good support on open source software is a must for professional users.
Expand Down
8 changes: 4 additions & 4 deletions samples/ISAPI/ISAPI/isapiapp.dpr
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ uses
Web.WebBroker,
Web.Win.ISAPIApp,
Web.Win.ISAPIThreadPool,
MainDataModuleUnit in '..\..\winecellarserver\MainDataModuleUnit.pas' {WineCellarDataModule: TDataModule},
MainWebModuleUnit in '..\..\winecellarserver\MainWebModuleUnit.pas' {wm: TWebModule},
WineCellarAppControllerU in '..\..\winecellarserver\WineCellarAppControllerU.pas',
WinesBO in '..\..\winecellarserver\WinesBO.pas';
MainDataModuleUnit in '..\..\WineCellarSample\winecellarserver\MainDataModuleUnit.pas' {WineCellarDataModule: TDataModule},
MainWebModuleUnit in '..\..\WineCellarSample\winecellarserver\MainWebModuleUnit.pas' {wm: TWebModule},
WinesBO in '..\..\WineCellarSample\winecellarserver\WinesBO.pas',
WineCellarAppControllerU in '..\..\WineCellarSample\winecellarserver\WineCellarAppControllerU.pas';

{$R *.res}

Expand Down
Loading

0 comments on commit 3a43849

Please sign in to comment.