I show that a minimal model for the interaction of magnetic domains, that includes a short range rigidity and a long range dipolar interaction, can reproduce most of the known phenomenology of two dimensional magnetic domain patterns. In particular bubble and stripe phases are obtained, along with (metastable) polygonal and labyrinthine morphologies. In addition, two puzzling phenomena, namely the so called `memory effect' and the `topological melting' observed experimentally are also accurately described. Very similar phenomenology occurs in the case in which the model is changed to be represented by the Swift-Hohenberg equation driven by an external orienting field.