CipherIS
asked on
VB.NET - Refactor Class per SOLID principles
Working on a project and the .NET application contained IP's all over the code. I created a class to put them in one spot based on SOLID. Looking at the below class can this be refactored? Should I create an Interface then a class that inherits that Interface and a class for each IP?
Namespace Properties
Module IPAddress
Private _ProdIP As String = "1.2.3.4"
Public ReadOnly Property ProdIP() As String
Get
Return _ProdIP
End Get
End Property
Private _TestIP As String = "2.3.4.5"
Public ReadOnly Property TestIP() As String
Get
Return _TestIP
End Get
End Property
Private _QAIP As String = "3.4.5.6"
Public ReadOnly Property QAIP() As String
Get
Return _QAIP
End Get
End Property
End Module
End Namespace
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
for ease of maintenance I would have created something like:
Public Class addreses
Public Const ProdIP As String = "1.2.3.4"
Public Const TestIP As String = "2.3.4.5"
Public Const QAIP As String = "3.4.5.6"
End Class
or an ENUM