08 桥接模式/Program.cs
(完整代码) 953Busing System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace 桥接模式
{
//例如:通讯录和游戏 是手机必备的两款软件。而手机有各种品牌(A、B、C---)
//手机软件和手机品牌 两个类分离开。。。再增加新的品牌或者软件 都不会影响其他
class Program
{
static void Main(string[] args)
{
HandsetBrand hb= new HandsetBrandA(); //创建一个A品牌
hb.SetSoft(new Game());
hb.Runer();
hb.SetSoft(new AddressList());
hb.Runer();
HandsetBrand hb2 = new HandsetBrandB(); //创建一个A品牌
hb2.SetSoft(new Game());
hb2.Runer();
hb2.SetSoft(new AddressList());
hb2.Runer();
Console.ReadLine();
}
}
}
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。