It is by now well known that numerous open systems in physics (fluids, plasmas, lasers, nonlinear optical devices, semiconductors), chemistry and biology (morphogenesis) may spontaneously develop spatial, temporal or spatiotemporal structures by self-organization. Quite often, striking analogies between the corresponding patterns can be observed in spite of the fact that the underlying systems are of quite a different nature. In this paper I shall first give an outline of general concepts that allow us to deal with the spontaneous formation of structures from a unifying point of view that is based on concepts of instability, order parameters and enslavement. We shall discuss a number of generalized Ginzburg-Landau equations. In most cases treated so far, theory started from microscopic or mesoscopic equations of motion from which the evolving structures were derived. In my paper I shall address two further problems that are in a way the reverse, namely (1) Can we derive order parameters and the basic modes from observed experimental data? (2) Can we construct systems by means of an underlying dynamics that are capable of producing patterns or structures that we prescribe? In order to address (1), a new variational principle that may be derived from path intergrals is introduced and illustrated by examples. An approach to the problem (2) is illustrated by the device of a computer that recognizes patterns and that may be realized by various kinds of spontaneous pattern formations in semiconductors and lasers.