Quantcast
Channel: Testing – [Agile for All]
Viewing all articles
Browse latest Browse all 35

Good Design, Part III: Refactoring

$
0
0

Remember this?

 

public static ProductBean installProduct(String p) {

 ProductBean pi = new ProductBean(p); Connection c = new Connection("$Updates"); for (Record x : c.getAllForKey("PLUG_INS", "P_NAME", p)) { // validate serial number if ("SNUM".equals(x.getString("RECORD_TYPE"))) { SecurityHelper.validateProduct(x.getString("SERIAL_NUMBER"), getEncryptionCertificate()); pi.addSerialNumber(x.getString("SERIAL_NUMBER")); } // install license if ("LIC".equals(x.getString("RECORD_TYPE"))) { SecurityHelper.validateLicense(x.getString("USER_LICENSE"), getEncryptionCertificate()); SecurityHelper.registerLicense(x.getString("USER_LICENSE")); pi.addLicense(x.getString("USER_LICENSE")); } // install driver

Read More

The post Good Design, Part III: Refactoring appeared first on Agile For All.


Viewing all articles
Browse latest Browse all 35

Trending Articles