June 01, 2002
DocumentBuilder: An Alternative to Hard-Coded String Concatenation
Matt Nicolls
Separating structure from content always begets a welcome flexibility. An effective deployment of Template Method, la Mail Merge in this case, does the trick.
Java Solutions June 2002/DocumentBuilder: An Alternative to Hard-Coded String Concatenation/Figure 1
0: String sql = "INSERT INTO Customer(SSN, Name, Address) ";
1: sql += "VALUES('";
2: sql += cust.getSSN() + "', '";
3: sql += cust.getName() + "', '";
4: sql += cust.getAddress() + "')";
End of Figure
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
11
|
12
Next Page