摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace GeovinduDu { [AttributeU
阅读全文
摘要:Single Responsibility Principle SOLID Design Patterns SOLID is an acronym for five principles of architecture.S – Single Responsibility PrincipleO – O
阅读全文
摘要:GeovinDuState.py #状态模式 State Pattern class ComputerState(object): name = "state" allowed = [] def switch(self, state): """ Switch to new state """ if
阅读全文
摘要:GeovinDuTemplate.py # 模板方法模式 Template Method Pattern def get_text(): return "text 文件" """ method to get the xml version of file""" def get_xml(): retu
阅读全文
摘要:GeovinDuObserver.py # 观察者模式 Observer Pattern # The Observer class that recieves updates from the ticker on a specific symbol: class TickerObserver(obj
阅读全文
摘要:DuChain.py # 责任链模式 Chain of Responsibility import enum # Item Types: # An enum we'll attach to every game object to specify type: # Requires Python 3.
阅读全文
摘要:DuFlyweight.py # 享元模式 Flyweight Pattern geovindu,Geovin Du,涂聚文 import time class Arrow: def __init__(self, x, y, z, velocity): self.x = x self.y = y s
阅读全文
摘要:DuFacade.py import os import re import threading # 外观模式 Facade Pattern class _IgnitionSystem(object): @staticmethod def produce_spark(): return True c
阅读全文
摘要:DuComposite.py # 组合模式 Composite Pattern from __future__ import annotations from abc import ABC, abstractmethod from typing import List class Component
阅读全文
摘要:DuBuilder.py # 生成器模式 Builder Pattern from __future__ import annotations from abc import ABC, abstractmethod from typing import Any class Builder(ABC):
阅读全文
摘要:Adapte.py ## 适配器模式 Adapte Pattern geovindu, Geovin Du eidt class Target: """ The Target defines the domain-specific interface used by the client code.
阅读全文
摘要:var stop = function() { var stream = video.srcObject; var tracks = stream.getTracks(); for (var i = 0; i < tracks.length; i++) { var track = tracks[i]
阅读全文
摘要:/// <summary> ///责任链模式 Chain of Responsibility Pattern 亦称: 职责链模式、命令链、CoR、Chain of Command、Chain of Responsibility /// geovindu,Geovin Du edit /// </su
阅读全文
摘要:/// <summary> /// 状态模式 State Pattern /// geovindu, Geovin Du edit /// </summary> interface IPossibleStates { //Users can press any of these buttons-On
阅读全文
摘要:/// <summary> /// Receiver Class /// 命令模式 Command Pattern 亦称: 动作、事务、Action、Transaction、Command /// geovindu,Geovin Du eidt /// </summary> public class
阅读全文
摘要:/// <summary> /// 访问者模式 Visitor Pattern /// geovindu,Geovin Du eidt /// </summary> interface IEmployee { /// <summary> /// To set an employee name ///
阅读全文
摘要:/// <summary> ///组合模式 Composite Pattern /// geovindu,Geovin Du edit /// /// </summary> interface IEmployee { /// <summary> /// To set an employee name
阅读全文
摘要:#region Animal Hierarchy /* * Both the Dog and Tiger classes will * implement the IAnimal interface method. */ /// <summary> /// 工厂方法模式 Factory Method
阅读全文
摘要:/// <summary> /// Prototype Pattern原型设计模式 /// </summary> public abstract class BasicCar { /// <summary> /// /// </summary> public int basePrice = 0, o
阅读全文