Design Patterns May 11, 2007

·         Fundamental:

o        Delegation pattern

o        Functional design

o        Interface pattern

o        Proxy pattern – isn’t the same as the real thing, but returns a faηade while underlying changes can occur, not disturbing the normal flow

o        Immutable pattern

o        Marker interface pattern

o        Abstract Factory pattern – passes instantiated objects of various types

·         Creational

o        Anonymous subroutine objects pattern

o        Builder pattern – builds up different instantiations, via Director, so small pieces can build different class objects

o        Factory method pattern – add method to class to provide instantiated instance

o        Object Pool

o        Lazy initialization pattern

o        Prototype pattern – returns something close to what you want, then you can change it as necessary Good for GUI pieces

o        Singleton pattern – ensures only one instance of this class ever gets instantiated, see static{}. Good for limited resource connections.

·         Structural

o        Adapter pattern – allows usage of object of different, incompatible types

o        Bridge pattern – allows client to call Proxy method, which bridges to implementation without tight coupling to any one implementation

o        Composite pattern – allows different concepts to share the same class

o        Connector – Acceptor-Connector connects two entities, not letting messages get lost. Like JMS, MOM, FutureResult or Asynchronous patterns

o        Container pattern

o        Decorator pattern – added functionality without subclassing

o        Extensibility pattern

o        Facade pattern – High-level interface for all underlying implementations

o        Flyweight pattern – use a simple, small piece repeatedly

o        Proxy pattern

o        Pipes and filters

o        Private class data pattern

o        Dynamic Linkage  

o        Virtual Proxy  

o        Cache Management

·         Behavioral

o        Chain of responsibility pattern – allows a request to be responded to by a number of listeners

o        Command pattern – class as function w/same default parameters. For transactions, mutli-layer undos, menu items.

o        Event listener

o        Interpreter pattern – interpret a command, decode the string, execute accordingly

o        Iterator pattern – glide across sets of objects

o        Mediator pattern – allows for loose coupling, by not hard-coding interfaces or colleagues

o        Memento/Snapshot pattern – throw a copy into a box, then retrieve it if undo is needed

o        Null Object

o        Observer pattern – Subscriber, like Swing EventListener, to update when change occurs

o        State pattern – repository to find out what state the application is in

o        Strategy pattern – object and behavior are separated. Use when objects attributes are the same, but differ only in behavior. Avoids subclassing & conditional switch statements

o        Template method pattern – Define interface & common functionality, but let subclasses worry about implementation details

o        Visitor pattern – external class acts upon other objects, without changing class definition

o        Single-serving visitor pattern

o        Hierarchical visitor pattern

·         Concurrency

o        Action at a distance pattern

o        Active Object

o        Balking pattern

o        Double checked locking pattern

o        Guarded suspension

o        Half-Sync/Half-Async pattern

o        Leaders/followers pattern

o        Event Monitor Object – Publish-Subscribe subscriber, Listener, like Swing Event Listener

o        Read write lock pattern

o        Scheduler pattern

o        Thread pool pattern

o        Thread-Specific Storage

o        Read/Write Lock  

o        Producer-Consumer  

o        Two-Phase Termination

·         J2EE

o        Business Delegate – JMS, Asynchronous, Business Logic-EJB tier

o        Composite Entity

o        Composite View

o        Access Objects

§         Data Access Object(DAO) – see DTO

§         Command Beans – see Command design pattern

§         Record Object – represents data structure

§         Uses set-execute-get JavaBean pattern

o        Dispatcher View

o        Fast Lane Reader

o        Front Controller

o        Intercepting Filter

o        Model-View-Controller

o        Service Activator

o        Service Locator – Service Directory – cached, encapsulated Singleton service connection and lookup

o        Service to Worker

o        Session Facade

o        Data Transfer Object(DTO) – Object to transfer info from App to EJB/Service. Use one object, not multiple, expensive get/set()s on Bean or Service. DTO has get/set()s. Create by business object/practice. Inherit from Business entity Bean if same attributes.

o        Transfer Object Assembler

o        Value List Handler

o        View Helper

·         Partitioning

o        Layered Initialization  

o        Filter  

o        Composite

·         GRASP

o        Controller  

o        Creator  

o        Expert  

o        Law of Demeter  

o        Low Coupling/High Cohesion  

o        Polymorphism  

o        Pure Fabrication

·         GUI Design

o        Conversational Text   

o        Direct Manipulation  

o        Ephemeral Feedback  

o        Explorable Interface  

o        Form  

o        Disabled Irrelevant Things  

o        Interaction Style  

o        Limited Selection Size  

o        Selection  

o        Step-by-Step Instructions  

o        Supplementary Window  

o        Window per Task

·         Organizational Coding

o        Accessor Method Name  

o        Anonymous Adapter  

o        Checked vs. Unchecked Exceptions  

o        Conditional Compilation  

o        Composed Method  

o        Convert Exceptions  

o        Define Constants in Interfaces  

o        Extend Super  

o        Intention Revealing Method  

o        ServerSocket  

o        Client Socket  

o        Switch  

o        Symbolic Constant Name

·         Optimization Coding Patterns

o        Double Checked Locking   

o        Hashed Adapter Objects  

o        Lazy Initialization  

o        Lookup Table  

o        Loop Unrolling

·         Robustness Coding

o        Assertion Testing  

o        Copy Mutable Parameters  

o        Guaranteed Cleanup  

o        Maximize Privacy  

o        Return New Objects from Accessor

·         Testing

o        Acceptance Testing  

o        Black Box Testing  

o        Clean Room Testing  

o        Integration Testing  

o        Regression Testing  

o        System Testing  

o        Unit Testing  

o        White Box Testing

·         Transaction

o        ACID Transaction

o        Audit Trail

o        Composite Transaction

o        Two Phase Commit

·         Distributed Architecture

o        Demilitarized Zone

o        Mobile Agent

o        Object Replication

o        Object Request Broker

o        Process Pair

o        Prompt Repair

o        Redundant Independent Objects

o        Shared Object

·         Distributed Computing

o        Connection Multiplexing

o        Heartbeat

o        Heavyweight/Lightweight Object

o        Mailbox

o        Object Identifier

o        Protection Proxy

o        Publish-Subscribe – entities can listen to single-point broadcast

o        Registry

o        Retransmission

·         Concurrency

o        Cache Consistency

o        Deep Transaction Nesting

o        Lock File

o        Optimistic Concurrency

o        Session Object

o        Static Locking Order

o        Thread Pool

·         Temporal

o        Temporal Property

o        Time Server

o        Versioned Object

·         Database

o        CRUD

o        isDirty

o        Lazy Retrieval

o        Persistence Layer

o        Stale Object

o        Type Conversion

·         Integration Styles

o        File Transfer

o        Shared Database

o        Remote Procedure Invocation

o        Messaging

·         Messaging Systems

o        Message Channel – publish-subscribe messaging

o        Message

o        Pipes and Filters

o        Message Router

o        Message Translator

o        Message Endpoint – Service endpoint

·         Messaging Channels

o        Point-to-Point Channel

o        Publish-Subscribe Channel

o        Datatype Channel

o        Invalid Message Channel

o        Dead Letter Channel

o        Guaranteed Delivery

o        Channel Adapter – External app can publish to a message channel: invokes functionality inside app

o        Messaging Bridge

o        Message Bus - MQ

·         Message Construction

o        Command Message

o        Document Message

o        Event Message

o        Request-Reply

o        Return Address

o        Correlation Identifier

o        Message Sequence

o        Message Expiration

o        Format Indicator

·         Message Routing

o        Content-Based Router

o        Message Filter

o        Dynamic Router

o        Recipient List

o        Splitter

o        Aggregator

o        Resequencer

o        Composed Msg. Processor

o        Scatter-Gather

o        Routing Slip

o        Process Manager

o        Message Broker

·         Message Transformation

o        Envelope Wrapper

o        Content Enricher

o        Content Filter

o        Claim Check

o        Normalizer

o        Canonical Data Model

·         Messaging Endpoints

o        Messaging Gateway – front Service interface, hides app backend functionality

o        Messaging Mapper

o        Transactional Client

o        Polling Consumer

o        Event-Driven Consumer – waits for messages.

o        Competing Consumers

o        Message Dispatcher

o        Selective Consumer

o        Durable Subscriber

o        Idempotent Receiver

o        Service Activator

·         System Management

o        Control Bus

o        Detour

o        Wire Tap

o        Message History

o        Message Store

o        Smart Proxy

o        Test Message

o        Channel Purger