Wednesday, 6 February 2019

Docker Kubernetes and microservices

ref

Dockers :

Responsibilities :

Contains you app, its required Libs and ships in to Host OS, where docker is already installed.
Deploy your dockerisedApp




Steps:

1. Create a .docker file
2.  Build it, you will get an image
3. you can deploy your application in a machine, which has docker installed







Tuesday, 5 February 2019

All Design patterns

1.Creational Design Pattern

  1. Factory Pattern
  2. Abstract Factory Pattern
  3. Singleton Pattern
  4. Prototype Pattern
  5. Builder Pattern.

2. Structural Design Pattern

  1. Adapter Pattern
  2. Bridge Pattern
  3. Composite Pattern
  4. Decorator Pattern
  5. Facade Pattern
  6. Flyweight Pattern
  7. Proxy Pattern

3. Behavioral Design Pattern

  1. Chain Of Responsibility Pattern
  2. Command Pattern
  3. Interpreter Pattern
  4. Iterator Pattern
  5. Mediator Pattern
  6. Memento Pattern
  7. Observer Pattern
  8. State Pattern
  9. Strategy Pattern
  10. Template Pattern
  11. Visitor Pattern

Creational | Factory method design pattern

Creational design pattern.


Principle:
"Separate out the codes which are subject to change and not subject to change"

Manager (talks to) -> Factory (creates) --> Objects


Factory method:

That method, which has the logic of creating the object based on some certain criteria, are calls "factory method"


Advantage:
1. Avoid code duplication by reusing the creational logic.
2. Separate changing logic vs non changing logic
3. OCP, principle applied 


Abstract factory method



MembershipManager (has some concrete policy as general and abstract method for subclass to implement based on region) 

LondonMemborshipManager , NYMembershipManager






Behavioral | Strategy design

Motivation:

While you design a inheritance hierarchy to handle different type of things like
Network devices.

and you find slowly that each NE, has some common behaviour and also some different behaviour.

you also find that, for some types of NE, you are required to provide empty implementation.

you find that , with new requirements you are forced to touch the methods/behaviour of existing code.

then you need to do following

1. separate interfaces for different types
2.  as much as possible create more types of behavioural implementation,

like rebbotable device, repluggabe, nonStoppable, manually Stoppable, autoStoppable, reconfiguration, autoReconfigurable, manualReconfigurable, Updatable,timeUpdatable, versionUpdatable.

3. and then composition this behaviour(object) inside your Network element object.

like OME(with autoupgradable).

so when u create that OME type of NE, you also create autoupgradable object ( behaviour ) and pass to constructor.

so you encapsulate the behaviour .

PROGRAM TO SUPER TYPE

that means , you have a placeholder for plugganle/stoppable etc types of super type interfaces insidr NE class,
and later at runtime you can create and subtype object and assign.

Friday, 1 February 2019

Micro-service architectures


All the modules even though developed as different module, using different tools/patterns/technologies and finally bundled as single install-able file.