1. A computer program product comprising a storage device storing a computer readable program, wherein the computer readable program when executed on a computer causes the computer to: receive a topology pattern definition that specifies one or more topology roles, one or more components, and one or more deployment targets; receive one or more topology role definitions for the one or more topology roles, wherein a first factory class is registered that implements a role interface; receive one or more component definitions for the one or more components, wherein a second factory class is registered that implements a component interface; parse the topology pattern definition to identify the topology pattern; and generate an instance of a topology from the topology pattern by: generating the one or more topology roles in a topology role tier that is included in the topology pattern using the one or more topology role definitions; creating components in a component tier that are each defined in the topology pattern using the one or more component definitions, wherein each of the components corresponds to one of the one or more topology roles, and wherein at least one of the components has a dependency on another one of the components; and mapping the one or more topology roles to the one or more deployment targets.