Hi Rob,
1. Can we change the name of NopWhereClausePart to EmptyWhereClausePart
? That seems a bit more readable to me.
Of course. The first programming language I learned was Step 5 (the
programming language for Simatic S5 an Programable Logic Controller
within automation systems. Within the most build in functions you
needed the NOP operator for the NoOperation - Seems that the old
times are very present in my head :-)
I will update the code and JavaDoc.
2. Would it be possible to use an additional ParameterWhereClausePart to
make the call to CellComponentFactory.setPreparedStatementValue unnecessary?
Hm, with the call of CellComponentFactory.setPreparedStatementValue
we set the data of the changed data field. In the strict sense, this
is not an part of the where clause. If we add an additional
ParameterWhereClausePart for the changed data - that would be like
cheating.
If we want do this, we could:
* use an placeholder that is on the right (first) position which
is responsible only for setting the parameter and not for
creating the set=? part.
* or enhance the functionality, that constructing the update
statement is part of if (and maybe - insert/delete/select)
* or another suggestion?
3. Would it be too much trouble to give WhereClausePartUtil an interface.
Of course not. I think I didn't see an Dependency Injection
Container within Squirrel - So would it be appropriate to create an
instance variable initialized with an default, that could be
overwritten by the setter at each class where is is used?
I will prepare the first and the third part of your suggestions.
But what should we do with the second one?
Stefan
Am 2011-02-26 15:52, schrieb Robert Manning:
> I am reviewing it now. So far I like what I am seeing. At the
> moment I have a few questions:
>
> 1. Can we change the name of NopWhereClausePart to Empty
> WhereClausePart ? That seems a bit more readable to me.
>
> 2. In DataSetUpdateableTableModelImpl.updateTableComponent, in your
> new code, there is now this:
>
> // into the first (and only) variable position in the
> prepared stmt
> CellComponentFactory.setPreparedStatementValue(
> colDefs[col], pstmt, newValue, 1);
> WhereClausePartUtil.setParameters(pstmt, whereClauseParts, 2);
>
> Would it be possible to use an additional ParameterWhereClausePart to
> make the call to CellComponentFactory.setPreparedStatementValue
> unnecessary ?
>
> 3. Would it be too much trouble to give WhereClausePartUtil an
> interface (say IWhereClausePartUtil) and have it be injectable instead
> of static ? (so - a WhereClausePartUtil instance variable with a
> public setter that accepts IWhereClausePartUtil in each class where it
> is used; This helps with testability)
>
> Rob
|