精华内容
下载资源
问答
  • Design Pattern - Prototype(C#)

    万次阅读 多人点赞 2019-02-02 17:29:01
    分享一个大牛的人工智能教程。零基础!通俗易懂!风趣幽默!希望你也加入到人工智能的队伍中来!... Definition Specify the kind of objects to create using a prototypical instance, and create new objects by ...

    分享一个大牛的人工智能教程。零基础!通俗易懂!风趣幽默!希望你也加入到人工智能的队伍中来!请点击http://www.captainbed.net 

    Definition

    Specify the kind of objects to create using a prototypical instance, and create new objects by copying this prototype.

    Participants

        The classes and/or objects participating in this pattern are:

    • Prototype (ColorPrototype)
      • Declares an interface for cloning itself
    • ConcretePrototype (Color)
      • Implements an operation for cloning itself
    • Client (ColorManager)
      • Creates a new object by asking a prototype to clone itself

    Sample Code in C#


    This structural code demonstrates the Prototype pattern in which new objects are created by copying pre-existing objects (prototypes) of the same class.

    /*
     * Structural Prototype Design Pattern.
     */
    
    namespace Prototype.Sample
    {
        using System;
    
        /// <summary>
        /// Startup class for Structural Prototype Design Pattern.
        /// </summary>
        internal static class Program
        {
            #region Methods
    
            /// <summary>
            /// Entry point into console application.
            /// </summary>
            private static void Main()
            {
                // Create two instances and clone each.
                var p1 = new ConcretePrototype1("I");
                var c1 = (ConcretePrototype1) p1.Clone();
                Console.WriteLine("Cloned: {0}", c1.Id);
                var p2 = new ConcretePrototype2("II");
                var c2 = (ConcretePrototype2) p2.Clone();
                Console.WriteLine("Cloned: {0}", c2.Id);
            }
    
            #endregion
        }
    
        /// <summary>
        /// The 'Prototype' abstract class.
        /// </summary>
        internal abstract class Prototype
        {
            #region Constructors and Destructors
    
            /// <summary>
            /// Initializes a new instance of the <see cref="Prototype"/> class.
            /// </summary>
            /// <param name="id">
            /// The id.
            /// </param>
            protected Prototype(string id)
            {
                Id = id;
            }
    
            #endregion
    
            #region Public Properties
    
            /// <summary>
            /// Gets the id.
            /// </summary>
            public string Id { get; }
    
            #endregion
    
            #region Public Methods and Operators
    
            /// <summary>
            /// Clone.
            /// </summary>
            /// <returns>
            /// The <see cref="Prototype"/>.
            /// </returns>
            public abstract Prototype Clone();
    
            #endregion
        }
    
        /// <summary>
        /// A 'ConcretePrototype' class.
        /// </summary>
        internal class ConcretePrototype1 : Prototype
        {
            #region Constructors and Destructors
    
            /// <summary>
            /// Initializes a new instance of the <see cref="ConcretePrototype1"/> class.
            /// </summary>
            /// <param name="id">
            /// The id.
            /// </param>
            public ConcretePrototype1(string id)
                : base(id)
            {
            }
    
            #endregion
    
            #region Public Methods and Operators
    
            /// <summary>
            /// Clone.
            /// Returns a shallow copy.
            /// </summary>
            /// <returns>
            /// The <see cref="Prototype"/>.
            /// </returns>
            public override Prototype Clone()
            {
                return (Prototype) MemberwiseClone();
            }
    
            #endregion
        }
    
        /// <summary>
        /// A 'ConcretePrototype' class.
        /// </summary>
        internal class ConcretePrototype2 : Prototype
        {
            #region Constructors and Destructors
    
            /// <summary>
            /// Initializes a new instance of the <see cref="ConcretePrototype2"/> class.
            /// </summary>
            /// <param name="id">
            /// The id.
            /// </param>
            public ConcretePrototype2(string id)
                : base(id)
            {
            }
    
            #endregion
    
            #region Public Methods and Operators
    
            /// <summary>
            /// Clone.
            /// Returns a shallow copy.
            /// </summary>
            /// <returns>
            /// The <see cref="Prototype"/>.
            /// </returns>
            public override Prototype Clone()
            {
                return (Prototype) MemberwiseClone();
            }
    
            #endregion
        }
    }
    
    // Output:
    /*
    Cloned: I
    Cloned: II
    
    */

    This real-world code demonstrates the Prototype pattern in which new Color objects are created by copying pre-existing, user-defined Colors of the same type.

    /*
     * Real-World Prototype Design Pattern.
     */
    
    namespace Prototype.RealWorld
    {
        using System;
        using System.Collections.Generic;
    
        /// <summary>
        /// Startup class for Real-World Prototype Design Pattern.
        /// </summary>
        internal static class Program
        {
            #region Methods
    
            /// <summary>
            /// Entry point into console application.
            /// </summary>
            private static void Main()
            {
                var colorManager = new ColorManager
                {
                    ["red"] = new Color(255, 0, 0),
                    ["green"] = new Color(0, 255, 0),
                    ["blue"] = new Color(0, 0, 255),
                    ["angry"] = new Color(255, 54, 0),
                    ["peace"] = new Color(128, 211, 128),
                    ["flame"] = new Color(211, 34, 20)
                };
    
                // User clones selected colors.
                var color1 = colorManager["red"].Clone() as Color;
                var color2 = colorManager["peace"].Clone() as Color;
                var color3 = colorManager["flame"].Clone() as Color;
            }
    
            #endregion
        }
    
        /// <summary>
        /// The 'Prototype' abstract class.
        /// </summary>
        internal abstract class Prototype
        {
            #region Public Methods and Operators
    
            /// <summary>
            /// Clone.
            /// </summary>
            /// <returns>
            /// The <see cref="Prototype"/>.
            /// </returns>
            public abstract Prototype Clone();
    
            #endregion
        }
    
        /// <summary>
        /// The 'ConcretePrototype' class.
        /// </summary>
        internal class Color : Prototype
        {
            #region Fields
    
            /// <summary>
            /// The blue.
            /// </summary>
            private readonly int _blue;
    
            /// <summary>
            /// The green.
            /// </summary>
            private readonly int _green;
    
            /// <summary>
            /// The red.
            /// </summary>
            private readonly int _red;
    
            #endregion
    
            #region Constructors and Destructors
    
            /// <summary>
            /// Initializes a new instance of the <see cref="Color"/> class.
            /// </summary>
            /// <param name="red">
            /// The red.
            /// </param>
            /// <param name="green">
            /// The green.
            /// </param>
            /// <param name="blue">
            /// The blue.
            /// </param>
            public Color(int red, int green, int blue)
            {
                _red = red;
                _green = green;
                _blue = blue;
            }
    
            #endregion
    
            #region Public Methods and Operators
    
            /// <summary>
            /// Clone.
            /// </summary>
            /// <returns>
            /// The <see cref="Prototype"/>.
            /// </returns>
            public override Prototype Clone()
            {
                Console.WriteLine("Cloning color RGB: {0,3},{1,3},{2,3}", _red, _green, _blue);
                return MemberwiseClone() as Prototype;
            }
    
            #endregion
        }
    
        /// <summary>
        /// Prototype manager.
        /// </summary>
        internal class ColorManager
        {
            #region Fields
    
            /// <summary>
            /// The colors.
            /// </summary>
            private readonly Dictionary<string, Prototype> _colors = new Dictionary<string, Prototype>();
    
            #endregion
    
            #region Public Indexers
    
            /// <summary>
            /// This.
            /// </summary>
            /// <param name="key">
            /// The key.
            /// </param>
            /// <returns>
            /// The <see cref="Prototype"/>.
            /// </returns>
            public Prototype this[string key]
            {
                get { return _colors[key]; }
    
                set { _colors.Add(key, value); }
            }
    
            #endregion
        }
    }
    
    // Output:
    /*
    Cloning color RGB: 255,  0,  0
    Cloning color RGB: 128,211,128
    Cloning color RGB: 211, 34, 20
    
    */

     

    展开全文
  • Design Pattern - Template Method(C#)

    万次阅读 多人点赞 2019-02-26 20:29:04
    分享一个大牛的人工智能教程。零基础!通俗易懂!风趣幽默!希望你也加入到人工智能的队伍中来!... Definition Define the skeleton of an algorithm in an operation, deferring some stepsto subclasses....

    分享一个大牛的人工智能教程。零基础!通俗易懂!风趣幽默!希望你也加入到人工智能的队伍中来!请点击http://www.captainbed.net 

    Definition

    Define the skeleton of an algorithm in an operation, deferring some steps to subclasses. Template Method lets subclasses redefine certain steps of an algorithm without changing the algorithm's structure.

    Participants

    The classes and/or objects participating in this pattern are:

    • AbstractClass (DataObject)
      • Defines abstract primitive operations that concrete subclasses define to implement steps of an algorithm
      • Implements a template method defining the skeleton of an algorithm. The template method calls primitive operations as well as operations defined in AbstractClass or those of other objects
    • ConcreteClass (CustomerDataObject)
      • Implements the primitive operations or carry out subclass-specific steps of the algorithm

    Sample Code in C#

    This structural code demonstrates the Template method which provides a skeleton calling sequence of methods. One or more steps can be deferred to subclasses which implement these steps without changing the overall calling sequence.

    /*
     * Structural Template Method Pattern.
     */
    
    using System;
    
    namespace TemplateMethod.Sample
    {
        /// <summary>
        /// Startup class for sample Template Method design pattern.
        /// </summary>
        public class Program
        {
            /// <summary>
            /// Entry point into console application.
            /// </summary>
            public static void Main()
            {
                AbstractClass aA = new ConcreteClassA();
                aA.TemplateMethod();
    
                AbstractClass aB = new ConcreteClassB();
                aB.TemplateMethod();
            }
        }
    
        /// <summary>
        /// The 'AbstractClass' abstract class.
        /// </summary>
        public abstract class AbstractClass
        {
            /// <summary>
            /// The primitive operation 1.
            /// </summary>
            public abstract void PrimitiveOperation1();
    
            /// <summary>
            /// The primitive operation 2.
            /// </summary>
            public abstract void PrimitiveOperation2();
    
            /// <summary>
            /// The template method.
            /// </summary>
            public void TemplateMethod()
            {
                PrimitiveOperation1();
                PrimitiveOperation2();
                Console.WriteLine(string.Empty);
            }
        }
    
        /// <summary>
        /// A 'ConcreteClass' class.
        /// </summary>
        public class ConcreteClassA : AbstractClass
        {
            /// <summary>
            /// The primitive operation 1.
            /// </summary>
            public override void PrimitiveOperation1()
            {
                Console.WriteLine("ConcreteClassA.PrimitiveOperation1()");
            }
    
            /// <summary>
            /// The primitive operation 2.
            /// </summary>
            public override void PrimitiveOperation2()
            {
                Console.WriteLine("ConcreteClassA.PrimitiveOperation2()");
            }
        }
    
        /// <summary>
        /// A 'ConcreteClass' class.
        /// </summary>
        public class ConcreteClassB : AbstractClass
        {
            /// <summary>
            /// The primitive operation 1.
            /// </summary>
            public override void PrimitiveOperation1()
            {
                Console.WriteLine("ConcreteClassB.PrimitiveOperation1()");
            }
    
            /// <summary>
            /// The primitive operation 2.
            /// </summary>
            public override void PrimitiveOperation2()
            {
                Console.WriteLine("ConcreteClassB.PrimitiveOperation2()");
            }
        }
    }
    
    // Output:
    /*
    ConcreteClassA.PrimitiveOperation1()
    ConcreteClassA.PrimitiveOperation2()
    
    ConcreteClassB.PrimitiveOperation1()
    ConcreteClassB.PrimitiveOperation2()
    
    
    */

    This real-world code demonstrates a Template method named Run() which provides a skeleton calling sequence of methods. Implementation of these steps are deferred to the CustomerDataObject subclass which implements the Connect, Select, Process, and Disconnect methods.

    /*
     * Real-World Template Method Pattern.
     */
    
    using System;
    using System.Data;
    using System.Data.OleDb;
    
    namespace TemplateMethod.RealWorld
    {
        /// <summary>
        /// Startup class for Real-World Template Method design pattern.
        /// </summary>
        public class Program
        {
            /// <summary>
            /// Entry point into console application.
            /// </summary>
            public static void Main()
            {
                DataAccessObject daoCategories = new Categories();
                daoCategories.Run();
    
                DataAccessObject daoProducts = new Products();
                daoProducts.Run();
            }
        }
    
        /// <summary>
        /// The 'AbstractClass' abstract class.
        /// </summary>
        public abstract class DataAccessObject
        {
            /// <summary>
            /// The connection string.
            /// </summary>
            protected string ConnectionString;
    
            /// <summary>
            /// The data set.
            /// </summary>
            protected DataSet DataSet;
    
            /// <summary>
            /// Connect.
            /// </summary>
            public virtual void Connect()
            {
                // Make sure mdb is available to program.
                ConnectionString = "provider=Microsoft.JET.OLEDB.4.0; data source=..\\..\\db1.mdb";
            }
    
            /// <summary>
            /// Select.
            /// </summary>
            public abstract void Select();
    
            /// <summary>
            /// Process.
            /// </summary>
            public abstract void Process();
    
            /// <summary>
            /// Disconnect.
            /// </summary>
            public virtual void Disconnect()
            {
                ConnectionString = string.Empty;
            }
    
            /// <summary>
            /// The 'Template Method'.
            /// </summary>
            public void Run()
            {
                Connect();
                Select();
                Process();
                Disconnect();
            }
        }
    
        /// <summary>
        /// A 'ConcreteClass' class.
        /// </summary>
        public class Categories : DataAccessObject
        {
            /// <summary>
            /// Select.
            /// </summary>
            public override void Select()
            {
                const string sql = "select CategoryName from Categories";
                OleDbDataAdapter dataAdapter = new OleDbDataAdapter(sql, ConnectionString);
                DataSet = new DataSet();
                dataAdapter.Fill(DataSet, "Categories");
            }
    
            /// <summary>
            /// Process.
            /// </summary>
            public override void Process()
            {
                Console.WriteLine("Categories ------ ");
                DataTable dataTable = DataSet.Tables["Categories"];
                foreach (DataRow row in dataTable.Rows)
                {
                    Console.WriteLine(row["CategoryName"]);
                }
    
                Console.WriteLine();
            }
        }
    
        /// <summary>
        /// A 'ConcreteClass' class.
        /// </summary>
        public class Products : DataAccessObject
        {
            /// <summary>
            /// Select.
            /// </summary>
            public override void Select()
            {
                const string sql = "select ProductName from Products";
                OleDbDataAdapter dataAdapter = new OleDbDataAdapter(sql, ConnectionString);
                DataSet = new DataSet();
                dataAdapter.Fill(DataSet, "Products");
            }
    
            /// <summary>
            /// Process.
            /// </summary>
            public override void Process()
            {
                Console.WriteLine("Products ------ ");
                DataTable dataTable = DataSet.Tables["Products"];
                foreach (DataRow row in dataTable.Rows)
                {
                    Console.WriteLine(row["ProductName"]);
                }
    
                Console.WriteLine();
            }
        }
    }
    
    // Output:
    /*
    
    Categories ------
    Beverages
    Condiments
    Confections
    Dairy Products
    Grains/Cereals
    Meat/Poultry
    Produce
    Seafood
    
    Products ------
    Chai
    Chang
    Aniseed Syrup
    Chef Anton's Cajun Seasoning
    Chef Anton's Gumbo Mix
    Grandma's Boysenberry Spread
    Uncle Bob's Organic Dried Pears
    Northwoods Cranberry Sauce
    Mishi Kobe Niku
    
    
    */

     

    展开全文
  • Ant Design

    千次阅读 2019-05-28 09:04:01
    Ant Design 服务于企业级产品的设计体系,基于确定和自然的设计价值观上的模块化解决方案,让设计者和开发者专注于更好的用户体验。 Ant Design Mobile of React Ant Design Mobile of Angular Ant ...

    Ant Design

    服务于企业级产品的设计体系,基于确定和自然的设计价值观上的模块化解决方案,让设计者和开发者专注于更好的用户体验。

    Ant Design Mobile of React

    Ant Design Mobile of Angular

    Ant Design of React 

    Ant Design of Angular 

    Ant Design of Vue 

    相关资源

    Ant Design Pro

    Ant Design Mobile

    NG-ZORRO - Ant Design of Angular

    NG-ZORRO-MOBILE

    Ant Design Vue

    Kitchen - Sketch 工具集

    Ant Design Landing - 首页模板集

    Scaffolds - 脚手架市场

    Umi - React 应用开发框架

    dva - 数据流前端框架

    Ant Motion - 设计动效

    设计资源下载

    国内镜像站点 ??

    社区

     Awesome Ant Design

     Medium

     Twitter

     Ant Design 专栏

     体验科技专栏

    SEE Conf - 蚂蚁体验科技大会

    加入我们

    帮助

    GitHub

    更新日志

    Ant Design 实战教程

    常见问题

    在线讨论 (中文)

    在线讨论 (English)

    报告 Bug

    讨论列表

    StackOverflow

    SegmentFault

    AFX Cloud更多产品

     语雀 - 知识创作与分享工具

    云凤蝶 - 移动建站平台

    AntV - 数据可视化

    Egg - 企业级 Node 开发框架

    蚂蚁体验科技

    Made with ❤ byAFX

     Not using Hotjar yet?

    Select an element on the page.

    展开全文
  • Material Design之Toolbar与Palette实践 源码

    千次下载 热门讨论 2014-11-24 08:52:39
    Material Design之Toolbar与Palette实践,资源对应博客:http://blog.csdn.net/bbld_/article/details/41439715
  • Ant design

    千次阅读 2020-03-14 20:23:37
    antd是基于 Ant Design 设计体系的 React/vue/AngularUI 组件库,主要用于研发企业级中后台产品。 帮助快速开发前端企业级工程项目. 2.学习/操作 TBD 3.问题/补充 TBD 4.参考 ...

    1.应用场景

    前端组件库

    antd 是基于 Ant Design 设计体系的 React/vue/Angular UI 组件库,主要用于研发企业级中后台产品。

    帮助快速开发前端企业级工程项目.

    2.学习/操作

    TBD

    3.问题/补充

    TBD

    4.参考

    https://ant.design/index-cn //官网

    https://www.antdv.com/docs/vue/introduce-cn/  //Ant Design of Vue

    https://ant.design/docs/react/introduce-cn  //Ant Design of React

    https://ng.ant.design/docs/introduce/zh  //Ant Design of Angular

    后续补充

    ...

    展开全文
  • Material Design

    千次阅读 2018-10-11 14:32:40
    Material Design Material Design 是专为设计适用于多个平台和设备的视觉、运动与互动效果而制定的综合指南。 Android 现在已支持 Material Design 应用。 如果要在您的 Android 应用中使用 Material Design,请遵循...
  • ANT DESIGN PRO

    千次阅读 2019-05-28 09:13:17
    ANT DESIGN PRO 开箱即用的中台前端/设计解决方案 相关资源 Ant Design Ant Design Mobile NG-ZORRO-Ant Design of Angular NG-ZORRO-MOBILE Awesome Ant Design Kitchen-Sketch 工具集 Ant Design...
  • Ant Design Vue

    千次阅读 2019-05-28 09:20:14
    Ant Design Vue Ant Design of Vue Following the Ant Design specification, we developed a Vue UI libraryantdthat contains a set of high quality components and demos for building rich, interactive .....
  • Ant Design 与 Ant Design Pro

    千次阅读 2020-02-07 23:26:48
    02-Ant Design #1.ReactJS 1.1.分层 上图中,左侧是服务端代码的层次结构,由Controller,Service,Data Access三层组成服务服务端系统。 右侧是前端代码的结构,同样需要进行必要的分层: Page负责与用户直接打交道...
  • Qt Design studio使用

    万次阅读 2019-07-18 19:23:54
    Qt Design Studio实现了UI设计到qml的转换,该文是关于Qt Design Studio的使用手册,主要来自官方文档,对于导出工具的使用给出了一些实践的建议。
  • 领域驱动设计(Domain Driven Design)参考架构详解

    万次阅读 多人点赞 2011-08-12 11:33:02
    领域驱动设计(Domain Driven Design)参考架构详解摘要本文将介绍领域驱动设计(Domain Driven Design)的官方参考架构,该架构分成了Interfaces、Applications和Domain三层以及包含各类基础设施的Infrastructure。...
  • Material Design基础

    千次阅读 2017-11-20 11:44:14
    Material Design,中文名:材质设计,是由Google推出的全新设计语言,旨在为手机、平板电脑、台式机和其他平台提供更一致、更广泛的感官体验。Flutter与Material Design的关系密切,Flutter框架中有一个Material ...
  • design compiler

    千次阅读 2015-10-20 11:01:55
    DC(Design Compiler)是Synopsys公司的logical synthesis工具,它根据design description和design constraints自动综合出一个优化了的门级电路。它可以接受多种输入格式,如HDL、Schematics、Netlist等,并能生成多种...
  • 【Android】MaterialDesign使用

    万次阅读 2019-12-17 21:51:23
    MaterialDesign使用 Material Design是Google在2014年的I/O大会上推出的全新设计语言。 Material Design是基于Android 5.0``(API level 21)的,兼容5.0以下的设备时需要使用版本号v21.0.0以上的 support v7包中的...
  • ant-design-vue UI组件使用讲解

    万人学习 2019-06-10 11:26:25
    通过jeecg-boot项目实战,详细介绍 ant-design-vue UI组件使用,细致的讲解每个组件的用法,教你学会如何看ant-design-vue的官方文档。 对于初学入门者来讲,非常实用。
  • Ant Design Pro实战入门教程-整合版

    千人学习 2019-12-27 10:54:16
    Ant Design Pro是一个企业级中后台前端/设计解决方案,秉承了 Ant Design 的设计价值观,致力于在设计规范和基础组件的基础上,继续向上构建,提炼出典型模板/业务组件/配套设计资源。随着设计者的不断反馈,Ant ...
  • vue+Ant design vue做项目

    万次阅读 2019-09-17 09:33:14
    哈喽哈喽,这期带来蚂蚁金服的一个Ant Design 的 Vue 实现。 样式还是很现代化的,嗯...现在是2019年9月17,对现在来说还很fashion过几年就不知道了。 话不多说直接上手,喜欢记得关注,顺手右上角来个赏我两个...
  • ant-design-demos

    千次下载 热门讨论 2016-02-03 23:27:13
    ant design demo 直接打开里面Html即可,chrome最佳
  • Material Design这种设计语言(风格)的提出已经有数个年头,但是开发的过程中却不是说经常使用到相关的控件,所以有些控件的使用并不是很熟练,所以萌发了复习的念头。我是2015年开始入门android的,那时候找了不少...
  • Design Pattern/ OOD/ System Design

    千次阅读 2015-10-30 03:57:23
    可以看一些design pattern的书比如Design Patterns: Elements of Reusable Object-Oriented Software(我们上课用的这本) 关于系统设计,这个其实很看积累的,system本来就是考功底的地方,如果没时间上一些system...
  • Gui Design Studio 4.4版本+KEY

    千次下载 热门讨论 2012-12-05 11:39:53
    Gui Design Studio最新版本,另外还有注册工具,无毒
  • 浅析Motion Design

    千次阅读 2016-03-30 09:43:45
    在UI设计领域,动态设计(motion design)因为Google的参与开始被诸多人士关注,其原因在于能够打造出生动有趣的效果的能力。应用中所有元素都按序排列,而动态设计则便于引导用户操作。每一个按键的点触,每一个...
  • system design primer

    千次阅读 2017-04-16 00:32:06
    github.com/donnemartin/system-design-primer Index of system design topics ...Summaries of various system design topics, including pros and cons. Everything is a trade-off. Each section contain
  • Material Design实战

    千次阅读 2016-03-29 18:24:19
    MaterialDesign实战
  • 大概是这样一个效果 ...自己实现起来比较复杂,antd已经为我们写好了这一套。 具体实现方式请看官方文档: ant design : ...ant design pro:https://pro.ant.design/blog/new-pro-use-cn#header...
  • AntDesign中的Form使用问题,对于FormItem进行布局时??LabelCol什么意思?? 我看了官网的解释如下::: labelCol label 标签布局,通 <Col> 组件,设置 span offset 值,如 {span: 3, offset: 12} object wrapperCol ...
  • Design
  • 安装design compiler的教程

    千次阅读 多人点赞 2020-05-03 12:33:52
    安装design compiler以及破解的教程教程开始design compiler工具介绍和所需环境准备工作启动installer安装软件安装DC插入链接与图片如何插入一段漂亮的代码片生成一个适合你的列表创建一个表格设定内容居中、居左、...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 175,258
精华内容 70,103
关键字:

design