Tuesday, April 5, 2011

Lesser Known Design Patterns with Bevan Arps

Wellington Dot Net User Group Meeting

  1. NULL Object Pattern - useful to declutter your code. Requires creation of a Null object in order to remove requirement to always check whether your object exists.

  2. Command Pattern - Create function objects that interact with the object hierarchy.

    • Effects: Localises code; Undo/Compensation; New function: New object.

    • Considerations: Open-closed principle; # Classes; Likelihood of changes

  3. Emancipated Objects Pattern - make objects responsibile for maintaining their own state.

    • Effects: Read-only properties; Mutator methods; Validation

    • Considerations: Applicability; Reusability; ORMs

  4. Proposal Pattern - Complex Domain Factories. Explictly model the process that leads up to creation of the original object.

    • Effects: Natural Validation; Reduced Complexity; Increased Flexibility; Error Tolerant.

      Considerations: Process Complexity; Process Duration.

  5. State Pattern - Complex Domain Behaviour. Partially change the type of the object by swapping out behaviours based on state.

    • Effects: Switching removed; Grouped behaviour

    • Considerations: # Classes; Encapsulation; Complexity of Behaviour

    No comments:

    Post a Comment