Java Design Patterns

Design Patterns are general reusable solution to commonly occurring problems. These are the best practices, used by the experienced developers. Patterns are not complete code, but it can use as a template which can be applied to a problem. In other words, we can think of
patterns as a formal document which contains recurring design problems and its solutions

Creational Patterns Structural Patterns Behavioral Patterns
Factory Adapter Strategy
Builder Composite Iterator
Prototype Facade Observer
Singleton State

Pattern name, is used to provide a single and meaningful name to the pattern which defines a design problem and a solution
for it. Naming a design pattern helps itself to be referred to others easily. It also becomes easy to provide documentation for
and the right vocabulary word makes it easier to think about the design

The problem describes when to apply the pattern. It explains the problem and its context. It might describe specific design
problems such as how to represent algorithms as objects. It might describe a class or object structures that are symptomatic of
an inflexible design. Sometimes the problem will include a list of conditions that must be met before it makes sense to apply
the pattern.

The solution describes the elements that make up the design, their relationships, responsibilities, and collaborations. The
solution is not the complete code, but it works as a template which can be fulfilled with code. Instead, the pattern provides an
abstract description of a design problem and how a general arrangement of elements (classes and objects in our case) solves it.

The results and consequences of applying the pattern. The consequences for software often concern space and time trade-
offs. They may address language and implementation issues as well. Since reuse is often a factor in object-oriented design, the
consequences of a pattern include its impact on a system’s flexibility, extensibility, or portability. Listing these consequences
explicitly helps you understand and evaluate them.

Why use them? Because of: Flexibility, reusability, shared vocabulary, capture best practices.

Adapter:

Facade:

Composite:

Singleton:

When to use Singleton? There must be exactly one instance of a class, and it must be accessible to clients from a well-known access point

Observer:

When to use Observer?

  • When an abstraction has two aspects, one dependent on the other. Encapsulating these aspects in separate objects lets you vary
    and reuse them independently.
  • When a change to one object requires changing others, and you don’t know how many objects need to be changed.
  • When an object should be able to notify other objects without making assumptions about who these objects are. In other words,
    you don’t want these objects tightly coupled.

Builder:

When to use Builder?

  • The algorithm for creating a complex object should be independent of the parts that make up the object and how they’re
    assembled.
  •  The construction process must allow different representations for the object that’s constructed.

Factory:

When to use Factory?

  • A class can’t anticipate the class of objects it must create.
  • A class wants its subclasses to specify the objects it creates.
  • Classes delegate responsibility to one of several helper subclasses, and you want to localize the knowledge of which helper
    subclass is the delegate.

State:

When to use State?

  • An object’s behavior depends on its state, and it must change its behavior at run-time depending on that state.
  • Operations have large, multipart conditional statements that depend on the object’s state. This state is usually represented by one or more enumerated constants. Often, several operations will contain this same conditional structure. The State pattern puts each branch of the conditional in a separate class. This lets you treat the object’s state as an object in its own right that can
    vary independently from other objects.

Strategy:

When to use Strategy?

  • Many related classes differ only in their behavior. Strategies provide a way to configure a class with one of many behaviors.
  • You need different variants of an algorithm. For example, you might define algorithms reflecting different space/time trade-offs.
    Strategies can be used when these variants are implemented as a class hierarchy of algorithms.
  • An algorithm uses data that clients shouldn’t know about. Use the Strategy pattern to avoid exposing complex, algorithm-
    specific data structures.

Iterator:

When to use Iterator?

public void pintar() {
Figura unaFig;
Iterator it = lFiguras.iterator();
while (it.hasNext(){
unaFig=it.next();
unaFig.pintar();
}
}

(Resume: Patter which reflects a “while loop” with helpful methods. Using a List would be a kind of Iterator Pattern use)

 

 

Publicado en Backend, Java, UML | Deja un comentario

Todas las emisoras de radio del mundo en una página web RADIO GARDEN

Encuentra todas las emisoras de radio del mundo en internet en esta página web: http://radio.garden/

¡Disfrútalas (y aprende idiomas fácilmente)!

Publicado en Otros | Deja un comentario

TFG recursos de información bibliográfica: Ingeniería

https://addi.ehu.es/handle/10810/42394?show=full

https://addi.ehu.es/bitstream/handle/10810/42394/Trip-TFG-Ingenieria-VBC-2019.pdf?sequence=1&isAllowed=y

Publicado en Otros | Deja un comentario

Bitcoin es una blockchain pública y abierta (internet), otras, como de empresas y gobiernos serán privadas (intranets)

Tecnología blockchain (existe desde 1991, pero no de forma descentralizada hasta 2009 con el bloque génesis) o cadena de bloques, es un nuevo sistema de almacenamiento de información o de datos. Permite agrupar información, meterla en un bloque (cubo), que se haga una operación matemática que tiene ese bloque, y que de esa operación matemática con ese bloque salga un resultado, que se le llama HASH, y ese resultado se conecta con el siguiente bloque. Esa información se copia en toda la red de ordenadores que están almacenando, verificando, y asegurado la red de Bitcoin u otras criptomonedas.

El respaldo viene de su base matemática y criptográfica.

Le llaman oro 2.0 porque resuelve el almacenamiento de valor de forma digital.

Ethereum está preparada, para entre otras cosas, generar pagos.

Tokenizar: hacer una representación digital de valor de un bien que se encuentra en el mundo.
No fue una casualidad que apareciese en 2008, a la vez que la crisis económica porque el creador, Satoshi Nakamoto (サトシ・ナカモト) (significa claridad de ideas y claridad de futuro), puso un mensaje dentro del bloque génesis. Este mensaje es la portada de un periódico inglés que se llama The Guardian, con contenido  sobre “al borde del segundo rescate bancario en Inglaterra”.

Una dirección de bitcoin es lo que entendemos hoy como una cuenta bancaría. La diferencia es que teniendo un monedero (wallet) es posible crear tantas direcciones de bitcoin como se quiera.

Almacenamiento en frío: un soporte físico, por ejemplo una memoria USB, donde se guardan las claves para acceder al dinero en Bitcoin, en criptomoneda.

Recomendable, no dejar la administración de las cripto monedas de uno mismo a terceros, y sí almacenarlas en un monedero “propio” (propio entre comillas, porque ni el sistema operativo de tu ordenador es “tuyo”, ni el hardware…)

 

 

Publicado en bitcoin | Deja un comentario

Internet satelital

https://www.skydsl.eu/

Recomendado por un experto en el tema.

Publicado en Redes | Deja un comentario

Airbus plane mini Central Processing Data inside under the cabin

Unix inside?

Publicado en cloud computing | Deja un comentario

UML

Imagen | Publicado el por | Deja un comentario

WinWorld : Museo online de sistemas operativos antiguos

Repositorio de sistemas operativos antiguos en donde se recogen versiones “obsoletas” de DOS, Windows, Apple/Mac, OS2, Linux, BeOS, OS/400 entre otros

https://winworldpc.com/library/operating-systems

Publicado en Operative Systems | Deja un comentario

“Somos menos felices y menos productivos que nunca porque somos adictos”

“Te ha llegado un correo, un mensaje, un hechizo, un paquete. Hay un usuario nuevo, una noticia nueva, una herramienta nueva. Alguien ha hecho algo, ha publicado algo, ha subido una foto de algo, ha etiquetado algo. Tienes cinco mensajes, veinte likes, doce comentarios, ocho retuits. Hay tres personas mirando tu perfil, cuatro empresas leyendo tu currículum, dos altavoces inalámbricos rebajados, tres facturas sin pagar. Las personas a las que sigues están siguiendo esta cuenta, hablando de este tema, leyendo este libro, mirando este vídeo…”

https://www.bbc.com/mundo/noticias-51268343

Entonces encontré:

Publicado en Opinión, Otros, REDES_SOCIALES | Deja un comentario

Download books and comics and storage your own collection!

https://libgen.org/ is like a piratebay of comics and books. Download shared books and comics now!

https://ibgen.is/

 

Publicado en Otros | Deja un comentario