Abstract: A part containing magnesium is coated by wetting the part with a polymer solution that contains polyetherimide and a solvent to provide a wetted part; and drying the wetted part to form a coating layer on the part. The corrosion rate of a biocomponent made of magnesium or a magnesium alloy is controlled by forming a coating layer on the biocomponent according to a method described herein, wherein the coating layer has a porosity that provides a corresponding corrosion rate.