01 2022 档案

摘要:术语 节点深度:对任意节点x,x节点的深度表示为根节点到x节点的路径长度。所以根节点深度为0,第二层节点深度为1,以此类推 节点高度:对任意节点x,叶子节点到x节点的路径长度就是节点x的高度 树的深度:一棵树中节点的最大深度就是树的深度,也称为高度 父节点:若一个节点含有子节点,则这个节点称为其子节 阅读全文 »
posted @ 2022-01-19 17:19 icxl 阅读(206) 评论(0) 推荐(0) 编辑
摘要:侠盗飞车存档 钱 人物坐标 目前任务关卡 犯罪星级 public class GameData { public double Money { get; set; } public int TaskLevel { get; set; } public int X { get; set; } publ 阅读全文 »
posted @ 2022-01-17 10:44 icxl 阅读(38) 评论(0) 推荐(0) 编辑
摘要:例子 访问者模式 Element → AbsPlatform -》 User,Guild,GuildMember Visitor → AbsVisitor -》 教会管理员,教会创建者,平台管理员 ObjectStructure → BusinessReport public abstract cl 阅读全文 »
posted @ 2022-01-14 20:52 icxl 阅读(76) 评论(0) 推荐(0) 编辑
摘要:例子 责任链 教会(同工,管理员,创建者) 修改教会成员名称(同工) 去教会祷告请假(管理员) 教会关门,隐退(创建者) public abstract class AbsGuildManager { private string _name; protected AbsGuildManager S 阅读全文 »
posted @ 2022-01-14 20:49 icxl 阅读(68) 评论(0) 推荐(0) 编辑
摘要:例子 对一个价钱做不同策略;原价,打折,返利 public abstract class CashSuper { public abstract double AcceptCash(double money); } public class NormalCash : CashSuper { publ 阅读全文 »
posted @ 2022-01-14 20:47 icxl 阅读(71) 评论(0) 推荐(0) 编辑
摘要:例子 我们经常坐电梯都知道,电梯有多种状态,就按最简单的来说,包括运行状态、停止状态、开门状态、闭门状态。下面就以电梯运行为例,举一个具体的实例,UML图如下: public abstract class LiftState { protected LiftContext LiftContext; 阅读全文 »
posted @ 2022-01-14 20:45 icxl 阅读(329) 评论(0) 推荐(0) 编辑
摘要:例子 打牌(斗地主规则) 初始钱50 赢牌对面扣钱 地主赢扣20(地主40块) 农民赢扣20(农民一人10块) public abstract class AbsMediator { public abstract void Register(Person obj); /// <summary> / 阅读全文 »
posted @ 2022-01-14 20:43 icxl 阅读(22) 评论(0) 推荐(0) 编辑
摘要:例子 教会(Subject) 教会成员(Observer) public class GuildSubject { private List<AbsSubscriber<GuildSubject>> _subscribers; public GuildSubject(string guildName 阅读全文 »
posted @ 2022-01-14 20:41 icxl 阅读(70) 评论(0) 推荐(0) 编辑
摘要:例子 public interface ITerator<TSource> { TSource Current { get; } bool HasNext(); void MoveNext(); } public class ArrayIterator<TSource> : ITerator<TSo 阅读全文 »
posted @ 2022-01-14 20:40 icxl 阅读(18) 评论(0) 推荐(0) 编辑
摘要:例子 public class CommandLineArgs { public CommandLineArgs(string command, params string[] args) { Command = command; Args = args; } public string Comma 阅读全文 »
posted @ 2022-01-14 20:38 icxl 阅读(79) 评论(0) 推荐(0) 编辑
摘要:例子 妈妈买菜,爸爸买菜,自己买菜 public abstract class AbsBuyVegetable { public virtual void BuyVegetable() { BuyShuCai(); BuyMeat(); BuyComplete(); } /// <summary> 阅读全文 »
posted @ 2022-01-14 20:37 icxl 阅读(29) 评论(0) 推荐(0) 编辑
摘要:请求接口 代理请求接口 public class HttpRequest { public void Post() { Console.WriteLine("发送Post请求"); } } public class HttpRequestProxy { private readonly HttpRe 阅读全文 »
posted @ 2022-01-13 21:00 icxl 阅读(24) 评论(0) 推荐(0) 编辑
摘要:字体 享元 public class FontFlyWeight { //享元对象标识,用于作为存入键值对中的键值 public const string NAME = ""; private char fontContent; public char FontContent { get => fo 阅读全文 »
posted @ 2022-01-13 20:58 icxl 阅读(73) 评论(0) 推荐(0) 编辑
摘要:模拟下单付款 下单付款后, 库存Manager减一,钱包Manager public class PlayFace { private readonly GoodsManager _goodsManager; private readonly WalletManager _walletManager 阅读全文 »
posted @ 2022-01-13 20:56 icxl 阅读(67) 评论(0) 推荐(0) 编辑
摘要:例子 透明组合 部门 -》公司,部门,部门小组,员工 public abstract class AbsComponent { protected string Name { get; } protected NodeType NodeType { get; } protected AbsCompo 阅读全文 »
posted @ 2022-01-13 20:54 icxl 阅读(58) 评论(0) 推荐(0) 编辑
摘要:例子 本地文件,加密装饰器,压缩装饰器 public interface IDataSource { /// <summary> /// 写入 /// </summary> /// <param name="id"></param> /// <param name="data"></param> v 阅读全文 »
posted @ 2022-01-13 20:49 icxl 阅读(62) 评论(0) 推荐(0) 编辑
摘要:例子 给用户在不同平台发送消息(微信,APP,H5) public abstract class AbsUserManager { protected AbsUserManager(AbsUserManagerProvider userManagerProvider) { UserManagerPr 阅读全文 »
posted @ 2022-01-13 20:44 icxl 阅读(25) 评论(0) 推荐(0) 编辑
摘要:xxxVideo public sealed class PornAdaptee { public void Watch(Guid videoId) { Console.WriteLine($"查看视频{videoId.ToString()}"); } public void Download(Gu 阅读全文 »
posted @ 2022-01-13 20:38 icxl 阅读(173) 评论(0) 推荐(0) 编辑
摘要:抽象构造 AbsPlatformManagerBuilder,H5PlatformManagerBuilder,AppPlatformManagerBuilder,AbsPlatformManager,H5PlatformManager,AppPlatformManager,USAH5Platfor 阅读全文 »
posted @ 2022-01-13 01:29 icxl 阅读(47) 评论(0) 推荐(0) 编辑
摘要:简单工厂 DBProvider 点击查看代码 public interface IDbProvider { /// <summary> /// 获取db客户端 /// </summary> /// <returns></returns> void PrintDbClient(); } public 阅读全文 »
posted @ 2022-01-13 01:02 icxl 阅读(27) 评论(0) 推荐(0) 编辑
摘要:public class RedisManagerSingleton { private static RedisManagerSingleton _redisManagerSingleton; private static readonly object _lock = new object(); 阅读全文 »
posted @ 2022-01-13 00:53 icxl 阅读(20) 评论(0) 推荐(0) 编辑
摘要:三角形 实线三角形 -》继承父类 点击查看代码 /// <summary> /// 人 /// </summary> public class Person { } /// <summary> /// cxl /// </summary> public class Cxl : Person { } 阅读全文 »
posted @ 2022-01-13 00:50 icxl 阅读(28) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示