Multiple Services and Class library

I am creating two independent services, but both need to use some of the same classes I created.
For example, the File Class below.
Should I have a copy of the class in each project, or should I be moving this to a seperate class library?
Option Strict On
Option Explicit On
 
Public Class File
 
    Private _name As String
    Private _lastAction As FileActions = FileActions.Unknown
    Private _guid As Guid
    Private _created As Date
 
    Public Property Name() As String
        Get
            Return _name
        End Get
        Set(ByVal value As String)
            _name = value
        End Set
    End Property
 
    Public Property LastAction() As FileActions
        Get
            Return _lastAction
        End Get
        Set(ByVal value As FileActions)
            _lastAction = value
        End Set
    End Property
 
    Public ReadOnly Property Extension() As String
        Get
            Return _name.Substring(_name.LastIndexOf("."), 4)
        End Get
    End Property
 
    Public ReadOnly Property Guid() As Guid
        Get
            Return _guid
        End Get
    End Property
 
    Public ReadOnly Property Created() As Date
        Get
            Return _created
        End Get
    End Property
 
    Public Sub New()
        _guid = Guid.NewGuid()
        _created = Date.Now
    End Sub
 
End Class

Open in new window

LVL 8
JRockFLAsked:
Who is Participating?
 
Jaime OlivaresConnect With a Mentor Software ArchitectCommented:
will be better to put into a class library, because if you detect a bug in your shared class or want to enhance it, you will have to go to every project and update it.
0
All Courses

From novice to tech pro — start learning today.