Allon Mureinik has posted comments on this change.

Change subject: db: aggregate qos and storage qos impl
......................................................................


Patch Set 6:

(4 comments)

http://gerrit.ovirt.org/#/c/27094/6/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/qos/BaseQosDaoFacadeImpl.java
File 
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/qos/BaseQosDaoFacadeImpl.java:

Line 12: import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
Line 13: 
Line 14: public abstract class BaseQosDaoFacadeImpl<T extends BaseQos> extends 
DefaultGenericDaoDbFacade<T, Guid> implements QosDao<T> {
Line 15:     private final QosType qosType;
Line 16:     RowMapper<T> mapper = createEntityRowMapper();
> > 2) should be protected, used in derived classes, don't see any reason to 
I'd make the member private and add a protected getter, but I guess it's a 
matter of style. Can't say I'm overly concerned either way.
Line 17: 
Line 18:     public BaseQosDaoFacadeImpl(QosType qosType) {
Line 19:         super("qos");
Line 20:         this.qosType = qosType;


Line 31:      * @param map
Line 32:      * @param obj
Line 33:      * @return parameters mapper for derived QoS dao
Line 34:      */
Line 35:     protected abstract void 
updatePartialParametersMapper(MapSqlParameterSource map, T obj);
> Some reading material in the meanwhile...
I tend to agree with Moti and Yevgeny here.

Seems to me as though we should be aiming at a bridge design pattern, where 
every QosDAO has its own mapper.
Line 36: 
Line 37:     /**
Line 38:      * @return qos type for derived qos dao
Line 39:      */


Line 52:     }
Line 53: 
Line 54:     @Override
Line 55:     protected RowMapper<T> createEntityRowMapper() {
Line 56:         return new RowMapper<T>() {
> this is a collateral impact of the dao-mapper design mixture.
+1 - agreed.
Line 57:             @Override
Line 58:             public T mapRow(ResultSet rs, int rowNum)
Line 59:                     throws SQLException {
Line 60:                 T entity = createPartialQosEntity(rs);


Line 83:     @Override
Line 84:     protected MapSqlParameterSource createIdParameterMapper(Guid guid) 
{
Line 85:         return getCustomMapSqlParameterSource()
Line 86:                 .addValue("id", guid);
Line 87:     }
Can you use org.ovirt.engine.core.dao.BaseDAODbFacade#createGuidMapper ?
Line 88: 
Line 89:     protected Integer getIntegerOrNull(ResultSet rs, String 
columnName) throws SQLException {
Line 90:         int i = rs.getInt(columnName);
Line 91:         return rs.wasNull() ? null : i;


-- 
To view, visit http://gerrit.ovirt.org/27094
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I1a9af59277b5055453159f002f19046c0051d63b
Gerrit-PatchSet: 6
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Gilad Chaplik <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Doron Fediuck <[email protected]>
Gerrit-Reviewer: Eli Mesika <[email protected]>
Gerrit-Reviewer: Gilad Chaplik <[email protected]>
Gerrit-Reviewer: Kobi Ianko <[email protected]>
Gerrit-Reviewer: Liron Ar <[email protected]>
Gerrit-Reviewer: Moti Asayag <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
Gerrit-Reviewer: Yevgeny Zaspitsky <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to