I know that with OS X Lion (10.7) and Mountain Lion (10.8) applications can be assigned to specific Spaces/Desktops. With my laptop I daily connect and disconnect from an external monitor. When I disconnect, all my app windows are automatically gathered to the laptop monitor, of course.
When I reconnect to the external monitor, I manually move my app windows back to the second screen. Is there some functionality that is built into OS X that would automatically restore those application windows back to where they were previously?