With respect to the new undo/redo framework the following is noticed: new objects are created in the redo method. This can break the redo.
AddAtom.redo() creates a new Atom, ie. a new object. AddBond.redo() adds a Bond betwen two atoms. These two atoms (atom objects) are fixed in the class.
Now do this: Create two atoms, link them with a bond. Fine so far. Undo all three actions. Redo the add atom. You get two new atom objects. Redo the add
bond. It adds a bond between the old atoms, this is incorrect.
Possible solution is either to change things to identify objects by something like IDs, which you make immutable or you must make sure that your undo/redo
methods only add/remove objects from/to the model, which stay unchanged. This is actually the main reason why the old code had a separate code for doing
the first action and then the undo/redo. Of course it can be done in the new design, but then one needs to do the creation of object in the constructor or