A simple, flexible and universal solution using the Eclipse modeling framework(EMF) for developing systems based on the common information model(CIM) is proposed. The scheme contains three aspects. Firstly, the Java code of package, class and object relations defined in CIM are automatically generated. Secondly, the CIM extendable markup language(XML) file can be efficiently scanned through streams, objects are formed in the memory during the scanning process, the relations between objects are constructed after the scan is finished. The differences of different energy management system(EMS) suppliers and different CIM versions are shielded, so good compatibility is reached. Thirdly, the constraints of objects defined in CIM are validated. The validity of the solution is testified by test results of CIM data of several real systems.