simonsan
simonsan
Due to inactivity of the author and maintainers not being able to edit the PR I'll move #22 to a new branch in this repository. Future fixes to the PR...
Interesting and I wonder if that wouldn't be a good addition to this repository? https://web.archive.org/web/20210521022017/https://www.possiblerust.com/pattern/naming-your-lifetimes Thoughts?
Collection of design patterns and the corresponding issues if not contained in the repository already (in reference to Design patterns (by Gamma, Helm, Johnson, Vlissides)). Some patterns are probably not...
Enum is a one way to address the delegation (to commands). I think enums should be added too. I might add it too a bit later. However, there is also...
Adapter
Tracking issue for merging: https://github.com/lpxxn/rust-design-pattern/blob/master/structural/adapter.rs Example: ``` use std::rc::Rc; // The Target defines the domain-specific interface used by the client code. trait Target { fn get_request(&self) -> String { String::from("Target:...
Tracking issue for merging: https://github.com/lpxxn/rust-design-pattern/blob/master/behavioral/chain_of_responsibility.rs Example: ``` //! Chain of Responsibility is a behavioral design pattern that lets you pass requests along a chain of handlers. //! Upon receiving a...
Tracking issue for merging: https://github.com/lpxxn/rust-design-pattern/blob/master/structural/decorator.rs Example: ``` use std::rc::Rc; // The base Component trait defines operations that can be altered by // decorators. trait Component { fn operation(&self) -> String;...
Proxy
Tracking issue for merging: https://github.com/lpxxn/rust-design-pattern/blob/master/structural/proxy.rs Example: ``` //! Proxy is a structural design pattern that lets you provide a substitute or placeholder for another object. //! A proxy controls access...
Tracking issue for merging: https://github.com/lpxxn/rust-design-pattern/blob/master/creational/factory.rs Example: ``` //! Factory method creational design pattern allows creating objects without having to specify the exact type of the object that will be created....
Tracking issue for merging: https://github.com/lpxxn/rust-design-pattern/blob/master/creational/abstract_factory.rs Example: ``` //! Abstract Factory is a creational design pattern that lets you produce families of related objects without specifying their concrete classes. trait GUIFactory...