Skip to content

Instantly share code, notes, and snippets.

@viniciussanchez
Created May 4, 2021 11:36
Show Gist options
  • Save viniciussanchez/0afef51f73729865f4e7fe68f652ab14 to your computer and use it in GitHub Desktop.
Save viniciussanchez/0afef51f73729865f4e7fe68f652ab14 to your computer and use it in GitHub Desktop.
Violação do princípio DIP do SOLID
unit Solid.DIP.Violacao;
interface
type
TFirebirdConnection = class
public
procedure Connect;
end;
IAves = interface
['{1F0490B4-0D6D-4BDE-A28A-8E1E2E717874}']
procedure Salvar;
end;
TPinguim = class(TInterfacedObject, IAves)
private
FConnection: TFirebirdConnection;
private
procedure Salvar;
end;
implementation
{ TFirebirdConnection }
procedure TFirebirdConnection.Connect;
begin
end;
{ TPinguim }
procedure TPinguim.Salvar;
begin
FConnection := TFirebirdConnection.Create;
end;
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment