Sample application: https://github.com/microservices-patterns/ftgo-application http://eventuate.io/exampleapps.html Microservices Patterns: https://microservices.io/patterns/index.html Enterprise Integration Patterns: https://www.enterpriseintegrationpatterns.com/patterns/messaging/ Configuration Management Centralizing configuration and secret values: AWS Secrets Manager AWS Key Management Service Apache ZooKeeper Spring Cloud Config (Spring Cloud Vault, Spring Cloud Zookeeper) etcd – distributed reliable key-value store Service Discovery Client make request to Service Registry or Load Balancer (Router): Apache […]
Tag Archives: Pattern
Software Design Patterns
GoF: Creational Singleton Abstract Factory Factory Method Builder Prototype Object Pool GoF: Structural Facade Decorator Composite Bridge http://norows.com/structural-patterns-bridge.html Adapter Proxy http://norows.com/structural-patterns-proxy.html Flyweight http://norows.com/structural-patterns-flyweight.html GoF: Behavioral Visitor Template Method Strategy http://norows.com/behavioral-patterns-strategy.html Observer http://norows.com/behavioral-patterns-observer.html Memento http://norows.com/behavioral-patterns-memento.html Mediator http://norows.com/behavioral-patterns-mediator.html Iterator http://norows.com/behavioral-patterns-iterator.html State Interpreter http://norows.com/behavioral-patterns-interpreter.html Command http://norows.com/behavioral-patterns-command.html Chain of Responsibility […]
Object Pool – Creational patterns
Object Pool kept ready to use objects for a client Creational patterns: Singleton ¦ Builder ¦ Factory Method ¦ Abstract Factory ¦ Prototype ¦ Object Pool
Builder – Creational patterns
Builder provide a flexible design solution – how we can create a class and how we can simplified (and reduce parameters count passed to the constructor) instantiation process of the class:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
public class Dog { private String name; private int age; public static class Builder { private String name; private int age; public Builder name(String name) { this.name = name; return this; } public Builder age(int age) { this.age = age; return this; } public Dog build() { return new Dog(this); } } private Dog(Builder builder) { name = builder.name; age = builder.age; } } ///////////////////////// Dog d = new Dog.Builder().name("jack").age(3).build(); |
disadvantages: Requires creating a separate ConcreteBuilder for each different type of product. Requires the builder classes to be mutable. Data members of […]