Principles & Patterns

Design Goals

Goals are non-negotiable.

·       Correctness: The behavior of a system/component conforms to its specification (assuming the specification is correct).

·       Efficiency: The system/component does not waste resources such as time and memory.

·       Maintainability: Repairing or enhancing a system/component is not needlessly difficult.

·       Security: The system/module prevents unauthorized or unintended use.

Design Principles

Principles usually help us achieve goals.

·       Modularity: Systems should be built from cohesive, loosely coupled components (modules).

·       Abstraction: The interface of a component should be independent of its implementation.

·       Open-Closed: A component should be open to extension but closed to modification.

·       Reusability: Components should be easy to reuse.

·       Avoid mixed-Domain Coupling: Component in a more reusable layer shouldn't depend on components in less reusable layers:

image009

Foundation components: String, Date, Number, etc.

Architectural components: Window, Menu, Dispatcher, etc.

Domain components: Policy, Employee, Shipper, Cart, etc.

Application Component: Controller, UserInterface, MenuListener, etc.

Metrics

A design metric measures the quality of a design.

Design Metrics (new)

Design Metrics (old)

Design Patterns

A design pattern is a well-designed, recurring collaboration.

A pattern catalog is an organized collection of design patterns.

A typical catalog entry has some form of the problem-solution format:

Name: The name of this pattern
Problem: The common problem solved by this pattern
Solution: The common solution expressed as a template

Examples

·       The Adapter Pattern

·       The Composite Pattern

·       The Strategy Pattern

References

·       Background

·       Books and Papers

·       A Pattern Catalog

Anti-Patterns & Refactoring

An anti-pattern is a recurring design flaw. Usually the flaw violates one or more design principles.

Refactoring is a process that transforms poorly designed code into equivalent well-designed code.

Here are a few examples.

Anti-patterns

More can be found here:

Refactoring anti-patterns

Labs

Design Principles

Design Metrics

Design Patterns

Anti-Patterns

Projects

Design Analyzer Project

Design Analyzer

Meta Model Project

Meta Model

Pattern Labs

Design Pattern Labs