We help IT Professionals succeed at work.
Get Started

VB.NET - Refactor Class per SOLID principles

CipherIS
CipherIS asked
on
297 Views
Last Modified: 2017-03-23
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

Open in new window

Comment
Watch Question
Software Engineer
CERTIFIED EXPERT
Commented:
This problem has been solved!
Unlock 1 Answer and 2 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE