-
Notifications
You must be signed in to change notification settings - Fork 3
/
eAtasOrais.Model.Factory.pas
70 lines (54 loc) · 1.3 KB
/
eAtasOrais.Model.Factory.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
unit eAtasOrais.Model.Factory;
interface
uses
eAtasOrais.Model.Interfaces;
Type
TModelFactory = Class(TInterfacedObject, iModelFactory)
Private
Public
Constructor Create;
Destructor Destroy; Override;
Class function New: iModelFactory;
Function Conexao : iModelConexaoSOP;
Function Configuracao : iModelConfiguracao;
Function Funcoes : iModelFuncoes;
Function Atas : iModelAtas;
End;
implementation
uses
eAtasOrais.Model.Configuracao, eAtasOrais.Model.ConexaoBD, eAtasOrais.Model.ConexaoSOP,
eAtasOrais.Model.Funcoes;
{ TModelFactory }
function TModelFactory.Atas: iModelAtas;
begin
//Result := TModelAtas.new;
end;
function TModelFactory.Conexao : iModelConexaoSOP;
Var FTestes : Boolean;
begin
FTestes := self.Configuracao.Testes;
case FTestes of
True : Result := tModelConexaoBD.New;
False : Result := tModelConexaoSOP.New;
end;
end;
function TModelFactory.Configuracao: iModelConfiguracao;
begin
Result := TModelConfiguracao.New;
end;
constructor TModelFactory.Create;
begin
end;
destructor TModelFactory.Destroy;
begin
inherited;
end;
function TModelFactory.Funcoes: iModelFuncoes;
begin
Result := tmodelfuncoes.New;
end;
class function TModelFactory.New: iModelFactory;
begin
Result := Self.Create;
end;
end.