In this talk I will describe some objects of the generalized geometry that appear naturally in the qualitative analysis of mechanical systems. In particular we will discuss the Dirac structures within the framework of the systems with constraints and eventually of port-Hamiltonian systems. From the mathematical point of view, Dirac structures generalize simultaneously symplectic and Poisson structures. As for mechanics, the idea is to design numerical methods that preserve these structures and thus guarantee good physical behaviour in simulations. Then, I will present a framework which is even more general - the one of differential graded manifolds (also called Q-manifolds), and discuss some possible ways of using them for the "structure preserving integrators" in mechanics.