We study the dynamics of a ferromagnetic domain wall driven by an external magnetic field through a disordered medium. The avalanche-like motion of the domain walls between pinned configurations produces a noise known as the Barkhausen effect. We discuss experimental results on soft ferromagnetic materials, with reference to the domain structure and the sample geometry, and report Barkhausen noise measurements on Fe\(_{21}\)Co\(_{64}\)B\(_{15}\) amorphous alloy. We construct an equation of motion for a flexible domain wall, which displays a depinning transition as the field is increased. The long-range dipolar interactions are shown to set the upper critical dimension to \(d_c=3\), which implies that mean-field exponents (with possible logarithmic correction) are expected to describe the Barkhausen effect. We introduce a mean-field infinite-range model and show that it is equivalent to a previously introduced single-degree-of-freedom model, known to reproduce several experimental results. We numerically simulate the equation in \(d=3\), confirming the theoretical predictions. We compute the avalanche distributions as a function of the field driving rate and the intensity of the demagnetizing field. The scaling exponents change linearly with the driving rate, while the cutoff of the distribution is determined by the demagnetizing field, in remarkable agreement with experiments.