¡GoConqr estrena diseño! Cuéntanos qué te parece.

Apuntes

Design patterns

Suhas S Inglés 6 páginas

Contenido del apunte (6)

Página 1

There are 3 types:

Creational - Singleton, Factory, Abstract Factory, Builder, Prototype

Structural - Adapter , composite, Proxy, Flyweight, Facade, Bridge, Decorator

Behavioral - Temp;ate Method, Mediator, Chain of Responsibility, Observer, Strategy, Command, State, Visitor, Interpreter, Iterator, Mememto

Página 2

Singleton: Singleton pattern restricts the instantiation of a class and ensures that only one instance of the class exists in the java virtual machine

The singleton class must provide a global access point to get the instance of the class.

Singleton pattern is used for logging, drivers objects, caching and thread pool.

Singleton design pattern is also used in other design patterns like Abstract Factory, Builder, Prototype, Facade etc.

Página 3

Factory Method

Return one of serveral classes that share a common super class

Página 4

Strategy Pattern:

crate interface with a method, create classes implementing them.

create an object of interface type in a class

subclasses can instantiate interface type by calling classes which implement interface method in their own way.

Check this out

http://www.newthinktank.com/2012/08/strategy-design-pattern-tutorial/

Página 5

Observer pattern:

observer(subsciber) - interface

subject(publisher) - interface

subject will add, delete observer

create class implementing subject with list of observers.

Página 6

Abstract Factory:

Like a factory, but everything is encapsulated.

Información

Descripción
Apunte sobre Design patterns, creado por Suhas S el 30/03/2018.
Creado por
Suhas S
Visitas
1
Valoración

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?