Skip to content

Commit

Permalink
Refactor components to provide file extension list
Browse files Browse the repository at this point in the history
Parent functionality such as determining the most recent file modified, getting the last modified date, and checking for alternate source files is better done by having the class provide the list of file extensions that might be used by the class, and having single external functions perform these tasks. (Avoids some redundant code.)
  • Loading branch information
joyfullservice committed Dec 1, 2023
1 parent b70b8cd commit 2b37bdb
Show file tree
Hide file tree
Showing 29 changed files with 421 additions and 461 deletions.
26 changes: 12 additions & 14 deletions Version Control.accda.src/modules/IDbComponent.cls
Original file line number Diff line number Diff line change
Expand Up @@ -149,20 +149,6 @@ Public Function DateModified() As Date
End Function


'---------------------------------------------------------------------------------------
' Procedure : SourceModifiedDateDate
' Author : Adam Waller
' Date : 4/27/2020
' Purpose : The date/time the source object was modified. In most cases, this would
' : be the date/time of the source file, but it some cases like SQL objects
' : the date can be determined through other means, so this function
' : allows either approach to be taken.
'---------------------------------------------------------------------------------------
'
Public Function SourceModifiedDate() As Date
End Function


'---------------------------------------------------------------------------------------
' Procedure : BaseFolder
' Author : Adam Waller
Expand All @@ -184,6 +170,18 @@ Public Property Get SourceFile() As String
End Property


'---------------------------------------------------------------------------------------
' Procedure : FileExtensions
' Author : Adam Waller
' Date : 12/1/2023
' Purpose : A collection of the file extensions used in source files for this
' : component type.
'---------------------------------------------------------------------------------------
'
Public Property Get FileExtensions() As Collection
End Property


'---------------------------------------------------------------------------------------
' Procedure : GetFileList
' Author : Adam Waller
Expand Down
29 changes: 14 additions & 15 deletions Version Control.accda.src/modules/clsAdpFunction.cls
Original file line number Diff line number Diff line change
Expand Up @@ -188,21 +188,6 @@ Private Function IDbComponent_DateModified() As Date
End Function


'---------------------------------------------------------------------------------------
' Procedure : SourceModifiedDate
' Author : Adam Waller
' Date : 4/27/2020
' Purpose : The date/time the source object was modified. In most cases, this would
' : be the date/time of the source file, but it some cases like SQL objects
' : the date can be determined through other means, so this function
' : allows either approach to be taken.
'---------------------------------------------------------------------------------------
'
Private Function IDbComponent_SourceModifiedDate() As Date
IDbComponent_SourceModifiedDate = GetLastModifiedDate(IDbComponent_SourceFile)
End Function


'---------------------------------------------------------------------------------------
' Procedure : Category
' Author : Adam Waller
Expand All @@ -226,6 +211,20 @@ Private Property Get IDbComponent_BaseFolder() As String
End Property


'---------------------------------------------------------------------------------------
' Procedure : FileExtensions
' Author : Adam Waller
' Date : 12/1/2023
' Purpose : A collection of the file extensions used in source files for this
' : component type.
'---------------------------------------------------------------------------------------
'
Private Property Get IDbComponent_FileExtensions() As Collection
Set IDbComponent_FileExtensions = New Collection
IDbComponent_FileExtensions.Add "sql"
End Property


'---------------------------------------------------------------------------------------
' Procedure : Name
' Author : Adam Waller
Expand Down
29 changes: 14 additions & 15 deletions Version Control.accda.src/modules/clsAdpProcedure.cls
Original file line number Diff line number Diff line change
Expand Up @@ -188,21 +188,6 @@ Private Function IDbComponent_DateModified() As Date
End Function


'---------------------------------------------------------------------------------------
' Procedure : SourceModifiedDate
' Author : Adam Waller
' Date : 4/27/2020
' Purpose : The date/time the source object was modified. In most cases, this would
' : be the date/time of the source file, but it some cases like SQL objects
' : the date can be determined through other means, so this function
' : allows either approach to be taken.
'---------------------------------------------------------------------------------------
'
Private Function IDbComponent_SourceModifiedDate() As Date
IDbComponent_SourceModifiedDate = GetLastModifiedDate(IDbComponent_SourceFile)
End Function


'---------------------------------------------------------------------------------------
' Procedure : Category
' Author : Adam Waller
Expand All @@ -226,6 +211,20 @@ Private Property Get IDbComponent_BaseFolder() As String
End Property


'---------------------------------------------------------------------------------------
' Procedure : FileExtensions
' Author : Adam Waller
' Date : 12/1/2023
' Purpose : A collection of the file extensions used in source files for this
' : component type.
'---------------------------------------------------------------------------------------
'
Private Property Get IDbComponent_FileExtensions() As Collection
Set IDbComponent_FileExtensions = New Collection
IDbComponent_FileExtensions.Add "sql"
End Property


'---------------------------------------------------------------------------------------
' Procedure : Name
' Author : Adam Waller
Expand Down
29 changes: 14 additions & 15 deletions Version Control.accda.src/modules/clsAdpServerView.cls
Original file line number Diff line number Diff line change
Expand Up @@ -188,21 +188,6 @@ Private Function IDbComponent_DateModified() As Date
End Function


'---------------------------------------------------------------------------------------
' Procedure : SourceModifiedDate
' Author : Adam Waller
' Date : 4/27/2020
' Purpose : The date/time the source object was modified. In most cases, this would
' : be the date/time of the source file, but it some cases like SQL objects
' : the date can be determined through other means, so this function
' : allows either approach to be taken.
'---------------------------------------------------------------------------------------
'
Private Function IDbComponent_SourceModifiedDate() As Date
IDbComponent_SourceModifiedDate = GetLastModifiedDate(IDbComponent_SourceFile)
End Function


'---------------------------------------------------------------------------------------
' Procedure : Category
' Author : Adam Waller
Expand All @@ -226,6 +211,20 @@ Private Property Get IDbComponent_BaseFolder() As String
End Property


'---------------------------------------------------------------------------------------
' Procedure : FileExtensions
' Author : Adam Waller
' Date : 12/1/2023
' Purpose : A collection of the file extensions used in source files for this
' : component type.
'---------------------------------------------------------------------------------------
'
Private Property Get IDbComponent_FileExtensions() As Collection
Set IDbComponent_FileExtensions = New Collection
IDbComponent_FileExtensions.Add "sql"
End Property


'---------------------------------------------------------------------------------------
' Procedure : Name
' Author : Adam Waller
Expand Down
29 changes: 14 additions & 15 deletions Version Control.accda.src/modules/clsAdpTable.cls
Original file line number Diff line number Diff line change
Expand Up @@ -248,21 +248,6 @@ Private Function IDbComponent_DateModified() As Date
End Function


'---------------------------------------------------------------------------------------
' Procedure : SourceModifiedDate
' Author : Adam Waller
' Date : 4/27/2020
' Purpose : The date/time the source object was modified. In most cases, this would
' : be the date/time of the source file, but it some cases like SQL objects
' : the date can be determined through other means, so this function
' : allows either approach to be taken.
'---------------------------------------------------------------------------------------
'
Private Function IDbComponent_SourceModifiedDate() As Date
IDbComponent_SourceModifiedDate = GetLastModifiedDate(IDbComponent_SourceFile)
End Function


'---------------------------------------------------------------------------------------
' Procedure : Category
' Author : Adam Waller
Expand All @@ -286,6 +271,20 @@ Private Property Get IDbComponent_BaseFolder() As String
End Property


'---------------------------------------------------------------------------------------
' Procedure : FileExtensions
' Author : Adam Waller
' Date : 12/1/2023
' Purpose : A collection of the file extensions used in source files for this
' : component type.
'---------------------------------------------------------------------------------------
'
Private Property Get IDbComponent_FileExtensions() As Collection
Set IDbComponent_FileExtensions = New Collection
IDbComponent_FileExtensions.Add "txt"
End Property


'---------------------------------------------------------------------------------------
' Procedure : Name
' Author : Adam Waller
Expand Down
29 changes: 14 additions & 15 deletions Version Control.accda.src/modules/clsAdpTrigger.cls
Original file line number Diff line number Diff line change
Expand Up @@ -214,21 +214,6 @@ Private Function IDbComponent_DateModified() As Date
End Function


'---------------------------------------------------------------------------------------
' Procedure : SourceModifiedDate
' Author : Adam Waller
' Date : 4/27/2020
' Purpose : The date/time the source object was modified. In most cases, this would
' : be the date/time of the source file, but it some cases like SQL objects
' : the date can be determined through other means, so this function
' : allows either approach to be taken.
'---------------------------------------------------------------------------------------
'
Private Function IDbComponent_SourceModifiedDate() As Date
IDbComponent_SourceModifiedDate = GetLastModifiedDate(IDbComponent_SourceFile)
End Function


'---------------------------------------------------------------------------------------
' Procedure : Category
' Author : Adam Waller
Expand All @@ -252,6 +237,20 @@ Private Property Get IDbComponent_BaseFolder() As String
End Property


'---------------------------------------------------------------------------------------
' Procedure : FileExtensions
' Author : Adam Waller
' Date : 12/1/2023
' Purpose : A collection of the file extensions used in source files for this
' : component type.
'---------------------------------------------------------------------------------------
'
Private Property Get IDbComponent_FileExtensions() As Collection
Set IDbComponent_FileExtensions = New Collection
IDbComponent_FileExtensions.Add "sql"
End Property


'---------------------------------------------------------------------------------------
' Procedure : Name
' Author : Adam Waller
Expand Down
29 changes: 14 additions & 15 deletions Version Control.accda.src/modules/clsDbConnection.cls
Original file line number Diff line number Diff line change
Expand Up @@ -335,21 +335,6 @@ Private Function IDbComponent_DateModified() As Date
End Function


'---------------------------------------------------------------------------------------
' Procedure : SourceModifiedDate
' Author : Adam Waller
' Date : 5/17/2021
' Purpose : The date/time the source object was modified. In most cases, this would
' : be the date/time of the source file, but it some cases like SQL objects
' : the date can be determined through other means, so this function
' : allows either approach to be taken.
'---------------------------------------------------------------------------------------
'
Private Function IDbComponent_SourceModifiedDate() As Date
IDbComponent_SourceModifiedDate = GetLastModifiedDate(IDbComponent_SourceFile)
End Function


'---------------------------------------------------------------------------------------
' Procedure : Category
' Author : Adam Waller
Expand All @@ -373,6 +358,20 @@ Private Property Get IDbComponent_BaseFolder() As String
End Property


'---------------------------------------------------------------------------------------
' Procedure : FileExtensions
' Author : Adam Waller
' Date : 12/1/2023
' Purpose : A collection of the file extensions used in source files for this
' : component type.
'---------------------------------------------------------------------------------------
'
Private Property Get IDbComponent_FileExtensions() As Collection
Set IDbComponent_FileExtensions = New Collection
IDbComponent_FileExtensions.Add "json"
End Property


'---------------------------------------------------------------------------------------
' Procedure : Name
' Author : Adam Waller
Expand Down
29 changes: 14 additions & 15 deletions Version Control.accda.src/modules/clsDbDocument.cls
Original file line number Diff line number Diff line change
Expand Up @@ -423,21 +423,6 @@ Private Function IDbComponent_DateModified() As Date
End Function


'---------------------------------------------------------------------------------------
' Procedure : SourceModifiedDate
' Author : Adam Waller
' Date : 4/27/2020
' Purpose : The date/time the source object was modified. In most cases, this would
' : be the date/time of the source file, but it some cases like SQL objects
' : the date can be determined through other means, so this function
' : allows either approach to be taken.
'---------------------------------------------------------------------------------------
'
Private Function IDbComponent_SourceModifiedDate() As Date
IDbComponent_SourceModifiedDate = GetLastModifiedDate(IDbComponent_SourceFile)
End Function


'---------------------------------------------------------------------------------------
' Procedure : Category
' Author : Adam Waller
Expand All @@ -461,6 +446,20 @@ Private Property Get IDbComponent_BaseFolder() As String
End Property


'---------------------------------------------------------------------------------------
' Procedure : FileExtensions
' Author : Adam Waller
' Date : 12/1/2023
' Purpose : A collection of the file extensions used in source files for this
' : component type.
'---------------------------------------------------------------------------------------
'
Private Property Get IDbComponent_FileExtensions() As Collection
Set IDbComponent_FileExtensions = New Collection
IDbComponent_FileExtensions.Add "json"
End Property


'---------------------------------------------------------------------------------------
' Procedure : Name
' Author : Adam Waller
Expand Down
32 changes: 15 additions & 17 deletions Version Control.accda.src/modules/clsDbForm.cls
Original file line number Diff line number Diff line change
Expand Up @@ -249,23 +249,6 @@ Private Function IDbComponent_DateModified() As Date
End Function


'---------------------------------------------------------------------------------------
' Procedure : SourceModifiedDate
' Author : Adam Waller
' Date : 4/27/2020
' Purpose : The date/time the source object was modified. In most cases, this would
' : be the date/time of the source file, but it some cases like SQL objects
' : the date can be determined through other means, so this function
' : allows either approach to be taken.
'---------------------------------------------------------------------------------------
'
Private Function IDbComponent_SourceModifiedDate() As Date
IDbComponent_SourceModifiedDate = Largest( _
GetLastModifiedDate(IDbComponent_SourceFile), _
GetLastModifiedDate(SwapExtension(IDbComponent_SourceFile, "cls")))
End Function


'---------------------------------------------------------------------------------------
' Procedure : Category
' Author : Adam Waller
Expand All @@ -289,6 +272,21 @@ Private Property Get IDbComponent_BaseFolder() As String
End Property


'---------------------------------------------------------------------------------------
' Procedure : FileExtensions
' Author : Adam Waller
' Date : 12/1/2023
' Purpose : A collection of the file extensions used in source files for this
' : component type.
'---------------------------------------------------------------------------------------
'
Private Property Get IDbComponent_FileExtensions() As Collection
Set IDbComponent_FileExtensions = New Collection
IDbComponent_FileExtensions.Add "bas"
IDbComponent_FileExtensions.Add "cls"
End Property


'---------------------------------------------------------------------------------------
' Procedure : Name
' Author : Adam Waller
Expand Down
Loading

0 comments on commit 2b37bdb

Please sign in to comment.