Codes over rings : maximum distance separability and self-duality