I also refactor some other classes of the framework a little bit as it seems sensible to do so. The Data class gets methods to set and get attribute values not only by id but also by name, which is by now accomplished by calling a method on DataDescriptor (see A.1, p.
).
Data data=new Data("employee");
data.setAttribute(data.getDescriptor().getAttributeId("name"),"Michael");
is now done by:
data.setAttribute("name","Michael");
The Kriterium class is also equipped with a new method that allows it to set an expression in one step rather that in two.
Kriterium krit=new Kriterium("employee");
// which is possible due to the previous step
krit.setAttribute("name","Michael");
krit.setOperatorId("name",Kriterium.LIKE);
is now done by:
krit.setComparision("name",Kriterium.LIKE,"Michael");
This not only increases the readability of the code but also reduces the amount of not duplicate but similar code.