TITLE: How does passing to ideals solve the problem of unique factorization?
QUESTION [11 upvotes]: $A:=\mathbb{Z}[\sqrt{-5}]$ is not a UFD, because for instance
$$21 = 3 \cdot 7 = \left( 1+2\sqrt{-5}\right) \cdot  \left(1-2\sqrt{-5}\right).$$
But since $A$ is a Dedekind domain, we should have unique factorization of ideals into prime ideals (this is, after all, the whole point of introducing Dedekind domains). But is it not the case that the ideals $(3)$,$(7)$,$\left( 1+2\sqrt{-5}\right)$,$\left( 1-2\sqrt{-5}\right)$ are all different prime ideals and that 
$$(21) = (3) \cdot (7) = \left( 1+2\sqrt{-5}\right) \cdot  \left(1-2\sqrt{-5}\right)?$$
What am I missing?

REPLY [5 votes]: By bypassing the problems of signs and quadrants, to identify the unique origins of multiple distinct factorizations.
Even in $\textbf{Z}$ we have the problem of signs. How, for example, do you factorize $-30$? A computer program like Mathematica says $-1 \times 2 \times 3 \times 5$, but by the caveats of the fundamental theorem of arithmetic, $-2 \times -3 \times -5$ is also a valid factorization.
But with ideals, it's just $\langle 2 \rangle \langle 3 \rangle \langle 5 \rangle$ and we can add minus signs to any of those generators and it doesn't make a difference.
And then when we get to $\textbf{Z}[\sqrt{-5}]$, we're neither concerned with which quadrant of the complex plane a number is nor the quadrant of its ideals' generators, since they're all included, e.g., $-4 + \sqrt{-5} \in \langle$