Patrones De Diseño En Java - Gof

Páginas: 47 (11534 palabras) Publicado: 2 de julio de 2012
GoF Design Patterns with examples using Java and UML2
written by:

Benneth Christiansson (Ed.) Mattias Forss, Ivar Hagen, Kent Hansson, Johan Jonasson, Mattias Jonasson, Fredrik Lott, Sara Olsson, and Thomas Rosevall

Copyright
©2008, Authors. This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. (This license allows you to redistribute this book in unmodifiedform. It allows you to make and distribute modified versions, as long as you include an attribution to the original author, clearly describe the modifications that you have made, and distribute the modified work under the same license as the original.

Logica Java Architects Training Crew

Design Patterns- Explained

Table of Contents
Factory, Abstract Factory, Builder, Prototype andSingleton

Chapter 1 Creational Patterns Chapter 2 Structural Patterns

3 24 50

Adapter, Bridge, Composite, Decorator, Facade, Flyweight and Proxy

Chain-of-responsibility, Command, Iterator, Mediator, Memento, Observer, State and Strategy

Chapter 3 Behavioral Patterns

Foreword
This book is the result of a joint effort of the authors with an equal contribution from all. The idea to thebook originated during the participation of a Java Architect training program taught at Logica Sverige AB Karlstad office. During the course the authors identified the lack of a quick-guide book to the basic GoF1 design patterns. A book that could be used as a bare bone reference as well as a learning companion for understanding design patterns. So we divided the workload and together we created anup-to-date view of the GoF design patterns in a structured and uniform manner. Illustrating the choosen patterns with examples in Java and diagrams using UML2 notation. We have also emphasized benefits and drawbacks for the individual patterns and, where applicable. We also illustrate real world usage situations where the pattern has successfully been implemented. I personally as editor mustexpress my deepest admiration for the dedication and effort the authors have shown during this process, everyone who ever have written a book knows what I mean. I am really proud to be the editor of this very usable book.
--- Benneth Christiansson, Karlstad, autumn 2008 ---

1 Design Patterns Elements of Reusable Elements by Gamma, Helm, Johnson and Vlissides (1995)

2

Logica Java ArchitectsTraining Crew

Design Patterns- Explained

Chapter 1 Creational Patterns
“Creational design patterns are design patterns that deal with object creation mechanisms, trying to create objects in a manner suitable to the situation. The basic form of object creation could result in design problems or added complexity to the design. Creational design patterns solve this problem by somehowcontrolling this object creation.”2 All the creational patterns define the best possible way in which an object can be created considering reuse and changeability. These describes the best way to handle instantiation. Hard coding the actual instantiation is a pitfall and should be avoided if reuse and changeability are desired. In such scenarios, we can make use of patterns to give this a more general andflexible approach.

2 http://en.wikipedia.org/wiki/Creational_pattern

3

Logica Java Architects Training Crew

Design Patterns- Explained

Factory Pattern
Definition The Factory pattern provides a way to use an instance as a object factory. The factory can return an instance of one of several possible classes (in a subclass hierarchy), depending on the data provided to it. Where touse •When a class can't anticipate which kind of class of object it must create. •You want to localize the knowledge of which class gets created. •When you have classes that is derived from the same subclasses, or they may in fact be unrelated classes that just share the same interface. Either way, the methods in these class instances are the same and can be used interchangeably. •When you want to...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Patrones De Diseño Java
  • Patrones de diseño java
  • patrones java
  • Patrones de diseño, aplicabilidad y ejemplos en java
  • El patrón constructor (builder pattern, gof).
  • Patrones De Diseno
  • Patrones De Diseño
  • Patrones de Diseño

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS