# Direct sum of complexes in chain complex

In Hatcher's Algebriac Topology, on page 190, he mentions that a chain complex of finitely generated abelian groups

always splits as the direct sum of elementary complexes of the forms $$0\rightarrow\mathbb{Z}\rightarrow 0$$ and $$0\rightarrow\mathbb{Z}\xrightarrow{m}\mathbb{Z}\rightarrow 0$$.

I understand that this seems to be related to the Smith normal form. But what precisely does it mean that a chain complex is a "direct sum of elementary complexes"? There isn't anything said about the algebra of chain complexes. What am I taking the direct sum of, and how am I obtaining the final boundary map?

If $$C_\bullet$$ and $$D_\bullet$$ are chain complexes with boundary maps $$\partial_C$$ and $$\partial_D$$ respectively, then their direct sum is defined to be the chain complex with $$n$$th term $$C_n \oplus D_n$$, and with boundary map $$C_n \oplus D_n \xrightarrow{\partial_C \oplus \partial_D} C_{n-1} \oplus D_{n-1}.$$