Skip to content

Commit 2b37bdb

Browse files
Refactor components to provide file extension list
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.)
1 parent b70b8cd commit 2b37bdb

29 files changed

+421
-461
lines changed

Version Control.accda.src/modules/IDbComponent.cls

+12-14
Original file line numberDiff line numberDiff line change
@@ -149,20 +149,6 @@ Public Function DateModified() As Date
149149
End Function
150150

151151

152-
'---------------------------------------------------------------------------------------
153-
' Procedure : SourceModifiedDateDate
154-
' Author : Adam Waller
155-
' Date : 4/27/2020
156-
' Purpose : The date/time the source object was modified. In most cases, this would
157-
' : be the date/time of the source file, but it some cases like SQL objects
158-
' : the date can be determined through other means, so this function
159-
' : allows either approach to be taken.
160-
'---------------------------------------------------------------------------------------
161-
'
162-
Public Function SourceModifiedDate() As Date
163-
End Function
164-
165-
166152
'---------------------------------------------------------------------------------------
167153
' Procedure : BaseFolder
168154
' Author : Adam Waller
@@ -184,6 +170,18 @@ Public Property Get SourceFile() As String
184170
End Property
185171

186172

173+
'---------------------------------------------------------------------------------------
174+
' Procedure : FileExtensions
175+
' Author : Adam Waller
176+
' Date : 12/1/2023
177+
' Purpose : A collection of the file extensions used in source files for this
178+
' : component type.
179+
'---------------------------------------------------------------------------------------
180+
'
181+
Public Property Get FileExtensions() As Collection
182+
End Property
183+
184+
187185
'---------------------------------------------------------------------------------------
188186
' Procedure : GetFileList
189187
' Author : Adam Waller

Version Control.accda.src/modules/clsAdpFunction.cls

+14-15
Original file line numberDiff line numberDiff line change
@@ -188,21 +188,6 @@ Private Function IDbComponent_DateModified() As Date
188188
End Function
189189

190190

191-
'---------------------------------------------------------------------------------------
192-
' Procedure : SourceModifiedDate
193-
' Author : Adam Waller
194-
' Date : 4/27/2020
195-
' Purpose : The date/time the source object was modified. In most cases, this would
196-
' : be the date/time of the source file, but it some cases like SQL objects
197-
' : the date can be determined through other means, so this function
198-
' : allows either approach to be taken.
199-
'---------------------------------------------------------------------------------------
200-
'
201-
Private Function IDbComponent_SourceModifiedDate() As Date
202-
IDbComponent_SourceModifiedDate = GetLastModifiedDate(IDbComponent_SourceFile)
203-
End Function
204-
205-
206191
'---------------------------------------------------------------------------------------
207192
' Procedure : Category
208193
' Author : Adam Waller
@@ -226,6 +211,20 @@ Private Property Get IDbComponent_BaseFolder() As String
226211
End Property
227212

228213

214+
'---------------------------------------------------------------------------------------
215+
' Procedure : FileExtensions
216+
' Author : Adam Waller
217+
' Date : 12/1/2023
218+
' Purpose : A collection of the file extensions used in source files for this
219+
' : component type.
220+
'---------------------------------------------------------------------------------------
221+
'
222+
Private Property Get IDbComponent_FileExtensions() As Collection
223+
Set IDbComponent_FileExtensions = New Collection
224+
IDbComponent_FileExtensions.Add "sql"
225+
End Property
226+
227+
229228
'---------------------------------------------------------------------------------------
230229
' Procedure : Name
231230
' Author : Adam Waller

Version Control.accda.src/modules/clsAdpProcedure.cls

+14-15
Original file line numberDiff line numberDiff line change
@@ -188,21 +188,6 @@ Private Function IDbComponent_DateModified() As Date
188188
End Function
189189

190190

191-
'---------------------------------------------------------------------------------------
192-
' Procedure : SourceModifiedDate
193-
' Author : Adam Waller
194-
' Date : 4/27/2020
195-
' Purpose : The date/time the source object was modified. In most cases, this would
196-
' : be the date/time of the source file, but it some cases like SQL objects
197-
' : the date can be determined through other means, so this function
198-
' : allows either approach to be taken.
199-
'---------------------------------------------------------------------------------------
200-
'
201-
Private Function IDbComponent_SourceModifiedDate() As Date
202-
IDbComponent_SourceModifiedDate = GetLastModifiedDate(IDbComponent_SourceFile)
203-
End Function
204-
205-
206191
'---------------------------------------------------------------------------------------
207192
' Procedure : Category
208193
' Author : Adam Waller
@@ -226,6 +211,20 @@ Private Property Get IDbComponent_BaseFolder() As String
226211
End Property
227212

228213

214+
'---------------------------------------------------------------------------------------
215+
' Procedure : FileExtensions
216+
' Author : Adam Waller
217+
' Date : 12/1/2023
218+
' Purpose : A collection of the file extensions used in source files for this
219+
' : component type.
220+
'---------------------------------------------------------------------------------------
221+
'
222+
Private Property Get IDbComponent_FileExtensions() As Collection
223+
Set IDbComponent_FileExtensions = New Collection
224+
IDbComponent_FileExtensions.Add "sql"
225+
End Property
226+
227+
229228
'---------------------------------------------------------------------------------------
230229
' Procedure : Name
231230
' Author : Adam Waller

Version Control.accda.src/modules/clsAdpServerView.cls

+14-15
Original file line numberDiff line numberDiff line change
@@ -188,21 +188,6 @@ Private Function IDbComponent_DateModified() As Date
188188
End Function
189189

190190

191-
'---------------------------------------------------------------------------------------
192-
' Procedure : SourceModifiedDate
193-
' Author : Adam Waller
194-
' Date : 4/27/2020
195-
' Purpose : The date/time the source object was modified. In most cases, this would
196-
' : be the date/time of the source file, but it some cases like SQL objects
197-
' : the date can be determined through other means, so this function
198-
' : allows either approach to be taken.
199-
'---------------------------------------------------------------------------------------
200-
'
201-
Private Function IDbComponent_SourceModifiedDate() As Date
202-
IDbComponent_SourceModifiedDate = GetLastModifiedDate(IDbComponent_SourceFile)
203-
End Function
204-
205-
206191
'---------------------------------------------------------------------------------------
207192
' Procedure : Category
208193
' Author : Adam Waller
@@ -226,6 +211,20 @@ Private Property Get IDbComponent_BaseFolder() As String
226211
End Property
227212

228213

214+
'---------------------------------------------------------------------------------------
215+
' Procedure : FileExtensions
216+
' Author : Adam Waller
217+
' Date : 12/1/2023
218+
' Purpose : A collection of the file extensions used in source files for this
219+
' : component type.
220+
'---------------------------------------------------------------------------------------
221+
'
222+
Private Property Get IDbComponent_FileExtensions() As Collection
223+
Set IDbComponent_FileExtensions = New Collection
224+
IDbComponent_FileExtensions.Add "sql"
225+
End Property
226+
227+
229228
'---------------------------------------------------------------------------------------
230229
' Procedure : Name
231230
' Author : Adam Waller

Version Control.accda.src/modules/clsAdpTable.cls

+14-15
Original file line numberDiff line numberDiff line change
@@ -248,21 +248,6 @@ Private Function IDbComponent_DateModified() As Date
248248
End Function
249249

250250

251-
'---------------------------------------------------------------------------------------
252-
' Procedure : SourceModifiedDate
253-
' Author : Adam Waller
254-
' Date : 4/27/2020
255-
' Purpose : The date/time the source object was modified. In most cases, this would
256-
' : be the date/time of the source file, but it some cases like SQL objects
257-
' : the date can be determined through other means, so this function
258-
' : allows either approach to be taken.
259-
'---------------------------------------------------------------------------------------
260-
'
261-
Private Function IDbComponent_SourceModifiedDate() As Date
262-
IDbComponent_SourceModifiedDate = GetLastModifiedDate(IDbComponent_SourceFile)
263-
End Function
264-
265-
266251
'---------------------------------------------------------------------------------------
267252
' Procedure : Category
268253
' Author : Adam Waller
@@ -286,6 +271,20 @@ Private Property Get IDbComponent_BaseFolder() As String
286271
End Property
287272

288273

274+
'---------------------------------------------------------------------------------------
275+
' Procedure : FileExtensions
276+
' Author : Adam Waller
277+
' Date : 12/1/2023
278+
' Purpose : A collection of the file extensions used in source files for this
279+
' : component type.
280+
'---------------------------------------------------------------------------------------
281+
'
282+
Private Property Get IDbComponent_FileExtensions() As Collection
283+
Set IDbComponent_FileExtensions = New Collection
284+
IDbComponent_FileExtensions.Add "txt"
285+
End Property
286+
287+
289288
'---------------------------------------------------------------------------------------
290289
' Procedure : Name
291290
' Author : Adam Waller

Version Control.accda.src/modules/clsAdpTrigger.cls

+14-15
Original file line numberDiff line numberDiff line change
@@ -214,21 +214,6 @@ Private Function IDbComponent_DateModified() As Date
214214
End Function
215215

216216

217-
'---------------------------------------------------------------------------------------
218-
' Procedure : SourceModifiedDate
219-
' Author : Adam Waller
220-
' Date : 4/27/2020
221-
' Purpose : The date/time the source object was modified. In most cases, this would
222-
' : be the date/time of the source file, but it some cases like SQL objects
223-
' : the date can be determined through other means, so this function
224-
' : allows either approach to be taken.
225-
'---------------------------------------------------------------------------------------
226-
'
227-
Private Function IDbComponent_SourceModifiedDate() As Date
228-
IDbComponent_SourceModifiedDate = GetLastModifiedDate(IDbComponent_SourceFile)
229-
End Function
230-
231-
232217
'---------------------------------------------------------------------------------------
233218
' Procedure : Category
234219
' Author : Adam Waller
@@ -252,6 +237,20 @@ Private Property Get IDbComponent_BaseFolder() As String
252237
End Property
253238

254239

240+
'---------------------------------------------------------------------------------------
241+
' Procedure : FileExtensions
242+
' Author : Adam Waller
243+
' Date : 12/1/2023
244+
' Purpose : A collection of the file extensions used in source files for this
245+
' : component type.
246+
'---------------------------------------------------------------------------------------
247+
'
248+
Private Property Get IDbComponent_FileExtensions() As Collection
249+
Set IDbComponent_FileExtensions = New Collection
250+
IDbComponent_FileExtensions.Add "sql"
251+
End Property
252+
253+
255254
'---------------------------------------------------------------------------------------
256255
' Procedure : Name
257256
' Author : Adam Waller

Version Control.accda.src/modules/clsDbConnection.cls

+14-15
Original file line numberDiff line numberDiff line change
@@ -335,21 +335,6 @@ Private Function IDbComponent_DateModified() As Date
335335
End Function
336336

337337

338-
'---------------------------------------------------------------------------------------
339-
' Procedure : SourceModifiedDate
340-
' Author : Adam Waller
341-
' Date : 5/17/2021
342-
' Purpose : The date/time the source object was modified. In most cases, this would
343-
' : be the date/time of the source file, but it some cases like SQL objects
344-
' : the date can be determined through other means, so this function
345-
' : allows either approach to be taken.
346-
'---------------------------------------------------------------------------------------
347-
'
348-
Private Function IDbComponent_SourceModifiedDate() As Date
349-
IDbComponent_SourceModifiedDate = GetLastModifiedDate(IDbComponent_SourceFile)
350-
End Function
351-
352-
353338
'---------------------------------------------------------------------------------------
354339
' Procedure : Category
355340
' Author : Adam Waller
@@ -373,6 +358,20 @@ Private Property Get IDbComponent_BaseFolder() As String
373358
End Property
374359

375360

361+
'---------------------------------------------------------------------------------------
362+
' Procedure : FileExtensions
363+
' Author : Adam Waller
364+
' Date : 12/1/2023
365+
' Purpose : A collection of the file extensions used in source files for this
366+
' : component type.
367+
'---------------------------------------------------------------------------------------
368+
'
369+
Private Property Get IDbComponent_FileExtensions() As Collection
370+
Set IDbComponent_FileExtensions = New Collection
371+
IDbComponent_FileExtensions.Add "json"
372+
End Property
373+
374+
376375
'---------------------------------------------------------------------------------------
377376
' Procedure : Name
378377
' Author : Adam Waller

Version Control.accda.src/modules/clsDbDocument.cls

+14-15
Original file line numberDiff line numberDiff line change
@@ -423,21 +423,6 @@ Private Function IDbComponent_DateModified() As Date
423423
End Function
424424

425425

426-
'---------------------------------------------------------------------------------------
427-
' Procedure : SourceModifiedDate
428-
' Author : Adam Waller
429-
' Date : 4/27/2020
430-
' Purpose : The date/time the source object was modified. In most cases, this would
431-
' : be the date/time of the source file, but it some cases like SQL objects
432-
' : the date can be determined through other means, so this function
433-
' : allows either approach to be taken.
434-
'---------------------------------------------------------------------------------------
435-
'
436-
Private Function IDbComponent_SourceModifiedDate() As Date
437-
IDbComponent_SourceModifiedDate = GetLastModifiedDate(IDbComponent_SourceFile)
438-
End Function
439-
440-
441426
'---------------------------------------------------------------------------------------
442427
' Procedure : Category
443428
' Author : Adam Waller
@@ -461,6 +446,20 @@ Private Property Get IDbComponent_BaseFolder() As String
461446
End Property
462447

463448

449+
'---------------------------------------------------------------------------------------
450+
' Procedure : FileExtensions
451+
' Author : Adam Waller
452+
' Date : 12/1/2023
453+
' Purpose : A collection of the file extensions used in source files for this
454+
' : component type.
455+
'---------------------------------------------------------------------------------------
456+
'
457+
Private Property Get IDbComponent_FileExtensions() As Collection
458+
Set IDbComponent_FileExtensions = New Collection
459+
IDbComponent_FileExtensions.Add "json"
460+
End Property
461+
462+
464463
'---------------------------------------------------------------------------------------
465464
' Procedure : Name
466465
' Author : Adam Waller

Version Control.accda.src/modules/clsDbForm.cls

+15-17
Original file line numberDiff line numberDiff line change
@@ -249,23 +249,6 @@ Private Function IDbComponent_DateModified() As Date
249249
End Function
250250

251251

252-
'---------------------------------------------------------------------------------------
253-
' Procedure : SourceModifiedDate
254-
' Author : Adam Waller
255-
' Date : 4/27/2020
256-
' Purpose : The date/time the source object was modified. In most cases, this would
257-
' : be the date/time of the source file, but it some cases like SQL objects
258-
' : the date can be determined through other means, so this function
259-
' : allows either approach to be taken.
260-
'---------------------------------------------------------------------------------------
261-
'
262-
Private Function IDbComponent_SourceModifiedDate() As Date
263-
IDbComponent_SourceModifiedDate = Largest( _
264-
GetLastModifiedDate(IDbComponent_SourceFile), _
265-
GetLastModifiedDate(SwapExtension(IDbComponent_SourceFile, "cls")))
266-
End Function
267-
268-
269252
'---------------------------------------------------------------------------------------
270253
' Procedure : Category
271254
' Author : Adam Waller
@@ -289,6 +272,21 @@ Private Property Get IDbComponent_BaseFolder() As String
289272
End Property
290273

291274

275+
'---------------------------------------------------------------------------------------
276+
' Procedure : FileExtensions
277+
' Author : Adam Waller
278+
' Date : 12/1/2023
279+
' Purpose : A collection of the file extensions used in source files for this
280+
' : component type.
281+
'---------------------------------------------------------------------------------------
282+
'
283+
Private Property Get IDbComponent_FileExtensions() As Collection
284+
Set IDbComponent_FileExtensions = New Collection
285+
IDbComponent_FileExtensions.Add "bas"
286+
IDbComponent_FileExtensions.Add "cls"
287+
End Property
288+
289+
292290
'---------------------------------------------------------------------------------------
293291
' Procedure : Name
294292
' Author : Adam Waller

0 commit comments

Comments
 (0)