> This file
>
> src/java/org/apache/turbine/admin/screens/admin/user/EditUser.java
>
> uses straight SQL:
>
> qds = new QueryDataSet(connection,
> "SELECT * FROM Visitor WHERE VISITORID=" + user_id );
>
> Is this right? Or should this file use a Peer class for this?
It would be better if it was using the TurbineUser object. It is better
practice to use business objects in Screens not the Peers. It is sometimes
the case that you are grabbing a set of business objects and this grabbing
of a set is coded in the Peer.
> I found two other files that also use QueryDataSet directly
> (but no SQL):
>
> src/java/org/apache/turbine/util/db/IDBroker.java
> src/java/org/apache/turbine/util/db/LargeSelect.java
IDBroker is used by Peers not the other way around, so it is fine.
LargeSelect is somewhat outside the scope of the BO/Peer model. It might be
a good example to follow in building something similar, though I am not
sure. It is for basic reporting of possibly a large set of rows from a
database.
I.e. it is not trivial to write a collection of objects within another
object in a manner that only a few of the objects are actually in memory at
one time (I think it is more common to limit the size of the objects through
the use of proxies). Or maybe it is trivial, I don't know, but LargeSelect
is not intended to address this.
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]