Given the reaction $\ce{A -> B}$ you know that $\ce{A}$ and $\ce{B}$ must have the same atomic composition, i.e. they consist of the same number of atoms for each element, because if this wasn't the case there would be other reactants or products in the reaction equation (the reaction is some sort of rearrangement). So, $\ce{A}$ and $\ce{B}$ only differ in the way the atoms are linked together, i.e. some bonds that are present in $\ce{A}$ might not be present in $\ce{B}$ and vice versa.
Now, Hess' law, which states that the total enthalpy change during the complete course of a reaction is the same whether the reaction is made in one step or in several steps, leads you to the equation
$$\Delta H = \sum \Delta H_F \left( \text{products}\right)-\Delta H_F \left( \text{reactants}\right)$$
where $\Delta H_F$ is the enthalpy of formation. This $\Delta H_F$ is simply the energy difference between the target compound and the (pure) elements it consists of, whereby each element is expected to be in its most stable modification for the given temperature.
\begin{equation}
\Delta H_F = H_{\text{molecule}} - H_{\text{elements}}
\end{equation}
So, $\Delta H_F$ (mostly) describes how much energy is gained by forming bonds in the molecule. Now, since $\ce{A}$ and $\ce{B}$ have the same atomic composition, i.e. they have the same $H_{\text{elements}}$, you see that the energy difference between them must come from the energy difference of the bonds in $\ce{A}$ and $\ce{B}$. The part of bonding energy that comes from bonds that both $\ce{A}$ and $\ce{B}$ have in common cancels out and what remains is
$$\Delta H = \left( \begin{array}{c} \text{total enthalpy of}\\ \text{bonds broken}\end{array}\right)-\left( \begin{array}{c} \text{total enthalpy of}\\ \text{bonds made}\end{array}\right)$$
So, yes, both methods are equivalent.