ClubEnsayos.com - Ensayos de Calidad, Tareas y Monografias
Buscar

Como se dan los Patrones de diseño de software


Enviado por   •  23 de Noviembre de 2017  •  Tutoriales  •  17.807 Palabras (72 Páginas)  •  176 Visitas

Página 1 de 72

Table of Content Creational Design Patterns .................................................................................................. 5 1. Singleton Pattern ......................................................................................................... 6 A. Eager Initialization ................................................................................................. 7 B. Static block initialization ........................................................................................ 7 C. Lazy Initialization .................................................................................................. 8 D. Thread Safe Singleton ............................................................................................ 9 E. Bill Pugh Singleton Implementation .................................................................... 10 F. Using Reflection to destroy Singleton Pattern...................................................... 11 G. Enum Singleton .................................................................................................... 12 H. Serialization and Singleton .................................................................................. 12 2. Factory Pattern .......................................................................................................... 15 A. Super Class ........................................................................................................... 15 B. Sub Classes ........................................................................................................... 15 C. Factory Class ........................................................................................................ 17 D. Benefits of Factory Pattern .................................................................................. 19 E. Factory Pattern Examples in JDK ........................................................................ 19 3. Abstract Factory Pattern ........................................................................................... 20 A. Super Class and Sub-Classes ............................................................................... 20 B. Factory Classes for Each sub-class ...................................................................... 22 B. Benefits of Abstract Factory Pattern .................................................................... 25 C. Abstract Factory Pattern Examples in JDK.......................................................... 25 4. Builder Pattern .......................................................................................................... 26 A. Builder Pattern Implementation ........................................................................... 26 B. Builder Design Pattern Example in JDK.............................................................. 29 5. Prototype Pattern ....................................................................................................... 30 Structural Design Patterns................................................................................................. 33 1. Adapter Design Pattern ............................................................................................. 33 A. Two Way Adapter Pattern .................................................................................... 34 B. Class Adapter Implementation ............................................................................. 34 C. Object Adapter Implementation ........................................................................... 35 D. Adapter Pattern Class Diagram ............................................................................ 37 E. Adapter Pattern Example in JDK ........................................................................ 38 2. Composite Pattern ..................................................................................................... 39 A. Base Component .................................................................................................. 39 B. Leaf Objects ......................................................................................................... 40 C. Composite............................................................................................................. 40 D. Important Points about Composite Pattern .......................................................... 43 3. Proxy Pattern ............................................................................................................. 44 A. Main Class............................................................................................................ 44 B. Proxy Class ........................................................................................................... 45 C. Proxy Pattern Client Test Program....................................................................... 46 4. Flyweight Pattern ...................................................................................................... 47 A. Flyweight Interface and Concrete Classes ........................................................... 48 B. Flyweight Factory ................................................................................................ 49

© JOURNALDEV.COM PAGE 1 OF 132


C. Flyweight Pattern Client Example ....................................................................... 50 D. Flyweight Pattern Example in JDK ..................................................................... 54 E. Important Points ................................................................................................... 54 5. Facade Pattern ........................................................................................................... 55 A. Set of Interfaces ................................................................................................... 55 B. Facade Interface ................................................................................................... 56 C. Client Program ..................................................................................................... 58 D. Important Points ................................................................................................... 59 6. Bridge Pattern ........................................................................................................... 60 7. Decorator Pattern ...................................................................................................... 64 A. Component Interface ............................................................................................ 65 B. Component Implementation ................................................................................. 65 C. Decorator .............................................................................................................. 66 D: Concrete Decorators............................................................................................. 66 D. Decorator Pattern Class Diagram ......................................................................... 67 E. Decorator Pattern Client Program ........................................................................ 68 F. Important Points.................................................................................................... 68 Behavioral Design Patterns ............................................................................................... 69 1. Template Method Pattern .......................................................................................... 69 A. Template Method Abstract Class ......................................................................... 69 B. Template Method Concrete Classes ..................................................................... 70 C. Template Method Pattern Client .......................................................................... 71 D. Template Method Class Diagram ........................................................................ 72 E. Template Method Pattern in JDK ......................................................................... 73 F. Important Points.................................................................................................... 73 2. Mediator Pattern........................................................................................................ 74 A. Mediator Interface ................................................................................................ 75 B. Colleague Interface .............................................................................................. 75 C. Concrete Mediator ................................................................................................ 76 C. Concrete Colleague .............................................................................................. 76 D. Mediator Pattern Client ........................................................................................ 77 E. Mediator Pattern Class Diagram .......................................................................... 78 G. Important Points ................................................................................................... 78 3. Chain of Responsibility Pattern ................................................................................ 79 A. Base Classes and Interface ................................................................................... 80 B. Concrete Chain Implementations ......................................................................... 81 C. Creating the Chain ................................................................................................ 83 D. Class Diagram ...................................................................................................... 85 E. Chain of Responsibility Pattern Examples in JDK............................................... 85 F. Important Points.................................................................................................... 85 4. Observer Pattern........................................................................................................ 87 A. Observer Pattern Example ................................................................................... 88 B. Observer Pattern Class Diagram .......................................................................... 93 5. Strategy Pattern ......................................................................................................... 94 A. Strategy Pattern Class Diagram ........................................................................... 98 B. Important Points ................................................................................................... 98

...

Descargar como (para miembros actualizados)  txt (146.8 Kb)   pdf (489.2 Kb)   docx (89.4 Kb)  
Leer 71 páginas más »
Disponible sólo en Clubensayos.com