大杂烩---Step by Step

 "const关键字只被编译器识别。如果编译器识别不到const,它就不会认为是const的。
比如说,char   *s   =   "12345";
其实,12345"为字符串常量,但是如果你这么做:s[0]   =   '0';那么通过编译是肯定的。但是运行时可能就会出现异常。 "

Design pattern (computer science)

From Wikipedia, the free encyclopedia


Classification

Design patterns can be classified in terms of the underlying problem they solve. Examples of problem-based pattern classifications include:

  • Fundamental patterns
    • Delegation pattern: an object outwardly expresses certain behaviour but in reality delegates responsibility
    • Functional design: assures that each modular part of a computer program has only one responsibility and performs that with minimum side effects
    • Interface pattern: method for structuring programs so that they're simpler to understand
    • Proxy pattern: an object functions as an interface to another, typically more complex, object
    • Facade pattern: provides a simplified interface to a larger body of code, such as a class library.
    • Composite pattern: defines Composite object (e.g. a shape) designed as a composition of one-or-more similar objects (other kinds of shapes/geometries), all exhibiting similar functionality. The Composite object then exposes properties and methods for child objects manipulation as if it were a simple object.
  • Creational patterns which deal with the creation of objects. Abstract Factory and Factory Method are creation patterns
    • Abstract factory pattern: centralize decision of what factory to instantiate
    • Factory method pattern: centralize creation of an object of a specific type choosing one of several implementations
    • Builder pattern: separate the construction of a complex object from its representation so that the same construction process can create different representations
    • Lazy initialization pattern: tactic of delaying the creation of an object, the calculation of a value, or some other expensive process until the first time it is needed
    • Object pool: avoid expensive acquisition and release of resources by recycling objects that are no longer in use
    • Prototype pattern: used when the inherent cost of creating a new object in the standard way (e.g., using the 'new' keyword) is prohibitively expensive for a given application
    • Singleton pattern: restrict instantiation of a class to one object
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值