Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unit CargadeTabelas.Factory;
- interface
- uses CargaTabelas.Controller, ServerCadProd;
- type
- IAbstractCargaProduto = interface
- ['{3DEA3773-00B1-43A9-A76F-D22EAF6D0A20}']
- end;
- IAbstractFactoryCargaProd = interface
- ['{0168A492-7D0E-4C13-A3C0-FBE5EB0FEDAF}']
- function CreateInterfaceCargaProd: TCargaTabelasController;
- function CreateIAbstractProduct: IAbstractCargaProduto;
- end;
- TConcreteCargaProduto = class(TInterfacedObject, IAbstractCargaProduto)
- end;
- TConcreteCarga = class(TInterfacedObject, IAbstractFactoryCargaProd)
- function CreateInterfaceCargaProd: TCargaTabelasController;
- function CreateIAbstractProduct: IAbstractCargaProduto;
- function CreateServerCadProd:TServerCadProd;
- end;
- var CargaProdGeneric: TConcreteCarga;
- var CargaController: TCargaTabelasController;
- var CdsServerProd: TServerCadProd;
- implementation
- function TConcreteCarga.CreateIAbstractProduct: IAbstractCargaProduto;
- begin
- Result := TConcreteCargaProduto.Create();
- end;
- function TConcreteCarga.CreateInterfaceCargaProd: TCargaTabelasController;
- begin
- result := TCargaTabelasController.Create;
- CargaController := Result;
- end;
- function TConcreteCarga.CreateServerCadProd: TServerCadProd;
- begin
- result:= TServerCadProd.Create;
- CdsServerProd:= result;
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement