![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Design Pattern C++
文章平均质量分 82
zhucai4
这个作者很懒,什么都没留下…
展开
-
design_pattern_strategy
This post implement strategy pattern, described in . The class structure is as follows class FlyBehavior{ public: virtual void fly() = 0; }; class FlyWithWings : public FlyBehavior{ public:原创 2015-03-04 11:08:04 · 409 阅读 · 0 评论 -
design_pattern_state
This post implements state design patter in . The state pattern allows an object to alter its behavior when its internal state changes. The object will appear to change its class. In plain words, whe原创 2015-03-09 17:23:38 · 304 阅读 · 0 评论 -
design_pattern_compound
This post implements compound pattern in . The examples are based on Duck classes. class Quackable { public: virtual void quack() = 0; }; class MallardDuck : public Quackable { public: void原创 2015-03-09 21:20:02 · 356 阅读 · 0 评论 -
design_pattern_decorator
This post implements decorator pattern in . Decorator Pattern attaches additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending f原创 2015-03-04 17:09:12 · 399 阅读 · 0 评论 -
design_pattern_derivative_randomnumber
We have implemented payoff, option, statistics class. In our calculation for option price, we have used gsl library to generate random numbers, gsl is a high quality numerical library, however, to pr原创 2015-03-22 13:47:48 · 515 阅读 · 0 评论 -
design_pattern_derivative_option
If we consider option as a whole, the basic components are expiration and payoff. We want to define a Vanilla Option class which has as data members a PayOff object and a double to represent expiry. H原创 2015-03-22 00:34:16 · 401 阅读 · 0 评论 -
design_pattern_derivative_statistics
Our monte carlo rounte lacks any indication of the simulation’s convergence. We could make the routine return standard error, or a convergence table, or simply have it return the value for every sing原创 2015-03-22 10:59:50 · 482 阅读 · 0 评论 -
design_pattern_derivative_exotic_option
Based on payoff, option, mcstatistics and random numbers classes, we now have basic components to build option pricing applications. This post applies template pattern to price path-dependent options原创 2015-03-23 00:18:53 · 397 阅读 · 0 评论 -
design_pattern_derivative_payoff
In the option pricing framework, the first component which always changes is option's payoff. Therefore, we need to encapsulation the payoff class. First of all, we define an abstract PayOff class,原创 2015-03-21 23:47:48 · 518 阅读 · 0 评论 -
design_pattern_composite
This post implement Composite Pattern in . The Composite Pattern allows you to compose objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual object原创 2015-03-09 15:23:09 · 332 阅读 · 0 评论 -
design_pattern_bridge
This post implements bridge pattern in . The bridge pattern decomposes the component's interface and implementation into orthogonalclass hierarchies. If there are changes in bother interface and imp原创 2015-03-10 10:53:38 · 404 阅读 · 0 评论 -
design_pattern_observer
This post implements observer pattern in . Observer Pattern defines a one-to-many dependency between objects so that when one object changes state, all of its dependents are notified and updated aut原创 2015-03-04 13:08:16 · 430 阅读 · 0 评论 -
design_pattern_singleton
The Singleton Pattern ensures a class has only one instance, and provides a global point of access to it. What is our motivation to use it? In nearly every application, there is a need to have an原创 2015-03-08 10:43:41 · 522 阅读 · 0 评论 -
design_pattern_facade
This post implements facade design pattern in . Facade pattern wrapps a complicated subsystem with a simpler interface. The general procedure Identify a simpler, unified interface for the su原创 2015-03-08 20:22:25 · 376 阅读 · 0 评论 -
design_pattern_factory
This post implements design pattern factory in . The factory design pattern has three levels, simple factory, factory method, abstract factory method. In OOP terminology, a factory is a class for crea原创 2015-03-04 21:47:27 · 455 阅读 · 0 评论 -
design_pattern_adapter
This post implements a relative easy and straight forward pattern in : Adapter Pattern. The Adapter Pattern converts the interface of a class into another interface the clients expect. Adapter lets c原创 2015-03-08 17:49:15 · 335 阅读 · 0 评论 -
design_pattern_command
This post implements the command pattern in the book . The Command Pattern encapsulates a request as an object, thereby, letting you parametrize other objects with different requests, queue or log re原创 2015-03-08 11:45:14 · 427 阅读 · 0 评论 -
design_pattern_template
This post implement template pattern in . Template pattern defines the skeleton of an algorithm in a method, deferring some steps to subclasses. Template method lets subclasses redefine certain steps原创 2015-03-08 22:20:20 · 307 阅读 · 0 评论 -
design_pattern_iterator
This post implements Iterator Pattern in . Take traversal-of-a-collection functionality out of the collection and promote it to "full object status". This simplifies the collection, allows man原创 2015-03-08 23:00:21 · 324 阅读 · 0 评论 -
design_pattern_derivative_tree
Usually, tree is used to calculate American style options. We define our American style options as follows #ifndef TREEPRODUCT_HPP_INCLUDED #define TREEPRODUCT_HPP_INCLUDED class TreeProducts { p原创 2015-03-23 19:24:24 · 378 阅读 · 0 评论