You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2017/07/15 15:26:50 UTC

[Bug 61302] New: Refactoring of DataSourceProxy

https://bz.apache.org/bugzilla/show_bug.cgi?id=61302

            Bug ID: 61302
           Summary: Refactoring of DataSourceProxy
           Product: Tomcat 9
           Version: 9.0.0.M10
          Hardware: PC
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Connectors
          Assignee: dev@tomcat.apache.org
          Reporter: lemesmachado@gmail.com
  Target Milestone: -----

Hello everyone.
I was analyzing the modularization of some classes, and I identified that the
class DataSourceProxy has an opportunity for cohesion improvement. 
The class Http11Protocol was in the same situation and the problem was solved
as follows: The HttpBaseProtocol class was created, and several get() and set()
methods that were used only to configure the class parameters were moved from
Http11Protocol to HttpBaseProtocol. 
The new class was then accessed through an instance variable in Http11Protocol.
This strategy has cleaned and improved Http11Protocol cohesion.
With this in mind, I would recommend creating a new class:
DataSourceProxyConfig , and moving the following methods:

setDefaultCatalog
getNumTestsPerEvictionRun
setMaxAge
getConnection
setTestWhileIdle
getPropagateInterruptState
getPoolSize
setPassword
setLoginTimeout
getIdle
getDriverClassName
getDataSourceJNDI
setAlternateUsernameAllowed
getValidationInterval
getValidator
setValidationQuery
setUrl
setCommitOnReturn
getPassword
setLogWriter
getDbProperties
setTimeBetweenEvictionRunsMillis
getLogWriter
setValidationInterval
getName
getUseDisposableConnectionFacade
getUrl
getMinIdle
getXAConnection
getRollbackOnReturn
getMaxIdle
getPoolName
getInitSQL
setLogValidationErrors
setRemoveAbandoned
setDefaultAutoCommit
setName
setRollbackOnReturn
getMaxActive
setDataSource
getLogValidationErrors
getJdbcInterceptorsAsArray
setUseDisposableConnectionFacade
getMinEvictableIdleTimeMillis
getRemoveAbandonedTimeout
setDefaultTransactionIsolation
setMinIdle
setValidator
setInitialSize
getConnectionProperties
getInitialSize
setUsername
setUseLock
getMaxAge
getNumActive
getDefaultAutoCommit
setDataSourceJNDI
setValidationQueryTimeout
getSuspectTimeout
getConnectionAsync
setPoolProperties
setJmxEnabled
setPropagateInterruptState
setMaxWait
getPoolProperties
getUseLock
getActive
setAbandonWhenPercentageFull
getNumIdle
getMaxWait
getSize
getParentLogger
setDriverClassName
setLogAbandoned
setRemoveAbandonedTimeout
setTestOnConnect
getAbandonWhenPercentageFull
setAccessToUnderlyingConnectionAllowed
getPooledConnection
setTestOnBorrow
setTestOnReturn
setValidatorClassName
setUseEquals
getUsername
setDbProperties
getTimeBetweenEvictionRunsMillis
setIgnoreExceptionOnPreLoad
getDefaultReadOnly
getCommitOnReturn
setConnectionProperties
getPool
setMaxIdle
setJdbcInterceptors
getDataSource
getWaitCount
getValidationQuery
getValidationQueryTimeout
getDefaultTransactionIsolation
setDefaultReadOnly
getJdbcInterceptors
setFairQueue
getLoginTimeout
getDefaultCatalog
setMaxActive
setSuspectTimeout
setMinEvictableIdleTimeMillis
setNumTestsPerEvictionRun
getValidatorClassName
setInitSQL

from the DataSourceProxy.
Those parameters accessed by an instance variable in the DataSourceProxy.
Moreover, the orthogonality is the design would be enhanced.

What do you think about that?

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 61302] Refactoring of DataSourceProxy

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61302

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|9.0.0.M10                   |unspecified
          Component|Connectors                  |jdbc-pool
   Target Milestone|-----                       |---
            Product|Tomcat 9                    |Tomcat Modules
                 OS|                            |All

--- Comment #1 from Mark Thomas <ma...@apache.org> ---
Correcting product

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org