Skip to content

Commit

Permalink
Facade
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasCancio committed Jan 14, 2021
1 parent 1274bed commit 8ed8a29
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 4 deletions.
36 changes: 36 additions & 0 deletions PatternsEstruturais/Facade/Facade.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Facade
{
public class Facade
{
private SubSistemaUm um;

private SubSistemaDois dois;

private SubSistemaTres tres;

public Facade()
{
this.um = new SubSistemaUm();
this.dois = new SubSistemaDois();
this.tres = new SubSistemaTres();
}

public void MetodoA()
{
Console.WriteLine("\nMétodoA() -----");
this.dois.MetodoDois();
this.tres.MetodoTres();
}

public void MetodoB()
{
Console.WriteLine("\nMétodoB() -----");
this.um.MetodoUm();
this.tres.MetodoTres();
}
}
}
8 changes: 8 additions & 0 deletions PatternsEstruturais/Facade/Facade.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>

</Project>
14 changes: 14 additions & 0 deletions PatternsEstruturais/Facade/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;

namespace Facade
{
class Program
{
static void Main(string[] args)
{
Facade facade = new Facade();
facade.MetodoA();
facade.MetodoB();
}
}
}
12 changes: 12 additions & 0 deletions PatternsEstruturais/Facade/SubSistemaDois.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;

namespace Facade
{
public class SubSistemaDois
{
public void MetodoDois()
{
Console.WriteLine("Método do Subsistema Dois");
}
}
}
12 changes: 12 additions & 0 deletions PatternsEstruturais/Facade/SubSistemaTres.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;

namespace Facade
{
public class SubSistemaTres
{
public void MetodoTres()
{
Console.WriteLine("Método do Subsistema Tres");
}
}
}
12 changes: 12 additions & 0 deletions PatternsEstruturais/Facade/SubSistemaUm.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;

namespace Facade
{
public class SubSistemaUm
{
public void MetodoUm()
{
Console.WriteLine("Método do Subsistema Um");
}
}
}
14 changes: 10 additions & 4 deletions PatternsEstruturais/PatternsEstruturais.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30804.86
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Adapter", "Adapter\Adapter.csproj", "{55F89ED5-E95B-4392-8320-C47E32B860B7}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Adapter", "Adapter\Adapter.csproj", "{55F89ED5-E95B-4392-8320-C47E32B860B7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bridge", "Bridge\Bridge.csproj", "{02D55463-CDED-468F-9139-94FA89E255FA}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bridge", "Bridge\Bridge.csproj", "{02D55463-CDED-468F-9139-94FA89E255FA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Composite", "Composite\Composite.csproj", "{45CCBC20-6C3E-4903-994D-149446B2F51A}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Composite", "Composite\Composite.csproj", "{45CCBC20-6C3E-4903-994D-149446B2F51A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Decorator", "Decorator\Decorator.csproj", "{A1691928-5028-4FF7-8BEC-CAC23E760596}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Decorator", "Decorator\Decorator.csproj", "{A1691928-5028-4FF7-8BEC-CAC23E760596}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facade", "Facade\Facade.csproj", "{A0CB329A-28F4-4BDA-A889-168579E32B1B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -33,6 +35,10 @@ Global
{A1691928-5028-4FF7-8BEC-CAC23E760596}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A1691928-5028-4FF7-8BEC-CAC23E760596}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A1691928-5028-4FF7-8BEC-CAC23E760596}.Release|Any CPU.Build.0 = Release|Any CPU
{A0CB329A-28F4-4BDA-A889-168579E32B1B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A0CB329A-28F4-4BDA-A889-168579E32B1B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A0CB329A-28F4-4BDA-A889-168579E32B1B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A0CB329A-28F4-4BDA-A889-168579E32B1B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down

0 comments on commit 8ed8a29

Please sign in to comment.