  We consider a system consisting of a $\Lambda$-type atom and a V-type atom,
which are individually trapped in two spatially separated cavities that are
connected by an optical fibre. We show that an extremely entangled state of the
two atoms can be deterministically generated through both photon emission of
the $\Lambda$-type atom and photon absorption of the V-type atom in an ideal
situation. The influence of various decoherence processes such as spontaneous
emission and photon loss on the fidelity of the entangled state is also
investigated. We find that the effect of photon leakage out of the fibre on the
fidelity can be greatly diminished in some special cases. As regards the effect
of spontaneous emission and photon loss from the cavities, we find that the
present scheme with a fidelity higher than 0.98 may be realized under current
experiment conditions.
