You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
using Facade.Subsystems;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace Facade.Facades
|
|
|
|
|
{
|
|
|
|
|
internal class Facade
|
|
|
|
|
{
|
|
|
|
|
protected Subsystem1 _subsystem1;
|
|
|
|
|
protected Subsystem2 _subsystem2;
|
|
|
|
|
|
|
|
|
|
public Facade(Subsystem1 subsystem1, Subsystem2 subsystem2)
|
|
|
|
|
{
|
|
|
|
|
_subsystem1 = subsystem1;
|
|
|
|
|
_subsystem2 = subsystem2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string Operation()
|
|
|
|
|
{
|
|
|
|
|
StringBuilder builder = new StringBuilder();
|
|
|
|
|
builder.AppendLine("Facade initializes subsystems:");
|
|
|
|
|
builder.AppendLine(_subsystem1.Operation1());
|
|
|
|
|
builder.AppendLine(_subsystem2.Operation1());
|
|
|
|
|
builder.AppendLine("Facade order subsystems to perform the action:");
|
|
|
|
|
builder.AppendLine(_subsystem1.OperationN());
|
|
|
|
|
builder.AppendLine(_subsystem2.OperationN());
|
|
|
|
|
|
|
|
|
|
return builder.ToString();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|