We are in the process of making a tool that refactors a big pile of VB.NET code. During the refactoring process, we discovered that there are many conflicts between some new namespaces we added and some classes from imported assemblies. We want to introduce aliases to our imports and refactor all code that is affected with the alias.
For example:
Imports Internal.Framework.Security
Imports Internal.Framework.DataAccess
Imports Internal.Framework.Web
Partial Class TestClass
Inherits ilotControl
Private usrInfo As UserInfo = UserInfo.GetUserInfo
Sub InsertData()
Dim SQL As New IlotDataClient
SQL.OpenConnection(Configuration.GetConnectionString(0))
SQL.BeginTrans()
SQL.CloseConnection()
End Sub
End Class
Must become:
Imports frameworkSecurity = Internal.Framework.Security
Imports dao = Internal.Framework.DataAccess
Imports web = Internal.Framework.Web
Partial Class TestClass
Inherits web.ilotControl
Private usrInfo As frameworkSecurity.UserInfo = frameworkSecurity.UserInfo.GetUserInfo
Sub InsertData()
Dim SQL As New dao.IlotDataClient
SQL.OpenConnection(dao.Configuration.GetConnectionString(0))
SQL.BeginTrans()
SQL.CloseConnection()
End Sub
End Class
Most progress I have made is identifying which symbols should be refactored, but I haven't figured out how a smooth refactoring can take place. Any ideas ?