Exporting Binds

Exporting Binds: The ease of sharing resources between modules in ModularBr.

Exporting Binds

Some modules are created with the sole purpose of exporting binds to other modules, and that's where the "ExportedBinds" method comes in. This method is used to define the binds that the module exports, making them available for other modules that wish to import them.

unit export.module;

interface

uses
  dmfbr.module,
  nfe.controller;

type
  TExportModule = class(TModule)
  public
    function ExportedBinds: TExportedBinds; override;
  end;

implementation

{ TAppModule }

function TExportModule.ExportedBinds: TExportedBinds;
begin
  Result := [Bind<TControllerServer>.Singleton];
end;

end.

WARNING

Module export is only for Binds. Routes will not be exposed.

Last updated